RTPDF-32
PDF Generator Library for RTOS-32
|
#include "RTPDF-DDI.h"
Go to the source code of this file.
Typedefs | |
typedef void * | LPPDFINFO |
typedef void * | HANDLE |
Functions | |
Library Initialization | |
Initialize the library, set license key, allocate and free internal structures //
// This sample shows how to initialize and terminate the RTPDF-32 library
//
int main()
{
if (pdev)
{
// provide a valid license key depending on the version of the library and licensed features
const char *szLicenseKey = "07EFCDAB...EA8B";
RTPdfSetLicenseKey(pdev, "*****", szLicenseKey, strlen(szLicenseKey));
// Add here code to render to PDF
// ...
// free all internal structures and terminate
RTPdfEnd(pdev);
}
}
void RTPdfEnd(LPPDFINFO pdev) Clear all memory allocated while creating a PDF file and free the PDFINFO structure. int RTPdfSetLicenseKey(LPPDFINFO pdev, const char *szLicensee, const char *szKey, int nKeyLen) Set the License Key for the library. The license key contains specific licensed features and the libr... | |
LPPDFINFO | RTPdfInit () |
Allocate memory and initialize a PDFINFO structure. More... | |
void | RTPdfEnd (LPPDFINFO pdev) |
Clear all memory allocated while creating a PDF file and free the PDFINFO structure. More... | |
int | RTPdfSetLicenseKey (LPPDFINFO pdev, const char *szLicensee, const char *szKey, int nKeyLen) |
Set the License Key for the library. The license key contains specific licensed features and the library version number Should be called directly after RTPdfInit. More... | |
Document and Page Processing Functions | |
Start and End a PDF document, Start and End document pages //
// This sample shows how to start a new PDF document and create a couple of pages
//
int main()
{
if (pdev)
{
// provide a valid license key depending on the version of the library and licensed features
const char *szLicenseKey = "07EFCDAB...EA8B";
RTPdfSetLicenseKey(pdev, "*****", szLicenseKey, strlen(szLicenseKey));
// start a new PDF document
RTPdfStartDoc(pdev);
// start page 1
RTPdfStartPage(pdev);
// Add here code to render page 1
// ...
// end page 1
RTPdfEndPage(pdev);
// start page 2
RTPdfStartPage(pdev);
// Add here code to render page 2
// ...
// end page 2
RTPdfEndPage(pdev);
// signal end of document
RTPdfEndDoc(pdev);
// free all internal structures and terminate
RTPdfEnd(pdev);
}
}
int RTPdfStartPage(LPPDFINFO pdev) Start a new page, should be called after a call to RTPdfStartDoc and before a new page is started. int RTPdfEndDoc(LPPDFINFO pdev) End the current document, no output is allowed after this call. | |
int | RTPdfStartDoc (LPPDFINFO pdev) |
Start a new PDF document. More... | |
int | RTPdfStartPage (LPPDFINFO pdev) |
Start a new page, should be called after a call to RTPdfStartDoc and before a new page is started. More... | |
int | RTPdfEndPage (LPPDFINFO pdev) |
End the current page. More... | |
int | RTPdfEndDoc (LPPDFINFO pdev) |
End the current document, no output is allowed after this call. More... | |
int | RTPdfResetDevmode (LPPDFINFO pdev, PDEVMODEA pdm) |
Set the page dimensions and orientation of all pages following this call. More... | |
void | RTPdfSetDrawingOrigin (LPPDFINFO pdev, long lXOrg, long lYOrg) |
Shift all drawing operations by a certain distance To reset the origin, call the same function with opposite X and Y values. More... | |
Callback Functions | |
These are callback functions from the library. The caller has to implement these functions in order to tell the library where to store the PDF data The callback IsMetricCountry also configures the library for Letter or A4 papersize //
// This sample shows how to write the PDF file to a file under the c:\temp folder
//
{
return (HANDLE)CreateFile("c:\\temp\\test.pdf", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
}
{
return WriteFile(hPort, pData, *pdwDataSize, pdwDataSize, NULL);
}
{
return CloseHandle(hPort);
}
int RTPdfClosePort(HANDLE hPort, int bCancel) Close the file or port that was opened in RTPdfOpenPort. int RTPdfWritePort(HANDLE hPort, const unsigned char *pData, unsigned long *pdwDataSize) Write a block of data to the specified file or port. HANDLE RTPdfOpenPort(const char *szDocTitle, const unsigned long dwJobId) Allows the caller to create a file or open a port to where the PDF data is sent. | |
HANDLE | RTPdfOpenPort (const char *szDocTitle, const unsigned long dwJobId) |
Allows the caller to create a file or open a port to where the PDF data is sent. More... | |
int | RTPdfWritePort (HANDLE hPort, const unsigned char *pData, unsigned long *pdwDataSize) |
Write a block of data to the specified file or port. More... | |
int | RTPdfClosePort (HANDLE hPort, int bCancel) |
Close the file or port that was opened in RTPdfOpenPort. More... | |
int | IsMetricCountry () |
This function is used to set the default paper size to Letter or A4 By default RTPDF-32 attempts to read the paper size from the system Locale settings and will only call IsMetricCountry if this is not successful. More... | |
Text Rendering Functions | |
Font and Text handling functions //
// This sample shows how to select a font and render some text on a page
//
// document must be started before creating any fonts
RTPdfStartDoc(pdev);
// Load Helvetica (Arial) font
// start page
RTPdfStartPage(pdev);
// set font and text size
RTPdfSetFont(pdev, hFnt1, 10.4f);
// output some text
RTPdfTextOut(pdev, NULL, NULL, FLOAT2LONG(100.0f), FLOAT2LONG(100.0f), 0.0f, (const BYTE *)"RTPDF Text Output", strlen("RTPDF Text Output"), 0);
RTPdfEndPage(pdev);
int RTPdfSetFont(LPPDFINFO pdev, HANDLE hFont, float fPointSize) Set the font to be used in all text drawing operations after this function is called. HANDLE RTPdfGetFont(LPPDFINFO pdev, const char *szFontName, int bBold, int bItalic, int nCodePage, int bType1, int bCID) Create a PDF font object and return a handle that can be used to render text on a page RTPdfStartDoc ... int RTPdfTextOut(LPPDFINFO pdev, CLIPOBJ *pco, BRUSHOBJ *pboText, long lPosX, long lPosY, float fAngle, const BYTE *pbCharCodes, int nCharCount, int nEncoding) | |
HANDLE | RTPdfGetFont (LPPDFINFO pdev, const char *szFontName, int bBold, int bItalic, int nCodePage, int bType1, int bCID) |
Create a PDF font object and return a handle that can be used to render text on a page RTPdfStartDoc has to be called before any fonts are created The PDF specifications define a set of 14 fonts that can be used within a PDF document without prior definition of these fonts Because RTOS-32 has no support for fonts, only these 14 predefined fonts are upported by RTPDF-32 These fonts are: Helvetica (equivalent to Arial), Helvetica-Bold, Helvetica-BoldItalic, Helvetica-Italic Times (equivalent to Times New Roman), Times-Bold, Times-BoldItalic, Times-Italic Courier (equivalent to Courier New), Courier-Bold, Courier-BoldItalic, Courier-Italic Symbol ITC Zapf Dingbats. More... | |
int | RTPdfSetFont (LPPDFINFO pdev, HANDLE hFont, float fPointSize) |
Set the font to be used in all text drawing operations after this function is called. More... | |
int | RTPdfSetTextSpacing (LPPDFINFO pdev, long lWordSpacing, long lCharSpacing) |
Set the Word and Character spacing of any text drawn after this function is called. More... | |
int | RTPdfTextOut (LPPDFINFO pdev, CLIPOBJ *pco, BRUSHOBJ *pboText, long lPosX, long lPosY, float fAngle, const BYTE *pbCharCodes, int nCharCount, int nEncoding) |
float | RTPdfGetTextWidth (HANDLE hFont, float fPointSize, const BYTE *pbCharCodes, int nCharCount, int nEncoding) |
Get width of a text string given the font name and size. More... | |
int | RTPdfDrawText (LPPDFINFO pdev, RECT rcText, UINT nTextAlign, int bClipToBoundaries, COLORREF crTextColor, const BYTE *pbCharCodes, int nCharCount, int nEncoding) |
Draw text given a bounding rectangle. More... | |
Image Rendering Functions | |
//
// This sample shows how to render an image
//
// load an image from memory into the PDF object
// create a clipping path to crop the image
CLIPOBJ clipPath = {
0, // Region Identifier, should be 0
{ FLOAT2LONG(36.0f), FLOAT2LONG(36.0f), FLOAT2LONG(80.0f), FLOAT2LONG(80.0f) }, // Rectangular region bounds
DC_RECT, // Rectangular clipping region, the only supported value
FC_RECT, // Complexity of the region
0, // Not used
0 // Not used
};
// draw image
RTPdfDrawImage(pdev, &clipPath, hImg1, FLOAT2LONG(36.0f), FLOAT2LONG(36.0f), FLOAT2LONG(72.5f), FLOAT2LONG(0.0f));
HANDLE RTPdfGetImage(LPPDFINFO pdev, const BYTE *pbImageData, unsigned long ulImageSize) Output an image object to the PDF stream without yet drawing any image BMP, JPeg and PNG images are c... int RTPdfDrawImage(LPPDFINFO pdev, CLIPOBJ *pco, HANDLE hImage, long lStartX, long lStartY, long lWidth, long lHeight, int bKeepAspectRatio) Draw a preloaded image to a specific location on a page All units should be provided in PDF units whe... | |
HANDLE | RTPdfGetImage (LPPDFINFO pdev, const BYTE *pbImageData, unsigned long ulImageSize) |
Output an image object to the PDF stream without yet drawing any image BMP, JPeg and PNG images are currently supported. This call will fail if a specific image is not supported by the PDF specifications or by RTPDF-32 Example: PNG images with a bit depth different than 8 are not supported The returned handle can later be used to draw the image on one or multiple pages The RTPDF-32 library deletes the returned handle when the document is closed. More... | |
int | RTPdfDrawImage (LPPDFINFO pdev, CLIPOBJ *pco, HANDLE hImage, long lStartX, long lStartY, long lWidth, long lHeight, int bKeepAspectRatio) |
Draw a preloaded image to a specific location on a page All units should be provided in PDF units where 1 unit is 1/72 of an inch If the destination height of the image is specified as 0.0f, the width of the image is adjusted to keep the original aspect ratio If the destination width of the image is specified as 0.0f, the height of the image is adjusted to keep the original aspect ratio If both width and height are specified and bKeepAspectRatio is 1, the image is centered in the rectangle while keeping its aspect ratio. More... | |
Vector Rendering Functions | |
//
// This sample shows how to draw a polygon with dashed lines and fill it with a solid color
//
// create a path object to draw
PATHOBJ *ppo = RTPdfCreatePath(pdev);
// start coordinates of our polygon
POINTFIX pfx1 = { FLOAT2FIX(100.4f), FLOAT2FIX(100.0f) };
// add 2 other vertices
POINTFIX pfx2[] = { { FLOAT2FIX(200.6f), FLOAT2FIX(200.0f) },
{ FLOAT2FIX(300.6f), FLOAT2FIX(200.0f) }
};
// define the stroked and fill brushes
BRUSHOBJ stroke_brush = { RGB2GDIBRUSH(0x00, 0x55, 0xAF), 0, 0 }; // blue-ish
BRUSHOBJ fill_brush = { RGB2GDIBRUSH(0x00, 0xAF, 0x55), 0, 0 }; // green-ish
// create a dashed line with a proportion of 5 to 1
FLOAT_LONG DashedLineStyle[2];
DashedLineStyle[0].l = 10;
DashedLineStyle[1].l = 2;
LINEATTRS DashedLine = {
0, // Option flags, should be 0
JOIN_ROUND, // Join style
ENDCAP_ROUND, // End cap style
0, // Line width
0, // Not used
_countof(DashedLineStyle), // Number of entries in the style array
DashedLineStyle, // Style array for non-continuous lines
0 // Not used
};
DashedLine.elWidth.l = 10; // line width in pixels x 10
PATHOBJ_bMoveTo(ppo, pfx1);
PATHOBJ_bPolyLineTo(ppo, pfx2, _countof(pfx2));
// close our figure
PATHOBJ_bPolyLineTo(ppo, &pfx1, 1);
RTPdfStrokeAndFillPath(pdev, ppo, NULL, &stroke_brush, &DashedLine, &fill_brush, NULL, 0, PDF_PATH_FILLANDSTROKE);
// always delete the path object when done
RTPdfDeletePath(ppo);
PATHOBJ * RTPdfCreatePath(LPPDFINFO pdev) Create a path object made of lines and curves to be used in all vector drawing operations See PATHOB... void RTPdfDeletePath(PATHOBJ *ppo) Delete the path object created through RTPdfCreatePath. int RTPdfStrokeAndFillPath(LPPDFINFO pdev, PATHOBJ *ppo, CLIPOBJ *pco, BRUSHOBJ *pboStroke, PLINEATTRS plineattrs, BRUSHOBJ *pboFill, PPOINTL pptlBrushOrg, ULONG mix, FLONG flOptions) Draw a path object made of straight lines and/or Bezier curves If requested, also fill the path using... | |
#define | PDF_PATH_NONE 0 |
#define | PDF_PATH_STROKE 1 |
#define | PDF_PATH_FILL 2 |
#define | PDF_PATH_FILLANDSTROKE 3 |
#define | PDF_PATH_FILL_WINDING 8 |
PATHOBJ * | RTPdfCreatePath (LPPDFINFO pdev) |
Create a path object made of lines and curves to be used in all vector drawing operations See PATHOBJ_bMoveTo, PATHOBJ_bPolyLineTo and PATHOBJ_bPolyBezierTo for how to add elements to the path. More... | |
void | RTPdfDeletePath (PATHOBJ *ppo) |
Delete the path object created through RTPdfCreatePath. More... | |
int | RTPdfStrokeAndFillPath (LPPDFINFO pdev, PATHOBJ *ppo, CLIPOBJ *pco, BRUSHOBJ *pboStroke, PLINEATTRS plineattrs, BRUSHOBJ *pboFill, PPOINTL pptlBrushOrg, ULONG mix, FLONG flOptions) |
Draw a path object made of straight lines and/or Bezier curves If requested, also fill the path using the specified brush. More... | |
Document Metadata and Structure Functions | |
enum | _DocumentInfo { DocumentInfoTitle = 0 , DocumentInfoAuthor = 1 , DocumentInfoCreator = 2 , DocumentInfoSubject = 3 , DocumentInfoKeywords = 4 } |
Enumeration of the various document info attributes that can be used in RTPdfSetDocumentInfo. More... | |
typedef enum _DocumentInfo | DocumentInfo |
Enumeration of the various document info attributes that can be used in RTPdfSetDocumentInfo. More... | |
int | RTPdfSetDocumentInfo (LPPDFINFO pdev, DocumentInfo nDocumentInfo, const BYTE *szEntryValue) |
Set a document information attribute (also known as Metadata) The attributes should be set before calling RTPdfStartDoc and cannot be modified afterwards Document attributes in PDF use the PDFDocEncoding character encoding which is documented in the PDF specs Unicode strings can be set by prefixing the string with 0xFEFF. The macro INIT_UNICODE_STRING can be used to create unicode strings . More... | |
int | RTPdfSetLayer (LPPDFINFO pdev, PWSTR pwstrLayerTitle) |
Specify a PDF layer on which to place the next objects. More... | |
void | RTPdfSetHyperLink (LPPDFINFO pdev, const PRECTL prclHyperLink, PWSTR pwszDestination) |
Create a hyperlink to an internal location (bookmark) or external location (URL) More... | |
int | RTPdfSetBookmark (LPPDFINFO pdev, int nParent, PWSTR pwstrBookmarkTitle) |
Add a bookmark to the current location in the bookmarks tree. More... | |
#define PDF_PATH_FILL 2 |
#define PDF_PATH_FILL_WINDING 8 |
#define PDF_PATH_FILLANDSTROKE 3 |
#define PDF_PATH_NONE 0 |
#define PDF_PATH_STROKE 1 |
typedef enum _DocumentInfo DocumentInfo |
Enumeration of the various document info attributes that can be used in RTPdfSetDocumentInfo.
typedef void* HANDLE |
typedef void* LPPDFINFO |
enum _DocumentInfo |
int IsMetricCountry | ( | ) |
This function is used to set the default paper size to Letter or A4 By default RTPDF-32 attempts to read the paper size from the system Locale settings and will only call IsMetricCountry if this is not successful.
int RTPdfClosePort | ( | HANDLE | hPort, |
int | bCancel | ||
) |
Close the file or port that was opened in RTPdfOpenPort.
hPort | Pointer to the file or port opened by the caller in RTPdfOpenPort |
bCancel | 1 if the document was canceled, e.g. in the case of an error, 0 if the document terminated normally |
PATHOBJ * RTPdfCreatePath | ( | LPPDFINFO | pdev | ) |
Create a path object made of lines and curves to be used in all vector drawing operations
See PATHOBJ_bMoveTo, PATHOBJ_bPolyLineTo and PATHOBJ_bPolyBezierTo for how to add elements to the path.
pdev | Pointer to PDFINFO structure returned by RTPdfInit |
void RTPdfDeletePath | ( | PATHOBJ * | ppo | ) |
Delete the path object created through RTPdfCreatePath.
ppo | Path object returned by RTPdfCreatePath |
int RTPdfDrawImage | ( | LPPDFINFO | pdev, |
CLIPOBJ * | pco, | ||
HANDLE | hImage, | ||
long | lStartX, | ||
long | lStartY, | ||
long | lWidth, | ||
long | lHeight, | ||
int | bKeepAspectRatio | ||
) |
Draw a preloaded image to a specific location on a page All units should be provided in PDF units where 1 unit is 1/72 of an inch If the destination height of the image is specified as 0.0f, the width of the image is adjusted to keep the original aspect ratio If the destination width of the image is specified as 0.0f, the height of the image is adjusted to keep the original aspect ratio If both width and height are specified and bKeepAspectRatio is 1, the image is centered in the rectangle while keeping its aspect ratio.
pdev | Pointer to PDFINFO structure returned by RTPdfInit |
pco | Pointer to a clipping object used to clip the path |
hImage | Handle of an image returned by RTPdfGetImage |
lStartX | Left coordinate |
lStartY | Top coordinate |
lWidth | Destination width of the image |
lHeight | Destination height of the image |
bKeepAspectRatio | Flag to center the image while keeping its aspect ratio |
int RTPdfDrawText | ( | LPPDFINFO | pdev, |
RECT | rcText, | ||
UINT | nTextAlign, | ||
int | bClipToBoundaries, | ||
COLORREF | crTextColor, | ||
const BYTE * | pbCharCodes, | ||
int | nCharCount, | ||
int | nEncoding | ||
) |
Draw text given a bounding rectangle.
pdev | Pointer to PDFINFO structure returned by RTPdfInit |
rcText | Bounding rectangle |
nTextAlign | Combination of horizontal and vertical text alignement. Should be created using MAKELONG(horzAlign, vertAlign) For values of horizontal and vertical alignment values check the acReportCell::HorzAlign and acReportCellVertAlign enumerators |
bClipToBoundaries | If 1 clip the text to cell rcText boundaries |
crTextColor | Color in GDI format to render the text, can be created using the RGB2GDICOLOR macro |
pbCharCodes | Text encoded in WinAnsi character codes |
nCharCount | Number of characters in pbCharCodes |
nEncoding | Reserved for future use |
void RTPdfEnd | ( | LPPDFINFO | pdev | ) |
Clear all memory allocated while creating a PDF file and free the PDFINFO structure.
pdev | Pointer to PDFINFO structure returned by RTPdfInit |
int RTPdfEndDoc | ( | LPPDFINFO | pdev | ) |
End the current document, no output is allowed after this call.
pdev | Pointer to PDFINFO structure returned by RTPdfInit |
int RTPdfEndPage | ( | LPPDFINFO | pdev | ) |
End the current page.
pdev | Pointer to PDFINFO structure returned by RTPdfInit |
HANDLE RTPdfGetFont | ( | LPPDFINFO | pdev, |
const char * | szFontName, | ||
int | bBold, | ||
int | bItalic, | ||
int | nCodePage, | ||
int | bType1, | ||
int | bCID | ||
) |
Create a PDF font object and return a handle that can be used to render text on a page RTPdfStartDoc has to be called before any fonts are created The PDF specifications define a set of 14 fonts that can be used within a PDF document without prior definition of these fonts Because RTOS-32 has no support for fonts, only these 14 predefined fonts are upported by RTPDF-32 These fonts are: Helvetica (equivalent to Arial), Helvetica-Bold, Helvetica-BoldItalic, Helvetica-Italic Times (equivalent to Times New Roman), Times-Bold, Times-BoldItalic, Times-Italic Courier (equivalent to Courier New), Courier-Bold, Courier-BoldItalic, Courier-Italic Symbol ITC Zapf Dingbats.
pdev | Pointer to PDFINFO structure returned by RTPdfInit |
szFontName | The font name and style to be used |
bBold | Reserved for future use |
bItalic | Reserved for future use |
nCodePage | Reserved for future use |
bType1 | Reserved for future use |
bCID | Reserved for future use |
Output an image object to the PDF stream without yet drawing any image BMP, JPeg and PNG images are currently supported. This call will fail if a specific image is not supported by the PDF specifications or by RTPDF-32 Example: PNG images with a bit depth different than 8 are not supported The returned handle can later be used to draw the image on one or multiple pages The RTPDF-32 library deletes the returned handle when the document is closed.
pdev | Pointer to PDFINFO structure returned by RTPdfInit |
pbImageData | Pointer to the image data in Jpeg, PNG or BMP formats |
ulImageSize | Size of the image data in pbImageData |
float RTPdfGetTextWidth | ( | HANDLE | hFont, |
float | fPointSize, | ||
const BYTE * | pbCharCodes, | ||
int | nCharCount, | ||
int | nEncoding | ||
) |
Get width of a text string given the font name and size.
hFont | Pointer to the font returned in RTPdfGetFont |
fPointSize | Text size in Points |
pbCharCodes | Text string |
nCharCount | Number of characters in text string |
nEncoding | Reserved for future use |
LPPDFINFO RTPdfInit | ( | ) |
Allocate memory and initialize a PDFINFO structure.
HANDLE RTPdfOpenPort | ( | const char * | szDocTitle, |
const unsigned long | dwJobId | ||
) |
Allows the caller to create a file or open a port to where the PDF data is sent.
szDocTitle | Optional document title if set by RTPdfSetDocumentInfo |
dwJobId | Reserved for future use |
int RTPdfResetDevmode | ( | LPPDFINFO | pdev, |
PDEVMODEA | pdm | ||
) |
Set the page dimensions and orientation of all pages following this call.
pdev | Pointer to PDFINFO structure returned by RTPdfInit |
pdm | Pointer to a Windows Devmode structure containing the page information. The following settings are currently supported: dmOrientation - dmPaperSize - dmPaperLength - dmPaperWidth - dmFormName |
int RTPdfSetBookmark | ( | LPPDFINFO | pdev, |
int | nParent, | ||
PWSTR | pwstrBookmarkTitle | ||
) |
Add a bookmark to the current location in the bookmarks tree.
pdev | Pointer to PDFINFO structure returned by RTPdfInit |
nParent | Parent ID of this bookmark. Set to 0 for the root bookmark or a value returned by a previous call to RTPdfSetBookmark |
pwstrBookmarkTitle | Title of the bookmark in double-byte (Unicode) format |
int RTPdfSetDocumentInfo | ( | LPPDFINFO | pdev, |
DocumentInfo | nDocumentInfo, | ||
const BYTE * | szEntryValue | ||
) |
Set a document information attribute (also known as Metadata)
The attributes should be set before calling RTPdfStartDoc and cannot be modified afterwards
Document attributes in PDF use the PDFDocEncoding character encoding which is documented in the PDF specs
Unicode strings can be set by prefixing the string with 0xFEFF. The macro INIT_UNICODE_STRING can be used to create unicode strings
.
pdev | Pointer to PDFINFO structure returned by RTPdfInit |
nDocumentInfo | One of the DocumentInfo attributes to set |
szEntryValue | Value of the attribute, either single-byte or douvle-byte |
void RTPdfSetDrawingOrigin | ( | LPPDFINFO | pdev, |
long | lXOrg, | ||
long | lYOrg | ||
) |
Shift all drawing operations by a certain distance To reset the origin, call the same function with opposite X and Y values.
pdev | Pointer to PDFINFO structure returned by RTPdfInit |
lXOrg | Shift along the X axis |
lYOrg | Shift along the Y axis |
Set the font to be used in all text drawing operations after this function is called.
pdev | Pointer to PDFINFO structure returned by RTPdfInit |
hFont | Pointer to the font returned in RTPdfGetFont |
fPointSize | Text size in Points |
void RTPdfSetHyperLink | ( | LPPDFINFO | pdev, |
const PRECTL | prclHyperLink, | ||
PWSTR | pwszDestination | ||
) |
Create a hyperlink to an internal location (bookmark) or external location (URL)
pdev | Pointer to PDFINFO structure returned by RTPdfInit |
prclHyperLink | Pointer to a rectangle containing the bounds of the hyperlink. If this parameter is NULL, the location of the last drawn object is used |
pwszDestination | In double-byte (Unicode) format. Can be one of two things: 1) If pwszDestination starts with a number sign (#) the hyperlink points to an internal bookmark 2) If pwszDestination does not start with #, it should contain a valid external URL to which the hyperlink points |
int RTPdfSetLayer | ( | LPPDFINFO | pdev, |
PWSTR | pwstrLayerTitle | ||
) |
Specify a PDF layer on which to place the next objects.
pdev | Pointer to PDFINFO structure returned by RTPdfInit |
pwstrLayerTitle | In double-byte (Unicode) format. Can be one of three things: 1) If RTPdfSetLayer is called inside a page (between calls to StartPage and EndPage), pwstrLayerTitle is the title of the layer on which to place the objects 2) If RTPdfSetLayer is called outside a page, pwstrLayerTitle should contain the list and order in which to display the layer tree in a PDF viewer 3) If pwstrLayerTitle is an empty string, it closes the last opened layer and moves up one level |
int RTPdfSetLicenseKey | ( | LPPDFINFO | pdev, |
const char * | szLicensee, | ||
const char * | szKey, | ||
int | nKeyLen | ||
) |
Set the License Key for the library. The license key contains specific licensed features and the library version number Should be called directly after RTPdfInit.
pdev | Pointer to PDFINFO structure returned by RTPdfInit |
szLicensee | Name of licensee |
szKey | License key provided by Amyuni |
nKeyLen | Length in bytes of the szKey |
int RTPdfSetTextSpacing | ( | LPPDFINFO | pdev, |
long | lWordSpacing, | ||
long | lCharSpacing | ||
) |
Set the Word and Character spacing of any text drawn after this function is called.
pdev | Pointer to PDFINFO structure returned by RTPdfInit |
lWordSpacing | Spacing to be added to the space character (character code 32) |
lCharSpacing | Spacing to be added between characters |
int RTPdfStartDoc | ( | LPPDFINFO | pdev | ) |
Start a new PDF document.
pdev | Pointer to PDFINFO structure returned by RTPdfInit |
int RTPdfStartPage | ( | LPPDFINFO | pdev | ) |
Start a new page, should be called after a call to RTPdfStartDoc and before a new page is started.
pdev | Pointer to PDFINFO structure returned by RTPdfInit |
int RTPdfStrokeAndFillPath | ( | LPPDFINFO | pdev, |
PATHOBJ * | ppo, | ||
CLIPOBJ * | pco, | ||
BRUSHOBJ * | pboStroke, | ||
PLINEATTRS | plineattrs, | ||
BRUSHOBJ * | pboFill, | ||
PPOINTL | pptlBrushOrg, | ||
ULONG | mix, | ||
FLONG | flOptions | ||
) |
Draw a path object made of straight lines and/or Bezier curves If requested, also fill the path using the specified brush.
pdev | Pointer to PDFINFO structure returned by RTPdfInit |
ppo | Pointer to a path object returned by RTPdfCreatePath |
pco | Pointer to a clipping object used to clip the path to a rectangular area |
pboStroke | Brush object used to draw the outline of the path |
plineattrs | Line attributes that define things such as width of the line, line ending style and so on |
pboFill | Brush object used to fill the path |
pptlBrushOrg | Reserved for future use |
mix | Reserved for future use |
flOptions | A combination of PDF_PATH options as defined above |
int RTPdfTextOut | ( | LPPDFINFO | pdev, |
CLIPOBJ * | pco, | ||
BRUSHOBJ * | pboText, | ||
long | lPosX, | ||
long | lPosY, | ||
float | fAngle, | ||
const BYTE * | pbCharCodes, | ||
int | nCharCount, | ||
int | nEncoding | ||
) |
pdev | Pointer to PDFINFO structure returned by RTPdfInit |
pco | Pointer to a clipping object used to clip the path to a rectangular area |
pboText | Pointer to Brush object with which to paint the text |
lPosX | Horizontal position in PDF units |
lPosY | Vertical position in PDF units |
fAngle | Rotation angle of text in degrees and measured counter-clockwise |
pbCharCodes | Text encoded in WinAnsi character codes |
nCharCount | Number of characters in pbCharCodes |
nEncoding | Reserved for future use |
int RTPdfWritePort | ( | HANDLE | hPort, |
const unsigned char * | pData, | ||
unsigned long * | pdwDataSize | ||
) |
Write a block of data to the specified file or port.
hPort | Pointer to the file or port opened by the caller in RTPdfOpenPort |
pData | Pointer to the data to be written |
pdwDataSize | On input, number of bytes to write. On output, the caller should return the number of bytes actually written |