litePDF C interface
2.0.5
|
C interface. More...
Typedefs | |
typedef unsigned int(__stdcall * | litePDFEvalFontFlagCB )(char *inout_faceName, unsigned int faceNameBufferSize, void *user_data) |
typedef void(__stdcall * | litePDF_appendSignatureDataFunc )(const char *bytes, unsigned int bytes_len, void *user_data) |
typedef void(__stdcall * | litePDF_finishSignatureFunc )(char *signature, unsigned int *signature_len, void *user_data) |
Functions | |
LITEPDF_BEGIN_DECLS typedef | void (__stdcall *litePDFErrorCB)(unsigned int code |
void *__stdcall LITEPDF_PUBLIC | litePDF_CreateContext (litePDFErrorCB on_error, void *on_error_user_data) |
void __stdcall LITEPDF_PUBLIC | litePDF_FreeContext (void *pctx) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_SetUnit (void *pctx, unsigned int unitValue) |
unsigned int __stdcall LITEPDF_PUBLIC | litePDF_GetUnit (void *pctx) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_SetEvalFontFlagCallback (void *pctx, litePDFEvalFontFlagCB callback, void *callback_user_data) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_PrepareEncryption (void *pctx, const char *userPassword, const char *ownerPassword, unsigned int permissions, unsigned int algorithm) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_CreateFileDocument (void *pctx, const char *fileName) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_CreateFileDocumentW (void *pctx, const wchar_t *fileName) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_CreateMemDocument (void *pctx) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_LoadFromFile (void *pctx, const char *fileName, const char *password, BOOL loadCompletely, BOOL forUpdate) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_LoadFromFileW (void *pctx, const wchar_t *fileName, const char *password, BOOL loadCompletely, BOOL forUpdate) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_LoadFromData (void *pctx, const BYTE *data, unsigned int dataLength, const char *password, BOOL forUpdate) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_SaveToFile (void *pctx, const char *fileName) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_SaveToFileW (void *pctx, const wchar_t *fileName) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_SaveToData (void *pctx, BYTE *data, unsigned int *dataLength) |
void __stdcall LITEPDF_PUBLIC | litePDF_Close (void *pctx) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_GetPageCount (void *pctx, unsigned int *pageCount) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_GetPageSize (void *pctx, unsigned int pageIndex, unsigned int *width_u, unsigned int *height_u) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_GetPageRotation (void *pctx, unsigned int pageIndex, int *out_degrees) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_SetPageRotation (void *pctx, unsigned int pageIndex, int degrees) |
HDC __stdcall LITEPDF_PUBLIC | litePDF_AddPage (void *pctx, unsigned int width_u, unsigned int height_u, unsigned int width_px, unsigned int height_px, unsigned int drawFlags) |
HDC __stdcall LITEPDF_PUBLIC | litePDF_InsertPage (void *pctx, unsigned int pageIndex, unsigned int width_u, unsigned int height_u, unsigned int width_px, unsigned int height_px, unsigned int drawFlags) |
HDC __stdcall LITEPDF_PUBLIC | litePDF_UpdatePage (void *pctx, unsigned int pageIndex, unsigned int width_px, unsigned int height_px, unsigned int drawFlags) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_FinishPage (void *pctx, HDC hDC) |
HDC __stdcall LITEPDF_PUBLIC | litePDF_AddResource (void *pctx, unsigned int width_u, unsigned int height_u, unsigned int width_px, unsigned int height_px, unsigned int drawFlags) |
unsigned int __stdcall LITEPDF_PUBLIC | litePDF_FinishResource (void *pctx, HDC hDC) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_DeletePage (void *pctx, unsigned int pageIndex) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_AddPagesFrom (void *pctx, void *pctx_from, unsigned int pageIndex, unsigned int pageCount) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_InsertPageFrom (void *pctx, unsigned int pageIndexTo, void *pctx_from, unsigned int pageIndexFrom) |
unsigned int __stdcall LITEPDF_PUBLIC | litePDF_AddPageFromAsResource (void *pctx, void *pctx_from, unsigned int pageIndex, BOOL useTrimBox) |
unsigned int __stdcall LITEPDF_PUBLIC | litePDF_PageToResource (void *pctx, unsigned int pageIndex) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_GetResourceSize (void *pctx, unsigned int resourceID, unsigned int *width_u, unsigned int *height_u) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_DrawResource (void *pctx, unsigned int resourceID, unsigned int pageIndex, unsigned int unitValue, int x, int y, int scaleX, int scaleY) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_DrawResourceWithMatrix (void *pctx, unsigned int resourceID, unsigned int pageIndex, int a, int b, int c, int d, int e, int f) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_SetDocumentInfo (void *pctx, const char *name, const wchar_t *value) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_GetDocumentInfoExists (void *pctx, const char *name, BOOL *pExists) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_GetDocumentInfo (void *pctx, const char *name, wchar_t *value, unsigned int *valueLength) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_GetDocumentIsSigned (void *pctx, BOOL *pIsSigned) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_GetSignatureCount (void *pctx, unsigned int *pCount) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_GetSignatureName (void *pctx, unsigned int index, char *name, unsigned int *nameLength) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_CreateSignature (void *pctx, const char *name, unsigned int annotationPageIndex, int annotationX_u, int annotationY_u, int annotationWidth_u, int annotationHeight_u, unsigned int annotationFlags, unsigned int *pAddedIndex) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_GetSignatureHasData (void *pctx, unsigned int index, BOOL *pHasData) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_GetSignatureData (void *pctx, unsigned int index, BYTE *data, unsigned int *dataLength) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_GetSignatureRanges (void *pctx, unsigned int index, unsigned __int64 *pRangesArray, unsigned int *pRangesArrayLength) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_SetSignatureDate (void *pctx, unsigned int index, __int64 dateOfSign) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_GetSignatureDate (void *pctx, unsigned int index, __int64 *pDateOfSign) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_SetSignatureReason (void *pctx, unsigned int index, const wchar_t *reason) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_GetSignatureReason (void *pctx, unsigned int index, wchar_t *value, unsigned int *valueLength) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_SetSignatureLocation (void *pctx, unsigned int index, const wchar_t *location) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_GetSignatureLocation (void *pctx, unsigned int index, wchar_t *value, unsigned int *valueLength) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_SetSignatureCreator (void *pctx, unsigned int index, const char *creator) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_GetSignatureCreator (void *pctx, unsigned int index, char *value, unsigned int *valueLength) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_SetSignatureAppearance (void *pctx, unsigned int index, unsigned int appearanceType, unsigned int resourceID, int offsetX_u, int offsetY_u) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_SetSignatureCertification (void *pctx, unsigned int index, unsigned int permission) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_SetSignatureSize (void *pctx, unsigned int requestBytes) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_SetSignatureHash (void *pctx, unsigned int signatureHash) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_AddSignerPFX (void *pctx, const BYTE *pfxData, unsigned int pfxDataLength, const char *pfxPassword) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_AddSignerPEM (void *pctx, const BYTE *pemData, unsigned int pemDataLength, const BYTE *pkeyData, unsigned int pkeyDataLength, const char *pkeyPassword) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_SaveToFileWithSign (void *pctx, const char *fileName, unsigned int signatureIndex) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_SaveToFileWithSignW (void *pctx, const wchar_t *fileName, unsigned int signatureIndex) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_SaveToDataWithSign (void *pctx, unsigned int signatureIndex, BYTE *data, unsigned int *dataLength) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_SaveToFileWithSignManual (void *pctx, const char *fileName, unsigned int signatureIndex, litePDF_appendSignatureDataFunc appendSignatureData, void *append_user_data, litePDF_finishSignatureFunc finishSignature, void *finish_user_data) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_SaveToFileWithSignManualW (void *pctx, const wchar_t *fileName, unsigned int signatureIndex, litePDF_appendSignatureDataFunc appendSignatureData, void *append_user_data, litePDF_finishSignatureFunc finishSignature, void *finish_user_data) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_SaveToDataWithSignManual (void *pctx, unsigned int signatureIndex, litePDF_appendSignatureDataFunc appendSignatureData, void *append_user_data, litePDF_finishSignatureFunc finishSignature, void *finish_user_data, BYTE *data, unsigned int *dataLength) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_EmbedFile (void *pctx, const char *fileName) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_EmbedFileW (void *pctx, const wchar_t *fileName) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_EmbedData (void *pctx, const char *fileName, const BYTE *data, unsigned int dataLength) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_EmbedDataW (void *pctx, const wchar_t *fileName, const BYTE *data, unsigned int dataLength) |
INT __stdcall LITEPDF_PUBLIC | litePDF_GetEmbeddedFileCount (void *pctx) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_GetEmbeddedFileName (void *pctx, unsigned int index, char *fileName, unsigned int *fileNameLength) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_GetEmbeddedFileNameW (void *pctx, unsigned int index, wchar_t *fileName, unsigned int *fileNameLength) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_GetEmbeddedFileData (void *pctx, unsigned int index, BYTE *data, unsigned int *dataLength) |
void *__stdcall LITEPDF_PUBLIC | litePDF_GetPoDoFoDocument (void *pctx) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_DrawDebugPage (void *pctx, const char *filename) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_CreateLinkAnnotation (void *pctx, unsigned int annotationPageIndex, int annotationX_u, int annotationY_u, int annotationWidth_u, int annotationHeight_u, unsigned int annotationFlags, unsigned int annotationResourceID, unsigned int destinationPageIndex, unsigned int destinationX_u, unsigned int destinationY_u, const wchar_t *destinationDescription) |
BOOL __stdcall LITEPDF_PUBLIC | litePDF_CreateURIAnnotation (void *pctx, unsigned int annotationPageIndex, int annotationX_u, int annotationY_u, int annotationWidth_u, int annotationHeight_u, unsigned int annotationFlags, unsigned int annotationResourceID, const char *destinationURI, const wchar_t *destinationDescription) |
unsigned int __stdcall LITEPDF_PUBLIC | litePDF_CreateBookmarkRoot (void *pctx, const wchar_t *title, unsigned int flags, unsigned char titleColor_red, unsigned char titleColor_green, unsigned char titleColor_blue, unsigned int destinationPageIndex, unsigned int destinationX_u, unsigned int destinationY_u) |
unsigned int __stdcall LITEPDF_PUBLIC | litePDF_CreateBookmarkChild (void *pctx, unsigned int parentBookmarkID, const wchar_t *title, unsigned int flags, unsigned char titleColor_red, unsigned char titleColor_green, unsigned char titleColor_blue, unsigned int destinationPageIndex, unsigned int destinationX_u, unsigned int destinationY_u) |
unsigned int __stdcall LITEPDF_PUBLIC | litePDF_CreateBookmarkSibling (void *pctx, unsigned int previousBookmarkID, const wchar_t *title, unsigned int flags, unsigned char titleColor_red, unsigned char titleColor_green, unsigned char titleColor_blue, unsigned int destinationPageIndex, unsigned int destinationX_u, unsigned int destinationY_u) |
Variables | |
LITEPDF_BEGIN_DECLS typedef const char * | msg |
LITEPDF_BEGIN_DECLS typedef const char void * | user_data |
C interface.
This document describes a direct C interface for litePDF.dll API.
#define LITEPDF_ANNOTATION_FLAG_HIDDEN 0x0002 |
Do not allow show, print or interact with the annotation
#define LITEPDF_ANNOTATION_FLAG_INVISIBLE 0x0001 |
Do not show nonstandard annotation if there is no annotation handler available
#define LITEPDF_ANNOTATION_FLAG_LOCKED 0x0080 |
Do not allow the annotation to be deleted or its properties (including position and size) to be modified by the user
#define LITEPDF_ANNOTATION_FLAG_LOCKEDCONTENTS 0x0200 |
Do not allow the contents of the annotation to be modified by the user
#define LITEPDF_ANNOTATION_FLAG_NONE 0x0000 |
Default annotation flags
#define LITEPDF_ANNOTATION_FLAG_NOROTATE 0x0010 |
Do not rotate the annotation's appearance to match the rotation of the page
#define LITEPDF_ANNOTATION_FLAG_NOVIEW 0x0020 |
Do not display the annotation on the screen or allow it to interact with the user
#define LITEPDF_ANNOTATION_FLAG_NOZOOM 0x0008 |
Do not scale the annotation's appearance to match the magnification of the page
#define LITEPDF_ANNOTATION_FLAG_PRINT 0x0004 |
Print the annotation
#define LITEPDF_ANNOTATION_FLAG_READONLY 0x0040 |
Do not allow the annotation to interact with the user
#define LITEPDF_ANNOTATION_FLAG_TOGGLENOVIEW 0x0100 |
Invert the interpretation of the NoView flag for certain events
#define LITEPDF_APPEARANCE_DOWN (2) |
Down appearance; the default is the normal appearance
#define LITEPDF_APPEARANCE_NORMAL (0) |
Normal appearance
#define LITEPDF_APPEARANCE_ROLLOVER (1) |
Rollover appearance; the default is the normal appearance
#define LITEPDF_BEGIN_DECLS |
#define LITEPDF_BOOKMARK_FLAG_BOLD 0x0002 |
Show bookmark title as a bold text
#define LITEPDF_BOOKMARK_FLAG_ITALIC 0x0001 |
Show bookmark title as an italic text
#define LITEPDF_BOOKMARK_FLAG_NONE 0x0000 |
Default bookmark flags
#define LITEPDF_CERTIFICATION_PERMISSION_ANNOTATIONS (3) |
Permitted changes are the same as for LITEPDF_CERTIFICATION_PERMISSION_FORM_FILL, as well as annotation creation, deletion, and modification; other changes invalidate the signature.
#define LITEPDF_CERTIFICATION_PERMISSION_FORM_FILL (2) |
Permitted changes are filling in forms, instantiating page templates, and signing; other changes invalidate the signature.
#define LITEPDF_CERTIFICATION_PERMISSION_NO_PERMS (1) |
No changes to the document are permitted; any change to the document invalidates the signature.
#define LITEPDF_DOCUMENT_INFO_AUTHOR "Author" |
an Author of the document
#define LITEPDF_DOCUMENT_INFO_CREATION_DATE "CreationDate" |
a date of the creation of the document
#define LITEPDF_DOCUMENT_INFO_CREATOR "Creator" |
a Creator of the document
#define LITEPDF_DOCUMENT_INFO_KEYWORDS "Keywords" |
the Keywords of the document
#define LITEPDF_DOCUMENT_INFO_MODIFICATION_DATE "ModDate" |
a date of the last modification of the document
#define LITEPDF_DOCUMENT_INFO_PRODUCER "Producer" |
a Producer of the document; this key is read-only
#define LITEPDF_DOCUMENT_INFO_SUBJECT "Subject" |
a Subject of the document
#define LITEPDF_DOCUMENT_INFO_TITLE "Title" |
a Title of the document
#define LITEPDF_DOCUMENT_INFO_TRAPPED "Trapped" |
a trapping state of the document
#define LITEPDF_DRAW_FLAG_COMPRESS_IMAGES_WITH_JPEG (1 << 3) |
Compress images with JPEG compression, to get smaller PDF document; this is used only for RGB images
#define LITEPDF_DRAW_FLAG_EMBED_FONTS_COMPLETE (1 << 0) |
Embed complete fonts into resulting PDF;
#define LITEPDF_DRAW_FLAG_EMBED_FONTS_NONE (1 << 4) |
Do not embed any fonts into resulting PDF.
#define LITEPDF_DRAW_FLAG_EMBED_FONTS_SUBSET (1 << 1) |
Embed only subset of the fonts, aka used letters; this flag is used before LITEPDF_DRAW_FLAG_EMBED_FONTS_COMPLETE;
#define LITEPDF_DRAW_FLAG_NONE (0) |
None draw flags
#define LITEPDF_DRAW_FLAG_RESET_GRAPHICS_STATE (1 << 5) |
Try to reset graphics state before appending new content to the page. This covers leftover saved states and the transformation matrix
#define LITEPDF_DRAW_FLAG_SUBSTITUTE_FONTS (1 << 2) |
Substitute fonts with base PDF fonts, if possible
#define LITEPDF_ENCRYPT_ALGORITHM_AESV2 4 |
AES encryption with a 128 bit key (PDF1.6)
#define LITEPDF_ENCRYPT_ALGORITHM_AESV3 8 |
AES encryption with a 256 bit key (PDF1.7 extension 3)
#define LITEPDF_ENCRYPT_ALGORITHM_RC4V1 1 |
RC4 Version 1 encryption using a 40bit key
#define LITEPDF_ENCRYPT_ALGORITHM_RC4V2 2 |
RC4 Version 2 encryption using a 128bit key
#define LITEPDF_ENCRYPT_PERMISSION_ACCESSIBLE 0x00000200 |
Extract text and graphics to support user with disabilities
#define LITEPDF_ENCRYPT_PERMISSION_COPY 0x00000010 |
Allow text and graphic extraction
#define LITEPDF_ENCRYPT_PERMISSION_DOCASSEMBLY 0x00000400 |
Assemble the document: insert, create, rotate delete pages or add bookmarks
#define LITEPDF_ENCRYPT_PERMISSION_EDIT 0x00000008 |
Allow modifying the document besides annotations, form fields or changing pages
#define LITEPDF_ENCRYPT_PERMISSION_EDITNOTES 0x00000020 |
Add or modify text annotations or form fields (if ePdfPermissions_Edit is set also allow to create interactive form fields including signature)
#define LITEPDF_ENCRYPT_PERMISSION_FILLANDSIGN 0x00000100 |
Fill in existing form or signature fields
#define LITEPDF_ENCRYPT_PERMISSION_HIGHPRINT 0x00000800 |
Print a high resolution version of the document
#define LITEPDF_ENCRYPT_PERMISSION_NONE 0x0 |
Nothing from the rest is allowed
#define LITEPDF_ENCRYPT_PERMISSION_PRINT 0x00000004 |
Allow printing the document
#define LITEPDF_END_DECLS |
#define LITEPDF_FONT_FLAG_DEFAULT 0 |
Use the settings as specified by the draw operation
#define LITEPDF_FONT_FLAG_DO_NOT_EMBED 1 |
Do not embed the font
#define LITEPDF_FONT_FLAG_EMBED_COMPLETE 2 |
Embed complete font
#define LITEPDF_FONT_FLAG_EMBED_SUBSET 3 |
Embed the font with used characters only
#define LITEPDF_FONT_FLAG_SUBSTITUTE 4 |
Substitute the font with one of the base fonts, if possible
#define LITEPDF_PUBLIC __declspec(dllimport) |
#define LITEPDF_SIGNATURE_HASH_SHA1 1 |
Use SHA1 hash algorithm
#define LITEPDF_SIGNATURE_HASH_SHA256 2 |
Use SHA256 hash algorithm
#define LITEPDF_SIGNATURE_HASH_SHA384 3 |
Use SHA384 hash algorithm
#define LITEPDF_SIGNATURE_HASH_SHA512 4 |
Use SHA512 hash algorithm
#define LITEPDF_UNIT_1000TH_INCH (8) |
1/1000th of an inch unit; 5" is value 5000
#define LITEPDF_UNIT_1000TH_MM (4) |
1/1000th of a millimeter unit; 5 mm is value 5000
#define LITEPDF_UNIT_100TH_INCH (7) |
1/100th of an inch unit; 5" is value 500
#define LITEPDF_UNIT_100TH_MM (3) |
1/100th of a millimeter unit; 5 mm is value 500
#define LITEPDF_UNIT_10TH_INCH (6) |
1/10th of an inch unit; 5" is value 50
#define LITEPDF_UNIT_10TH_MM (2) |
1/10th of a millimeter unit; 5 mm is value 50
#define LITEPDF_UNIT_INCH (5) |
Inch unit
#define LITEPDF_UNIT_MM (1) |
Millimeters unit
#define LITEPDF_UNIT_UNKNOWN (0) |
Unknown unit; usually used to indicate an error
typedef void(__stdcall * litePDF_appendSignatureDataFunc)(const char *bytes, unsigned int bytes_len, void *user_data) |
The function is used within litePDF_SaveToFileWithSignManual and litePDF_SaveToDataWithSignManual. It is called called when more data should be added to hash computation.
typedef void(__stdcall * litePDF_finishSignatureFunc)(char *signature, unsigned int *signature_len, void *user_data) |
The function is used within litePDF_SaveToFileWithSignManual and litePDF_SaveToDataWithSignManual. It is called when all the data are processed and the signature value is required. The signature_len contains size of the signature buffer. The callback is responsible to populate signature and signature_len with correct values. Set signature_len to zero on any error. Note the callback is called only once.
typedef unsigned int(__stdcall * litePDFEvalFontFlagCB)(char *inout_faceName, unsigned int faceNameBufferSize, void *user_data) |
A callback to evaluate what to do with the specified font. The function can be also used to rename the font, without changing the font flag. The size of the inout_faceName buffer is faceNameBufferSize and when renaming it, the written value should not be longer than faceNameBufferSize, including the nul-terminating character.
The returned value for one font name should be consistent. It's not possible to for example once request complete font embedding and the other time to request no embedding at all.
inout_faceName | [in/out] The font face name to evaluate the flag for. |
faceNameBufferSize | Size of the inout_faceName buffer. |
user_data | User data provided in litePDF_SetEvalFontFlagCallback. |
HDC __stdcall LITEPDF_PUBLIC litePDF_AddPage | ( | void * | pctx, |
unsigned int | width_u, | ||
unsigned int | height_u, | ||
unsigned int | width_px, | ||
unsigned int | height_px, | ||
unsigned int | drawFlags | ||
) |
Begins drawing into a new page into the PDF context of the given size. Newly created page is added as the last page of the PDF document. This cannot be called when other drawing is in progress.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
width_u | Width of the new page in the current unit. |
height_u | Height of the new page in the current unit. |
width_px | Width of the new page in pixels. |
height_px | Height of the new page in pixels. |
drawFlags | Flags for drawing functions. This is a bit-or of LITEPDF_DRAW_FLAG values and influences only litePDF_AddPage, litePDF_InsertPage, litePDF_UpdatePage and litePDF_AddResource functions. |
unsigned int __stdcall LITEPDF_PUBLIC litePDF_AddPageFromAsResource | ( | void * | pctx, |
void * | pctx_from, | ||
unsigned int | pageIndex, | ||
BOOL | useTrimBox | ||
) |
Adds an existing page as a resource of a given PDF. This resource can be referenced multiple times by its identifier. Both contexts should hold memory-based documents.
pctx | a litePDF context, previously created with litePDF_CreateContext, to which add the page resource. |
pctx_from | litePDF context, previously created with litePDF_CreateContext, from which add the page. |
pageIndex | Page index which to add from pctx_from; counts from 0. |
useTrimBox | If TRUE, try to use trimbox for size of the resource (XObject) |
BOOL __stdcall LITEPDF_PUBLIC litePDF_AddPagesFrom | ( | void * | pctx, |
void * | pctx_from, | ||
unsigned int | pageIndex, | ||
unsigned int | pageCount | ||
) |
Adds existing pages as the last pages from another PDF. Both contexts should hold memory-based documents.
pctx | a litePDF context, previously created with litePDF_CreateContext, to which add the page. |
pctx_from | litePDF context, previously created with litePDF_CreateContext, from which add the pages. |
pageIndex | Page index which to add from pctx_from; counts from 0. |
pageCount | How many pages to add; 0 means whole document. |
HDC __stdcall LITEPDF_PUBLIC litePDF_AddResource | ( | void * | pctx, |
unsigned int | width_u, | ||
unsigned int | height_u, | ||
unsigned int | width_px, | ||
unsigned int | height_px, | ||
unsigned int | drawFlags | ||
) |
Begins drawing into a new resource into the PDF context of the given size. This cannot be called when other drawing is in progress.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
width_u | Width of the new page in the current unit. |
height_u | Height of the new page in the current unit. |
width_px | Width of the new page in pixels. |
height_px | Height of the new page in pixels. |
drawFlags | Flags for drawing functions. This is a bit-or of LITEPDF_DRAW_FLAG values and influences only litePDF_AddPage, litePDF_InsertPage, litePDF_UpdatePage and litePDF_AddResource functions. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_AddSignerPEM | ( | void * | pctx, |
const BYTE * | pemData, | ||
unsigned int | pemDataLength, | ||
const BYTE * | pkeyData, | ||
unsigned int | pkeyDataLength, | ||
const char * | pkeyPassword | ||
) |
Adds a signer to be used when digitally signing the document with litePDF_SaveToFileWithSign or litePDF_SaveToDataWithSign. The passed-in certificate and private key are in the PEM format.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
pemData | A certificate in the PEM format. |
pemDataLength | A length of the pemData. |
pkeyData | A private key for the certificate, in the PEM format. |
pkeyDataLength | A length of the pkeyData. |
pkeyPassword | A password to use to open the private key; can be NULL. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_AddSignerPFX | ( | void * | pctx, |
const BYTE * | pfxData, | ||
unsigned int | pfxDataLength, | ||
const char * | pfxPassword | ||
) |
Adds a signer to be used when digitally signing the document with litePDF_SaveToFileWithSign or litePDF_SaveToDataWithSign. The passed-in certificate is in the PFX format and should include the private key.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
pfxData | A certificate with private key in the PFX format. |
pfxDataLength | A length of the pfxData. |
pfxPassword | A password to use to open the PFX certificate; can be NULL. |
void __stdcall LITEPDF_PUBLIC litePDF_Close | ( | void * | pctx | ) |
Closes PDF data in a litePDF context, thus the context doesn't hold anything afterward, aka it's like a context just created with litePDF_CreateContext. Do not forget to free the context itself with litePDF_FreeContext, when no longer needed. The function does nothing, if the context doesn't hold any data. In case of any drawing in progress, the drawing is discarded, same as any unsaved changes to the memory-based PDF documents. It also unsets any encryption properties, previously set by litePDF_PrepareEncryption.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
unsigned int __stdcall LITEPDF_PUBLIC litePDF_CreateBookmarkChild | ( | void * | pctx, |
unsigned int | parentBookmarkID, | ||
const wchar_t * | title, | ||
unsigned int | flags, | ||
unsigned char | titleColor_red, | ||
unsigned char | titleColor_green, | ||
unsigned char | titleColor_blue, | ||
unsigned int | destinationPageIndex, | ||
unsigned int | destinationX_u, | ||
unsigned int | destinationY_u | ||
) |
Creates a new child bookmark, which will target the given destination page and the position in it. The context should hold a memory-based document. Note, the bookmarks can be created only when the document is not drawing, to have all the document pages available.
pctx | A litePDF context, previously created with litePDF_CreateContext, to which add the link annotation. |
parentBookmarkID | Bookmark ID of the parent bookmark. The child will be created under this bookmark. |
title | Title of the bookmark. |
flags | Bit-or of LITEPDF_BOOKMARK_FLAG_ flags. |
titleColor_red | RGB red value of the title text color. |
titleColor_green | RGB green value of the title text color. |
titleColor_blue | RGB blue value of the title text color. |
destinationPageIndex | Page index where the link points to. |
destinationX_u | X-origin of the destination on the page, in the current unit. |
destinationY_u | Y-origin of the destination on the page, in the current unit. |
unsigned int __stdcall LITEPDF_PUBLIC litePDF_CreateBookmarkRoot | ( | void * | pctx, |
const wchar_t * | title, | ||
unsigned int | flags, | ||
unsigned char | titleColor_red, | ||
unsigned char | titleColor_green, | ||
unsigned char | titleColor_blue, | ||
unsigned int | destinationPageIndex, | ||
unsigned int | destinationX_u, | ||
unsigned int | destinationY_u | ||
) |
Creates a new root (top-level) bookmark, which will target the given destination page and the position in it. The context should hold a memory-based document. Note, the bookmarks can be created only when the document is not drawing, to have all the document pages available.
pctx | A litePDF context, previously created with litePDF_CreateContext, to which add the link annotation. |
title | Title of the bookmark. |
flags | Bit-or of LITEPDF_BOOKMARK_FLAG_ flags. |
titleColor_red | RGB red value of the title text color. |
titleColor_green | RGB green value of the title text color. |
titleColor_blue | RGB blue value of the title text color. |
destinationPageIndex | Page index where the link points to. |
destinationX_u | X-origin of the destination on the page, in the current unit. |
destinationY_u | Y-origin of the destination on the page, in the current unit. |
unsigned int __stdcall LITEPDF_PUBLIC litePDF_CreateBookmarkSibling | ( | void * | pctx, |
unsigned int | previousBookmarkID, | ||
const wchar_t * | title, | ||
unsigned int | flags, | ||
unsigned char | titleColor_red, | ||
unsigned char | titleColor_green, | ||
unsigned char | titleColor_blue, | ||
unsigned int | destinationPageIndex, | ||
unsigned int | destinationX_u, | ||
unsigned int | destinationY_u | ||
) |
Creates a new sibling (next) bookmark, which will target the given destination page and the position in it. The context should hold a memory-based document. Note, the bookmarks can be created only when the document is not drawing, to have all the document pages available.
pctx | A litePDF context, previously created with litePDF_CreateContext, to which add the link annotation. |
previousBookmarkID | Bookmark ID of the previous bookmark. The sibling will be created as the next of this bookmark. |
title | Title of the bookmark. |
flags | Bit-or of LITEPDF_BOOKMARK_FLAG_ flags. |
titleColor_red | RGB red value of the title text color. |
titleColor_green | RGB green value of the title text color. |
titleColor_blue | RGB blue value of the title text color. |
destinationPageIndex | Page index where the link points to. |
destinationX_u | X-origin of the destination on the page, in the current unit. |
destinationY_u | Y-origin of the destination on the page, in the current unit. |
void* __stdcall LITEPDF_PUBLIC litePDF_CreateContext | ( | litePDFErrorCB | on_error, |
void * | on_error_user_data | ||
) |
Creates a new litePDF context. This is used in other litePDF functions. The returned context should be freed with litePDF_FreeContext when no longer needed.
on_error | Callback called on errors. This is used to report litePDF errors and is used during whole life time of the returned context. |
on_error_user_data | User data passed into on_error callback. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_CreateFileDocument | ( | void * | pctx, |
const char * | fileName | ||
) |
Makes the litePDF context hold a new PDF, which writes directly to a file. The passed-in litePDF context should not have opened any other PDF data. Call litePDF_Close, to close the file, and possibly save changes to it. Most of the operations require memory-based PDF, which can be created with litePDF_CreateMemDocument.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
fileName | File name to write the PDF result to. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_CreateFileDocumentW | ( | void * | pctx, |
const wchar_t * | fileName | ||
) |
This is the same as litePDF_CreateFileDocument, the only difference is that the fileName is a wide string.
BOOL __stdcall LITEPDF_PUBLIC litePDF_CreateLinkAnnotation | ( | void * | pctx, |
unsigned int | annotationPageIndex, | ||
int | annotationX_u, | ||
int | annotationY_u, | ||
int | annotationWidth_u, | ||
int | annotationHeight_u, | ||
unsigned int | annotationFlags, | ||
unsigned int | annotationResourceID, | ||
unsigned int | destinationPageIndex, | ||
unsigned int | destinationX_u, | ||
unsigned int | destinationY_u, | ||
const wchar_t * | destinationDescription | ||
) |
Creates a link annotation at the given page and position, which will target the given destination page and the position in it. The context should hold a memory-based document. Note, the link annotation can be created only when the document is not drawing, to have all the document pages available.
pctx | a litePDF context, previously created with litePDF_CreateContext, to which add the link annotation. |
annotationPageIndex | Page index where to place the link annotation. |
annotationX_u | X-origin of the annotation on the page, in the current unit. |
annotationY_u | Y-origin of the annotation on the page, in the current unit. |
annotationWidth_u | Width of the annotation on the page, in the current unit. |
annotationHeight_u | Height of the annotation on the page, in the current unit. |
annotationFlags | Bit-or of LITEPDF_ANNOTATION_FLAG_ flags. |
annotationResourceID | Optional resource ID of the annotation content, as shown to the user. 0 means do not add additional visualization on the page, but the annotation can be still clicked. |
destinationPageIndex | Page index where the link points to. |
destinationX_u | X-origin of the destination on the page, in the current unit. |
destinationY_u | Y-origin of the destination on the page, in the current unit. |
destinationDescription | Optional destination description, which can be used for accessibility reasons by the viewer. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_CreateMemDocument | ( | void * | pctx | ) |
Makes the litePDF context hold a memory-based PDF. Such PDF can be saved with litePDF_SaveToFile or litePDF_SaveToData. The PDF should be closed with litePDF_Close.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_CreateSignature | ( | void * | pctx, |
const char * | name, | ||
unsigned int | annotationPageIndex, | ||
int | annotationX_u, | ||
int | annotationY_u, | ||
int | annotationWidth_u, | ||
int | annotationHeight_u, | ||
unsigned int | annotationFlags, | ||
unsigned int * | pAddedIndex | ||
) |
Creates a new signature field named name. The field is created completely empty. Use litePDF_SetSignatureDate, litePDF_SetSignatureReason, litePDF_SetSignatureLocation, litePDF_SetSignatureCreator, litePDF_SetSignatureAppearance and such to populate it with required values. Finally, to sign the signature field use litePDF_SaveToFileWithSign family functions.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
name | Signature field name to use. This should be unique. |
annotationPageIndex | Page index where to place the signature annotation. |
annotationX_u | X-origin of the annotation on the page, in the current unit. |
annotationY_u | Y-origin of the annotation on the page, in the current unit. |
annotationWidth_u | Width of the annotation on the page, in the current unit. |
annotationHeight_u | Height of the annotation on the page, in the current unit. |
annotationFlags | Bit-or of LITEPDF_ANNOTATION_FLAG_ flags. |
pAddedIndex | [out] Optional parameter, if not NULL, then it's populated with the index of the added signature field. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_CreateURIAnnotation | ( | void * | pctx, |
unsigned int | annotationPageIndex, | ||
int | annotationX_u, | ||
int | annotationY_u, | ||
int | annotationWidth_u, | ||
int | annotationHeight_u, | ||
unsigned int | annotationFlags, | ||
unsigned int | annotationResourceID, | ||
const char * | destinationURI, | ||
const wchar_t * | destinationDescription | ||
) |
Creates a URI annotation at the given page and position, which will reference the given destination URI. The context should hold a memory-based document. Note, the URI annotation can be created only when the document is not drawing, to have all the document pages available.
pctx | a litePDF context, previously created with litePDF_CreateContext, to which add the URI annotation. |
annotationPageIndex | Page index where to place the URI annotation. |
annotationX_u | X-origin of the annotation on the page, in the current unit. |
annotationY_u | Y-origin of the annotation on the page, in the current unit. |
annotationWidth_u | Width of the annotation on the page, in the current unit. |
annotationHeight_u | Height of the annotation on the page, in the current unit. |
annotationFlags | Bit-or of LITEPDF_ANNOTATION_FLAG_ flags. |
annotationResourceID | Optional resource ID of the annotation content, as shown to the user. 0 means do not add additional visualization on the page, but the annotation can be still clicked. |
destinationURI | The URI the annotation points to. |
destinationDescription | Optional destination description, which can be used for accessibility reasons by the viewer. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_DeletePage | ( | void * | pctx, |
unsigned int | pageIndex | ||
) |
Deletes page at given index. It doesn't delete page resources, because these can be used by other pages.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
pageIndex | Page index which to update; counts from 0. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_DrawDebugPage | ( | void * | pctx, |
const char * | filename | ||
) |
Draws saved debugPage as a new page into the PDF file. There should not be running any drawing when calling this function (like no page can be opened for drawing).
pctx | litePDF context, previously created with litePDF_CreateContext. |
filename | File name with full path for litePDF debug page. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_DrawResource | ( | void * | pctx, |
unsigned int | resourceID, | ||
unsigned int | pageIndex, | ||
unsigned int | unitValue, | ||
int | x, | ||
int | y, | ||
int | scaleX, | ||
int | scaleY | ||
) |
Draws an existing resource at the given position. The resource ID was returned from litePDF_AddPageFromAsResource, litePDF_PageToResource or litePDF_FinishResource. The unitValue is used for both the position and the scale. In case of the scale, it defines only the ratio to the base unit. For example, if the unitValue is either LITEPDF_UNIT_1000TH_MM or LITEPDF_UNIT_1000TH_INCH, then the ratio for the scaleX and scaleY is used 1/1000 (where 1000 means the same size as the resource is in this case).
pctx | a litePDF context, previously created with litePDF_CreateContext. |
resourceID | Resource ID to draw. |
pageIndex | Page index to which draw; counts from 0. |
unitValue | A unit to use for the x and y, and a ratio for the scaleX and scaleY. |
x | Where to draw on the page, X axes, in the given unitValue unit, with left-top corner being [0,0]. |
y | Where to draw on the page, Y axes, in the given unitValue unit, with left-top corner being [0,0]. |
scaleX | Scale factor of the page for the X axes, using the unitValue ratio. |
scaleY | Scale factor of the page for the Y axes, using the unitValue ratio. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_DrawResourceWithMatrix | ( | void * | pctx, |
unsigned int | resourceID, | ||
unsigned int | pageIndex, | ||
int | a, | ||
int | b, | ||
int | c, | ||
int | d, | ||
int | e, | ||
int | f | ||
) |
Draws an existing resource with given transformation matrix. All the transformation values are passed into PDF directly, without any conversion. The resource ID was returned from litePDF_AddPageFromAsResource or litePDF_FinishResource. The constructed transformation matrix is a standard 3x3 matrix:
| a b 0 |
| c d 0 |
| e f 1 |
pctx | a litePDF context, previously created with litePDF_CreateContext. |
resourceID | Resource ID to draw. |
pageIndex | Page index to which draw; counts from 0. |
a | Transformation matrix [ a b c d e f ] parameter 'a', in 1/1000th of PDF units. |
b | Transformation matrix [ a b c d e f ] parameter 'b', in 1/1000th of PDF units. |
c | Transformation matrix [ a b c d e f ] parameter 'c', in 1/1000th of PDF units. |
d | Transformation matrix [ a b c d e f ] parameter 'd', in 1/1000th of PDF units. |
e | Transformation matrix [ a b c d e f ] parameter 'e', in 1/1000th of PDF units. |
f | Transformation matrix [ a b c d e f ] parameter 'f', in 1/1000th of PDF units. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_EmbedData | ( | void * | pctx, |
const char * | fileName, | ||
const BYTE * | data, | ||
unsigned int | dataLength | ||
) |
Embeds a data (file) into a PDF document.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
fileName | File name to be used for the data identification. |
data | Actual data to be attached. |
dataLength | Length of the data. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_EmbedDataW | ( | void * | pctx, |
const wchar_t * | fileName, | ||
const BYTE * | data, | ||
unsigned int | dataLength | ||
) |
This is the same as litePDF_EmbedData, the only difference is that the fileName is a wide string.
BOOL __stdcall LITEPDF_PUBLIC litePDF_EmbedFile | ( | void * | pctx, |
const char * | fileName | ||
) |
Embeds a file into a PDF document.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
fileName | File name of the file to be attached. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_EmbedFileW | ( | void * | pctx, |
const wchar_t * | fileName | ||
) |
This is the same as litePDF_EmbedFile, the only difference is that the fileName is a wide string.
BOOL __stdcall LITEPDF_PUBLIC litePDF_FinishPage | ( | void * | pctx, |
HDC | hDC | ||
) |
Tells litePDF that drawing into the page is finished and that it can be processed into PDF. The hDC is not valid after this call any more.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
hDC | Device context previously returned by litePDF_AddPage, litePDF_InsertPage or litePDF_UpdatePage. |
unsigned int __stdcall LITEPDF_PUBLIC litePDF_FinishResource | ( | void * | pctx, |
HDC | hDC | ||
) |
Tells litePDF that drawing into the resource is finished and that it can be processed into PDF. The hDC is not valid after this call any more.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
hDC | Device context previously returned by litePDF_AddResource. |
void __stdcall LITEPDF_PUBLIC litePDF_FreeContext | ( | void * | pctx | ) |
Frees litePDF context previously created with litePDF_CreateContext. If it contains any unsaved data, then these are discarded.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_GetDocumentInfo | ( | void * | pctx, |
const char * | name, | ||
wchar_t * | value, | ||
unsigned int * | valueLength | ||
) |
Gets information about the document. The name can be one of the LITEPDF_DOCUMENT_INFO predefined constants.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
name | Document info property name to get. |
value | [out] Null-terminated Unicode value. It can be NULL, in which case the valueLength is populated with large-enough value to hold the whole string. |
valueLength | [in/out] Tells how many characters can be stored in value. If value is NULL, then it is set to large-enough value (not including the Null-termination character). Passing non-NULL value with no enough large buffer results in a failure with no change on valueLength. The valueLength has stored count of characters written, not including the Null-termination character on success. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_GetDocumentInfoExists | ( | void * | pctx, |
const char * | name, | ||
BOOL * | pExists | ||
) |
Checks whether information about the document of the given name exists. The name can be one of the LITEPDF_DOCUMENT_INFO predefined constants.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
name | Document info property name to test. |
pExists | [out] Where to store whether the document information is set. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_GetDocumentIsSigned | ( | void * | pctx, |
BOOL * | pIsSigned | ||
) |
Checks whether currently opened document is already signed. Signing already signed document can cause breakage of previous signatures, thus it's good to test whether the loaded document is signed, before signing it.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
pIsSigned | [out] Where to store the result. |
INT __stdcall LITEPDF_PUBLIC litePDF_GetEmbeddedFileCount | ( | void * | pctx | ) |
Gets count of embedded files stored in a PDF document.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_GetEmbeddedFileData | ( | void * | pctx, |
unsigned int | index, | ||
BYTE * | data, | ||
unsigned int * | dataLength | ||
) |
Gets embedded file's data, as stored in a PDF document. There are no data returned, if the file was not embed.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
index | Index of the embedded file; returns failure, if out of range. |
data | [out] Actual embedded file's data, as stored in the PDF. It can be NULL, in which case the dataLength is populated with large-enough value to hold the whole data. |
dataLength | [in/out] Tells how many bytes can be stored in data. If data is NULL, then it is set to large-enough value. Passing non-NULL data with no enough large buffer results in a failure with no change on dataLength. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_GetEmbeddedFileName | ( | void * | pctx, |
unsigned int | index, | ||
char * | fileName, | ||
unsigned int * | fileNameLength | ||
) |
Gets embedded file's name, as stored in a PDF document.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
index | Index of the embedded file; returns failure, if out of range. |
fileName | [out] Buffer to store the embedded file's name to. It can be NULL, in which case the fileNameLength is populated with large-enough value to hold the whole string. |
fileNameLength | [in/out] Tells how many characters can be stored in fileName. If fileName is NULL, then it is set to large-enough value. Passing non-NULL fileName with no enough large buffer results in a failure with no change on fileNameLength. The set length is without the Null-terminate character. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_GetEmbeddedFileNameW | ( | void * | pctx, |
unsigned int | index, | ||
wchar_t * | fileName, | ||
unsigned int * | fileNameLength | ||
) |
This is the same as litePDF_GetEmbeddedFileName, the only difference is that the fileName is a wide string.
BOOL __stdcall LITEPDF_PUBLIC litePDF_GetPageCount | ( | void * | pctx, |
unsigned int * | pageCount | ||
) |
Returns count of pages in a PDF opened in the litePDF context.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
pageCount | [out] Count of pages. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_GetPageRotation | ( | void * | pctx, |
unsigned int | pageIndex, | ||
int * | out_degrees | ||
) |
Gets rotation of an existing page, in degrees. Expected values are 0, 90, 180 and 270.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
pageIndex | Page index for which get the page size; counts from 0. |
out_degrees | [out] Rotation of the page, in degrees. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_GetPageSize | ( | void * | pctx, |
unsigned int | pageIndex, | ||
unsigned int * | width_u, | ||
unsigned int * | height_u | ||
) |
Gets size of an existing page, in the current unit.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
pageIndex | Page index for which get the page size; counts from 0. |
width_u | [out] Width of the page in the current unit. |
height_u | [out] Height of the page in the current unit. |
void* __stdcall LITEPDF_PUBLIC litePDF_GetPoDoFoDocument | ( | void * | pctx | ) |
Gets a pointer to PoDoFo::PdfDocument document, which is currently opened. The returned pointer is owned by litePDF, do not free it. It is valid until the document is closed.
BOOL __stdcall LITEPDF_PUBLIC litePDF_GetResourceSize | ( | void * | pctx, |
unsigned int | resourceID, | ||
unsigned int * | width_u, | ||
unsigned int * | height_u | ||
) |
Gets size of an existing resource, in the current unit. The resource ID was returned from litePDF_AddPageFromAsResource or litePDF_FinishResource.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
resourceID | Resource ID for which get the size. |
width_u | [out] Width of the resource, in the current unit. |
height_u | [out] Height of the resource, in the current unit. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_GetSignatureCount | ( | void * | pctx, |
unsigned int * | pCount | ||
) |
Provides how many signature fields the currently opened document contains. It returns the count of the all fields, not only those already signed.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
pCount | [out] Where to store the result. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_GetSignatureCreator | ( | void * | pctx, |
unsigned int | index, | ||
char * | value, | ||
unsigned int * | valueLength | ||
) |
Gets signature creator.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
index | Which signature to use; counts from 0. This might be less than litePDF_GetSignatureCount. |
value | [out] Null-terminated ASCII value. It can be NULL, in which case the valueLength is populated with large-enough value to hold the whole string. |
valueLength | [in/out] Tells how many characters can be stored in value. If value is NULL, then it is set to large-enough value (not including the Null-termination character). Passing non-NULL value with no enough large buffer results in a failure with no change on valueLength. The valueLength has stored count of characters written, not including the Null-termination character on success. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_GetSignatureData | ( | void * | pctx, |
unsigned int | index, | ||
BYTE * | data, | ||
unsigned int * | dataLength | ||
) |
Gathers raw signature data for the given signature in the currently opened document. Use litePDF_GetSignatureHasData to check whether the given signature field is signed or not.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
index | Which signature data to get; counts from 0. This might be less than litePDF_GetSignatureCount. |
data | [out] Actual data to store the signature content to. It can be NULL, in which case the dataLength is populated with large-enough value to hold the whole data. |
dataLength | [in/out] Tells how many bytes can be stored in data. If data is NULL, then it is set to large-enough value. Passing non-NULL data with no enough large buffer results in a failure with no change on dataLength. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_GetSignatureDate | ( | void * | pctx, |
unsigned int | index, | ||
__int64 * | pDateOfSign | ||
) |
Gets signature field date of sign.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
index | Which signature to use; counts from 0. This might be less than litePDF_GetSignatureCount. |
pDateOfSign | [out] A variable where to store the date of sign. It's like Unix time_t, as set by the signature field creator. The value can be clamp on 32-bit systems. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_GetSignatureHasData | ( | void * | pctx, |
unsigned int | index, | ||
BOOL * | pHasData | ||
) |
Checks whether the given signature field contains any data, which means whether the signature field is signed.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
index | Which signature data to get; counts from 0. This might be less than litePDF_GetSignatureCount. |
pHasData | [out] Set to TRUE, when the given signature contains any data. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_GetSignatureLocation | ( | void * | pctx, |
unsigned int | index, | ||
wchar_t * | value, | ||
unsigned int * | valueLength | ||
) |
Gets signature location.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
index | Which signature to use; counts from 0. This might be less than litePDF_GetSignatureCount. |
value | [out] Null-terminated Unicode value. It can be NULL, in which case the valueLength is populated with large-enough value to hold the whole string. |
valueLength | [in/out] Tells how many characters can be stored in value. If value is NULL, then it is set to large-enough value (not including the Null-termination character). Passing non-NULL value with no enough large buffer results in a failure with no change on valueLength. The valueLength has stored count of characters written, not including the Null-termination character on success. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_GetSignatureName | ( | void * | pctx, |
unsigned int | index, | ||
char * | name, | ||
unsigned int * | nameLength | ||
) |
Gets the signature field name at the given index.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
index | Which signature field name to get; counts from 0. This might be less than litePDF_GetSignatureCount. |
name | [out] Null-terminated ASCII name. It can be NULL, in which case the nameLength is populated with large-enough value to hold the whole string. |
nameLength | [in/out] Tells how many characters can be stored in name. If name is NULL, then it is set to large-enough value (not including the Null-termination character). Passing non-NULL name with no enough large buffer results in a failure with no change on nameLength. The nameLength has stored count of characters written, not including the Null-termination character, on success. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_GetSignatureRanges | ( | void * | pctx, |
unsigned int | index, | ||
unsigned __int64 * | pRangesArray, | ||
unsigned int * | pRangesArrayLength | ||
) |
Gathers signature ranges, that is the actual offsets into the opened file which had been used to create the signature data (litePDF_GetSignatureData). The array is a pair of numbers, where the first number is an offset into the file from its beginning and the second number is the number of bytes being used for the signature from this offset.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
index | Which signature ranges to get; counts from 0. This might be less than litePDF_GetSignatureCount. |
pRangesArray | [out] Actual array to store the signature ranges to. It can be NULL, in which case the pRangesArrayLength is populated with large-enough value to hold the whole array. |
pRangesArrayLength | [in/out] Tells how many items can be stored in pRangesArray. If pRangesArray is NULL, then it is set to large-enough value. Passing non-NULL pRangesArray with no enough large array results in a failure with no change on pRangesArrayLength. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_GetSignatureReason | ( | void * | pctx, |
unsigned int | index, | ||
wchar_t * | value, | ||
unsigned int * | valueLength | ||
) |
Gets signature reason.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
index | Which signature to use; counts from 0. This might be less than litePDF_GetSignatureCount. |
value | [out] Null-terminated Unicode value. It can be NULL, in which case the valueLength is populated with large-enough value to hold the whole string. |
valueLength | [in/out] Tells how many characters can be stored in value. If value is NULL, then it is set to large-enough value (not including the Null-termination character). Passing non-NULL value with no enough large buffer results in a failure with no change on valueLength. The valueLength has stored count of characters written, not including the Null-termination character on success. |
unsigned int __stdcall LITEPDF_PUBLIC litePDF_GetUnit | ( | void * | pctx | ) |
Gets the currently set unit, which is used in functions which expect non-pixel size and position values. It can be one of LITEPDF_UNIT values. The default is LITEPDF_UNIT_MM.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
HDC __stdcall LITEPDF_PUBLIC litePDF_InsertPage | ( | void * | pctx, |
unsigned int | pageIndex, | ||
unsigned int | width_u, | ||
unsigned int | height_u, | ||
unsigned int | width_px, | ||
unsigned int | height_px, | ||
unsigned int | drawFlags | ||
) |
Begins drawing into a new page into the PDF context of the given size. Newly created page is inserted at the given position of the PDF document. This cannot be called when other drawing is in progress. If the index is out of bounds, then the page is added ad the end, like with litePDF_AddPage.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
pageIndex | Page index where to insert the page; counts from 0. |
width_u | Width of the new page in the current unit. |
height_u | Height of the new page in the current unit. |
width_px | Width of the new page in pixels. |
height_px | Height of the new page in pixels. |
drawFlags | Flags for drawing functions. This is a bit-or of LITEPDF_DRAW_FLAG values and influences only litePDF_AddPage, litePDF_InsertPage, litePDF_UpdatePage and litePDF_AddResource functions. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_InsertPageFrom | ( | void * | pctx, |
unsigned int | pageIndexTo, | ||
void * | pctx_from, | ||
unsigned int | pageIndexFrom | ||
) |
Inserts an existing page at the given index from another PDF. Both contexts should hold memory-based documents.
pctx | a litePDF context, previously created with litePDF_CreateContext, to which add the page. |
pageIndexTo | Page index where to add the page; counts from 0. Adds page at the end, if out of bounds. |
pctx_from | litePDF context, previously created with litePDF_CreateContext, from which add the page. |
pageIndexFrom | Page index which to add from pctx_from; counts from 0. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_LoadFromData | ( | void * | pctx, |
const BYTE * | data, | ||
unsigned int | dataLength, | ||
const char * | password, | ||
BOOL | forUpdate | ||
) |
Makes the litePDF context hold a memory-based PDF, which is loaded with a PDF data. This should be closed with litePDF_Close. The forUpdate parameter specifies whether the file is being opened for incremental update. In that case saving such document will result in the changes being appended to the end of the original document, instead of resaving whole document.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
data | PDF data to load. |
dataLength | Length of PDF data. |
password | Password to use for encrypted documents. |
forUpdate | Set to TRUE to open the file for incremental update, or set to FALSE otherwise. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_LoadFromFile | ( | void * | pctx, |
const char * | fileName, | ||
const char * | password, | ||
BOOL | loadCompletely, | ||
BOOL | forUpdate | ||
) |
Makes the litePDF context hold a memory-based PDF, which is loaded from a disk file. This should be closed with litePDF_Close. The loadCompletely parameter is used to determine whether the file should be loaded into memory completely, or when the file can be read on demand. Using complete load requires more memory, but the disk file can be changed freely in the background, while incomplete load requires left the file without changes while being opened. The forUpdate parameter specifies whether the file is being opened for incremental update. In that case saving such document will result in the changes being appended to the end of the original document, instead of resaving whole document.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
fileName | File name to load the PDF from. |
password | Password to use for encrypted documents. |
loadCompletely | Set to TRUE when the file should be loaded completely into memory, or FALSE to keep the disk file in use while working with it. |
forUpdate | Set to TRUE to open the file for incremental update, or set to FALSE otherwise. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_LoadFromFileW | ( | void * | pctx, |
const wchar_t * | fileName, | ||
const char * | password, | ||
BOOL | loadCompletely, | ||
BOOL | forUpdate | ||
) |
This is the same as litePDF_LoadFromFile, the only difference is that the fileName is a wide string.
unsigned int __stdcall LITEPDF_PUBLIC litePDF_PageToResource | ( | void * | pctx, |
unsigned int | pageIndex | ||
) |
Creates a resource, which will reference an existing page. The page itself is not deleted after call of this.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
pageIndex | Page index for which create the resource reference; counts from 0. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_PrepareEncryption | ( | void * | pctx, |
const char * | userPassword, | ||
const char * | ownerPassword, | ||
unsigned int | permissions, | ||
unsigned int | algorithm | ||
) |
Prepares encryption for newly created documents. The litePDF context should be empty. The encryption is used only with litePDF_CreateFileDocument and litePDF_CreateMemDocument, other functions ignore it. Use NULL or an empty ownerPassword to unset any previously set encryption properties. Loading an encrypted document lefts it encrypted on save too.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
userPassword | User's password, can be an empty string, then the user doesn't have to write a password. |
ownerPassword | Owner's password. Can be NULL or an empty string, to unset encryption properties. |
permissions | Bit-or of LITEPDF_ENCRYPT_PERMISSION flags, to set user's permissions for the document. |
algorithm | One of LITEPDF_ENCRYPT_ALGORITHM constants, an algorithm to be used to encrypt the document. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_SaveToData | ( | void * | pctx, |
BYTE * | data, | ||
unsigned int * | dataLength | ||
) |
Saves memory-based PDF into a data. The context should hold PDF created only with litePDF_CreateMemDocument, litePDF_LoadFromFile or litePDF_LoadFromData. Passing any other context results in an error.
In case the PDF document had been loaded with litePDF_LoadFromFile, litePDF_LoadFromFileW or litePDF_LoadFromData with its forUpdate parameter being TRUE, the resulting document will contain the changes as an incremental update (appended at the end of the original document), otherwise the whole document is completely rewritten.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
data | [out] Actual data to store the PDF content to. It can be NULL, in which case the dataLength is populated with large-enough value to hold the whole data. |
dataLength | [in/out] Tells how many bytes can be stored in data. If data is NULL, then it is set to large-enough value. Passing non-NULL data with no enough large buffer results in a failure with no change on dataLength. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_SaveToDataWithSign | ( | void * | pctx, |
unsigned int | signatureIndex, | ||
BYTE * | data, | ||
unsigned int * | dataLength | ||
) |
Digitally signs a PDF document opened at the litePDF context. The caller is responsible to set at least one signer with either litePDF_AddSignerPFX or litePDF_AddSignerPEM first. An alternative litePDF_SaveToDataWithSignManual is provided when it's required to compute the signature hash manually by the caller.
In case the document had been loaded with litePDF_LoadFromFile, litePDF_LoadFromFileW or litePDF_LoadFromData with its forUpdate parameter being TRUE, the resulting document will contain the changes as an incremental update (appended at the end of the original document), otherwise the whole document is completely rewritten.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
signatureIndex | Which signature to use; counts from 0. This might be less than litePDF_GetSignatureCount. |
data | [out] Actual data to store the PDF content to. It can be NULL, in which case the dataLength is populated with large-enough value to hold the whole data. |
dataLength | [in/out] Tells how many bytes can be stored in data. If data is NULL, then it is set to large-enough value. Passing non-NULL data with no enough large buffer results in a failure with no change on dataLength. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_SaveToDataWithSignManual | ( | void * | pctx, |
unsigned int | signatureIndex, | ||
litePDF_appendSignatureDataFunc | appendSignatureData, | ||
void * | append_user_data, | ||
litePDF_finishSignatureFunc | finishSignature, | ||
void * | finish_user_data, | ||
BYTE * | data, | ||
unsigned int * | dataLength | ||
) |
Digitally signs a PDF document opened at the litePDF context. The caller is responsible for a detached hash computations and related certificate management.
In case the document had been loaded with litePDF_LoadFromFile, litePDF_LoadFromFileW or litePDF_LoadFromData with its forUpdate parameter being TRUE, the resulting document will contain the changes as an incremental update (appended at the end of the original document), otherwise the whole document is completely rewritten.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
signatureIndex | Which signature to use; counts from 0. This might be less than litePDF_GetSignatureCount. |
appendSignatureData | Called when more data should be added to hash computation. The function cannot be NULL, even when called the second time, to get actual data. |
append_user_data | User data value for the appendSignatureData callback. |
finishSignature | Called when all the data are processed, and the signature value is required. The signature_len contains size of the signature buffer. The callback is responsible to populate signature and signature_len with correct values. Set signature_len to zero on any error. Note the callback is called only once. The function cannot be NULL, even when called the second time, to get actual data. |
finish_user_data | User data value for the finishSignature callback. |
data | [out] Actual data to store the PDF content to. It can be NULL, in which case the dataLength is populated with large-enough value to hold the whole data. |
dataLength | [in/out] Tells how many bytes can be stored in data. If data is NULL, then it is set to large-enough value. Passing non-NULL data with no enough large buffer results in a failure with no change on dataLength. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_SaveToFile | ( | void * | pctx, |
const char * | fileName | ||
) |
Saves memory-based PDF into a file. The context should hold PDF created only with litePDF_CreateMemDocument, litePDF_LoadFromFile or litePDF_LoadFromData. Passing any other context results in an error.
In case the PDF document had been loaded with litePDF_LoadFromFile, litePDF_LoadFromFileW or litePDF_LoadFromData with its forUpdate parameter being TRUE, the resulting document will contain the changes as an incremental update (appended at the end of the original document), otherwise the whole document is completely rewritten.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
fileName | File name to which save the memory-based PDF. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_SaveToFileW | ( | void * | pctx, |
const wchar_t * | fileName | ||
) |
This is the same as litePDF_SaveToFile, the only difference is that the fileName is a wide string.
BOOL __stdcall LITEPDF_PUBLIC litePDF_SaveToFileWithSign | ( | void * | pctx, |
const char * | fileName, | ||
unsigned int | signatureIndex | ||
) |
Digitally signs a PDF document opened at the litePDF context. The caller is responsible to set at least one signer with either litePDF_AddSignerPFX or litePDF_AddSignerPEM first. An alternative litePDF_SaveToFileWithSignManual is provided when it's required to compute the signature hash manually by the caller.
In case the document had been loaded with litePDF_LoadFromFile, litePDF_LoadFromFileW or litePDF_LoadFromData with its forUpdate parameter being TRUE, the resulting document will contain the changes as an incremental update (appended at the end of the original document), otherwise the whole document is completely rewritten.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
fileName | A file name where to save signed PDF document. |
signatureIndex | Which signature to use; counts from 0. This might be less than litePDF_GetSignatureCount. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_SaveToFileWithSignManual | ( | void * | pctx, |
const char * | fileName, | ||
unsigned int | signatureIndex, | ||
litePDF_appendSignatureDataFunc | appendSignatureData, | ||
void * | append_user_data, | ||
litePDF_finishSignatureFunc | finishSignature, | ||
void * | finish_user_data | ||
) |
Digitally signs a PDF document opened at the litePDF context. The caller is responsible for a detached hash computations and related certificate management.
In case the document had been loaded with litePDF_LoadFromFile, litePDF_LoadFromFileW or litePDF_LoadFromData with its forUpdate parameter being TRUE, the resulting document will contain the changes as an incremental update (appended at the end of the original document), otherwise the whole document is completely rewritten.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
fileName | A file name where to save signed PDF document. |
signatureIndex | Which signature to use; counts from 0. This might be less than litePDF_GetSignatureCount. |
appendSignatureData | Called when more data should be added to hash computation. The function cannot be NULL, even when called the second time, to get actual data. |
append_user_data | User data value for the appendSignatureData callback. |
finishSignature | Called when all the data are processed, and the signature value is required. The signature_len contains size of the signature buffer. The callback is responsible to populate signature and signature_len with correct values. Set signature_len to zero on any error. Note the callback is called only once. The function cannot be NULL, even when called the second time, to get actual data. |
finish_user_data | User data value for the finishSignature callback. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_SaveToFileWithSignManualW | ( | void * | pctx, |
const wchar_t * | fileName, | ||
unsigned int | signatureIndex, | ||
litePDF_appendSignatureDataFunc | appendSignatureData, | ||
void * | append_user_data, | ||
litePDF_finishSignatureFunc | finishSignature, | ||
void * | finish_user_data | ||
) |
This is the same as litePDF_SaveToFileWithSignManual, the only difference is that the fileName is a wide string.
BOOL __stdcall LITEPDF_PUBLIC litePDF_SaveToFileWithSignW | ( | void * | pctx, |
const wchar_t * | fileName, | ||
unsigned int | signatureIndex | ||
) |
This is the same as litePDF_SaveToFileWithSign, the only difference is that the fileName is a wide string.
BOOL __stdcall LITEPDF_PUBLIC litePDF_SetDocumentInfo | ( | void * | pctx, |
const char * | name, | ||
const wchar_t * | value | ||
) |
Sets information about the document. The name can be one of the LITEPDF_DOCUMENT_INFO predefined constants.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
name | Document info property name to set. |
value | Null-terminated Unicode value to set. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_SetEvalFontFlagCallback | ( | void * | pctx, |
litePDFEvalFontFlagCB | callback, | ||
void * | callback_user_data | ||
) |
Sets a callback to evaluate what to do with a font. The callback can be NULL, to unset any previously set value. See litePDFEvalFontFlagCB for more information about the callback parameters and what it can do.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
callback | A litePDFEvalFontFlagCB callback to set, or NULL. |
callback_user_data | A user data to pass to callback when called. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_SetPageRotation | ( | void * | pctx, |
unsigned int | pageIndex, | ||
int | degrees | ||
) |
Sets rotation of an existing page, in degrees. Expected values are 0, 90, 180 and 270.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
pageIndex | Page index for which get the page size; counts from 0. |
degrees | Rotation of the page to set, in degrees. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_SetSignatureAppearance | ( | void * | pctx, |
unsigned int | index, | ||
unsigned int | appearanceType, | ||
unsigned int | resourceID, | ||
int | offsetX_u, | ||
int | offsetY_u | ||
) |
Sets the signature appearance.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
index | Which signature to use; counts from 0. This might be less than litePDF_GetSignatureCount. |
appearanceType | One of the LITEPDF_APPEARANCE_NORMAL, LITEPDF_APPEARANCE_ROLLOVER and LITEPDF_APPEARANCE_DOWN constants. At least the LITEPDF_APPEARANCE_NORMAL type should be set, if the appearance of the signature is requested. |
resourceID | An existing resource ID of the annotation content, as shown to the user. |
offsetX_u | X-offset of the resource inside the annotation of the signature, in the current unit. |
offsetY_u | Y-offset of the resource inside the annotation of the signature, in the current unit. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_SetSignatureCertification | ( | void * | pctx, |
unsigned int | index, | ||
unsigned int | permission | ||
) |
Sets the signature certification. This is used to detect modifications relative to a signature field that is signed by the author of a document (the person applying the first signature). A document can contain only one signature field that contains the access permissions; it should be the first signed field in the document. It enables the author to specify what changes are permitted to be made the document and what changes invalidate the author’s signature.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
index | Which signature to use; counts from 0. This might be less than litePDF_GetSignatureCount. |
permission | One of the LITEPDF_CERTIFICATION_PERMISSION_NO_PERMS, LITEPDF_CERTIFICATION_PERMISSION_FORM_FILL and LITEPDF_CERTIFICATION_PERMISSION_ANNOTATIONS constants. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_SetSignatureCreator | ( | void * | pctx, |
unsigned int | index, | ||
const char * | creator | ||
) |
Sets signature creator. This can be left unset.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
index | Which signature to use; counts from 0. This might be less than litePDF_GetSignatureCount. |
creator | The value to set. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_SetSignatureDate | ( | void * | pctx, |
unsigned int | index, | ||
__int64 | dateOfSign | ||
) |
Sets signature field date of sign.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
index | Which signature to use; counts from 0. This might be less than litePDF_GetSignatureCount. |
dateOfSign | Date of sign, like Unix time_t, when the signature was created; less than or equal to 0 means today. The value can be clamp on 32-bit systems. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_SetSignatureHash | ( | void * | pctx, |
unsigned int | signatureHash | ||
) |
Sets the signature hash algorithm to be used. The default value is LITEPDF_SIGNATURE_HASH_SHA512. It is used only when the litePDF_SaveToFileWithSign or litePDF_SaveToDataWithSign are used. The supported values are LITEPDF_SIGNATURE_HASH_SHA1, LITEPDF_SIGNATURE_HASH_SHA256, LITEPDF_SIGNATURE_HASH_SHA384 and LITEPDF_SIGNATURE_HASH_SHA512.
This value is remembered in general, not for any signature in particular.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
signatureHash | The hash algorithm to use. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_SetSignatureLocation | ( | void * | pctx, |
unsigned int | index, | ||
const wchar_t * | location | ||
) |
Sets signature location, aka where the signature had been made. This can be left unset.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
index | Which signature to use; counts from 0. This might be less than litePDF_GetSignatureCount. |
location | The value to set. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_SetSignatureReason | ( | void * | pctx, |
unsigned int | index, | ||
const wchar_t * | reason | ||
) |
Sets signature reason.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
index | Which signature to use; counts from 0. This might be less than litePDF_GetSignatureCount. |
reason | The value to set. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_SetSignatureSize | ( | void * | pctx, |
unsigned int | requestBytes | ||
) |
Sets how many bytes the signature may require. The default value is 4096 bytes and it is automatically adjusted when the litePDF_SaveToFileWithSign or litePDF_SaveToDataWithSign are used. The manual signing functions require this value to be set before signing, if the final hash with the certificate exceeds the default size.
This value is remembered in general, not for any signature in particular.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
requestBytes | How many bytes the signature will require. |
BOOL __stdcall LITEPDF_PUBLIC litePDF_SetUnit | ( | void * | pctx, |
unsigned int | unitValue | ||
) |
Sets a unit to use in functions which expect non-pixel size and position values. It can be one of LITEPDF_UNIT values. The default is LITEPDF_UNIT_MM.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
unitValue | One of LITEPDF_UNIT values, to set as a unit for the litePDF context. |
HDC __stdcall LITEPDF_PUBLIC litePDF_UpdatePage | ( | void * | pctx, |
unsigned int | pageIndex, | ||
unsigned int | width_px, | ||
unsigned int | height_px, | ||
unsigned int | drawFlags | ||
) |
Begins drawing into an already existing page. The page size in the current unit can be found by litePDF_GetPageSize. The function fails, and returns NULL, if the pageIndex is out of bounds.
pctx | a litePDF context, previously created with litePDF_CreateContext. |
pageIndex | Page index which to update; counts from 0. |
width_px | Width of the new page in pixels. |
height_px | Height of the new page in pixels. |
drawFlags | Flags for drawing functions. This is a bit-or of LITEPDF_DRAW_FLAG values and influences only litePDF_AddPage, litePDF_InsertPage, litePDF_UpdatePage and litePDF_AddResource functions. |
LITEPDF_BEGIN_DECLS typedef void | ( | __stdcall * | litePDFErrorCB | ) |
LITEPDF_BEGIN_DECLS typedef const char* msg |
LITEPDF_BEGIN_DECLS typedef const char void* user_data |
Error callback.
code | Error code, same as GetLastError(). |
msg | Detailed error message. |
user_data | User data provided in litePDF_CreateMemDocument. |