RTPDF-32
PDF Generator Library for RTOS-32
RTPDF-32.h
Go to the documentation of this file.
1
2// //
3// Amyuni RTPDF-32 - PDF Library for On Time RTOS-32 //
4// //
5// Copyright AMYUNI Lda. - AMYUNI Technologies //
6// 1998-2021, All Rights Reserved ***** CONFIDENTIAL ***** //
7// //
8// Permission to use this work for any purpose must be expressly obtained //
9// from: AMYUNI Technologies, https://www.amyuni.com, management@amyuni.com //
10// //
12//
13#pragma once
14
15#ifdef __cplusplus
16extern "C"
17{
18#endif
19
20#ifndef RTPDF // defined when called from within the library
21typedef void* LPPDFINFO;
22typedef void* HANDLE;
23#endif
24
25#include "RTPDF-DDI.h"
26
55
62
69
80int RTPdfSetLicenseKey(LPPDFINFO pdev, const char *szLicensee, const char *szKey, int nKeyLen);
81
83
132
140
148
156
164
189int RTPdfResetDevmode(LPPDFINFO pdev, PDEVMODEA pdm);
190
199void RTPdfSetDrawingOrigin(LPPDFINFO pdev, long lXOrg, long lYOrg);
200
202
208
212typedef enum _DocumentInfo
213{
220
242int RTPdfSetDocumentInfo(LPPDFINFO pdev, DocumentInfo nDocumentInfo, const BYTE *szEntryValue);
243
283int RTPdfSetLayer(LPPDFINFO pdev, PWSTR pwstrLayerTitle);
284
307void RTPdfSetHyperLink(LPPDFINFO pdev, const PRECTL prclHyperLink, PWSTR pwszDestination);
308
341int RTPdfSetBookmark(LPPDFINFO pdev, int nParent, PWSTR pwstrBookmarkTitle);
342
344
370
377HANDLE RTPdfOpenPort(const char *szDocTitle, const unsigned long dwJobId);
378
387int RTPdfWritePort(HANDLE hPort, const unsigned char* pData, unsigned long *pdwDataSize);
388
396int RTPdfClosePort(HANDLE hPort, int bCancel);
397
398#ifndef RTPDF
406#endif
407
409
436
458HANDLE RTPdfGetFont(LPPDFINFO pdev, const char *szFontName, int bBold, int bItalic, int nCodePage, int bType1, int bCID);
459
468int RTPdfSetFont(LPPDFINFO pdev, HANDLE hFont, float fPointSize);
469
478int RTPdfSetTextSpacing(LPPDFINFO pdev, long lWordSpacing, long lCharSpacing);
479
494int RTPdfTextOut(LPPDFINFO pdev, CLIPOBJ *pco, BRUSHOBJ *pboText, long lPosX, long lPosY, float fAngle, const BYTE *pbCharCodes, int nCharCount, int nEncoding);
495
506float RTPdfGetTextWidth(HANDLE hFont, float fPointSize, const BYTE *pbCharCodes, int nCharCount, int nEncoding);
507
522int RTPdfDrawText(LPPDFINFO pdev, RECT rcText, UINT nTextAlign, int bClipToBoundaries, COLORREF crTextColor, const BYTE *pbCharCodes, int nCharCount, int nEncoding);
523
525
552
565HANDLE RTPdfGetImage(LPPDFINFO pdev, const BYTE *pbImageData, unsigned long ulImageSize);
566
584int RTPdfDrawImage(LPPDFINFO pdev, CLIPOBJ *pco, HANDLE hImage, long lStartX, long lStartY, long lWidth, long lHeight, int bKeepAspectRatio);
586
636
645
652void RTPdfDeletePath(PATHOBJ *ppo);
653
654// fill and stoke values available for RTPdfStrokeAndFillPath::flOptions
655#define PDF_PATH_NONE 0
656#define PDF_PATH_STROKE 1
657#define PDF_PATH_FILL 2
658#define PDF_PATH_FILLANDSTROKE 3
659#define PDF_PATH_FILL_WINDING 8
660
676int RTPdfStrokeAndFillPath(LPPDFINFO pdev, PATHOBJ *ppo, CLIPOBJ *pco,
677 BRUSHOBJ *pboStroke, PLINEATTRS plineattrs,
678 BRUSHOBJ *pboFill, PPOINTL pptlBrushOrg, ULONG mix, FLONG flOptions);
679
681
682#ifdef __cplusplus
683}
684#endif
void * LPPDFINFO
Definition: RTPDF-32.h:21
void RTPdfEnd(LPPDFINFO pdev)
Clear all memory allocated while creating a PDF file and free the PDFINFO structure.
LPPDFINFO RTPdfInit()
Allocate memory and initialize a PDFINFO structure.
int RTPdfClosePort(HANDLE hPort, int bCancel)
Close the file or port that was opened in RTPdfOpenPort.
int RTPdfSetFont(LPPDFINFO pdev, HANDLE hFont, float fPointSize)
Set the font to be used in all text drawing operations after this function is called.
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.
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 RTPdfDrawText(LPPDFINFO pdev, RECT rcText, UINT nTextAlign, int bClipToBoundaries, COLORREF crTextColor, const BYTE *pbCharCodes, int nCharCount, int nEncoding)
Draw text given a bounding rectangle.
int IsMetricCountry()
This function is used to set the default paper size to Letter or A4 By default RTPDF-32 attempts to r...
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 o...
PATHOBJ * RTPdfCreatePath(LPPDFINFO pdev)
Create a path object made of lines and curves to be used in all vector drawing operations See PATHOB...
int RTPdfResetDevmode(LPPDFINFO pdev, PDEVMODEA pdm)
Set the page dimensions and orientation of all pages following this call.
int RTPdfStartDoc(LPPDFINFO pdev)
Start a new PDF document.
int RTPdfSetDocumentInfo(LPPDFINFO pdev, DocumentInfo nDocumentInfo, const BYTE *szEntryValue)
Set a document information attribute (also known as Metadata) The attributes should be set before ca...
int RTPdfTextOut(LPPDFINFO pdev, CLIPOBJ *pco, BRUSHOBJ *pboText, long lPosX, long lPosY, float fAngle, const BYTE *pbCharCodes, int nCharCount, int nEncoding)
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...
enum _DocumentInfo DocumentInfo
Enumeration of the various document info attributes that can be used in RTPdfSetDocumentInfo.
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...
int RTPdfSetLayer(LPPDFINFO pdev, PWSTR pwstrLayerTitle)
Specify a PDF layer on which to place the next objects.
int RTPdfStartPage(LPPDFINFO pdev)
Start a new page, should be called after a call to RTPdfStartDoc and before a new page is started.
int RTPdfSetBookmark(LPPDFINFO pdev, int nParent, PWSTR pwstrBookmarkTitle)
Add a bookmark to the current location in the bookmarks tree.
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...
_DocumentInfo
Enumeration of the various document info attributes that can be used in RTPdfSetDocumentInfo.
Definition: RTPDF-32.h:213
@ DocumentInfoTitle
Definition: RTPDF-32.h:214
@ DocumentInfoSubject
Definition: RTPDF-32.h:217
@ DocumentInfoKeywords
Definition: RTPDF-32.h:218
@ DocumentInfoCreator
Definition: RTPDF-32.h:216
@ DocumentInfoAuthor
Definition: RTPDF-32.h:215
int RTPdfWritePort(HANDLE hPort, const unsigned char *pData, unsigned long *pdwDataSize)
Write a block of data to the specified file or port.
int RTPdfSetTextSpacing(LPPDFINFO pdev, long lWordSpacing, long lCharSpacing)
Set the Word and Character spacing of any text drawn after this function is called.
void * HANDLE
Definition: RTPDF-32.h:22
int RTPdfEndDoc(LPPDFINFO pdev)
End the current document, no output is allowed after this call.
void RTPdfSetHyperLink(LPPDFINFO pdev, const PRECTL prclHyperLink, PWSTR pwszDestination)
Create a hyperlink to an internal location (bookmark) or external location (URL)
int RTPdfEndPage(LPPDFINFO pdev)
End the current page.
void RTPdfDeletePath(PATHOBJ *ppo)
Delete the path object created through RTPdfCreatePath.
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.
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...