litePDF C++ interface
2.0.5
|
#include <litePDF.h>
Public Member Functions | |
TLitePDF () | |
virtual | ~TLitePDF () |
void | setOnError (MLitePDFErrorEvent pOnError, void *pOnErrorUserData) |
DWORD | getLastErrorCode (void) const |
const char * | getLastErrorMessage (void) const |
void | SetUnit (TLitePDFUnit unitValue) |
TLitePDFUnit | GetUnit (void) |
double | MMToUnitEx (TLitePDFUnit useUnit, double mmValue) const |
double | UnitToMMEx (TLitePDFUnit useUnit, double unitValue) const |
double | InchToUnitEx (TLitePDFUnit useUnit, double inchValue) const |
double | UnitToInchEx (TLitePDFUnit useUnit, double unitValue) const |
double | MMToUnit (double mmValue) |
double | UnitToMM (double unitValue) |
double | InchToUnit (double inchValue) |
double | UnitToInch (double unitValue) |
void | SetEvalFontFlagCallback (TLitePDFEvalFontFlagCB callback, void *userData) |
void | PrepareEncryption (const char *userPassword, const char *ownerPassword, unsigned int permissions, unsigned int algorithm) |
void | CreateFileDocument (const char *fileName) |
void | CreateFileDocumentW (const wchar_t *fileName) |
void | CreateMemDocument (void) |
void | LoadFromFile (const char *fileName, const char *password, bool loadCompletely, bool forUpdate=false) |
void | LoadFromFileW (const wchar_t *fileName, const char *password, bool loadCompletely, bool forUpdate=false) |
void | LoadFromData (const BYTE *data, unsigned int dataLength, const char *password, bool forUpdate=false) |
void | SaveToFile (const char *fileName) |
void | SaveToFileW (const wchar_t *fileName) |
bool | SaveToData (BYTE *data, unsigned int *dataLength) |
void | Close (void) |
unsigned int | GetPageCount (void) |
void | GetPageSize (unsigned int pageIndex, unsigned int *width_u, unsigned int *height_u) |
int | GetPageRotation (unsigned int pageIndex) |
void | SetPageRotation (unsigned int pageIndex, int degrees) |
HDC | AddPage (unsigned int width_u, unsigned int height_u, unsigned int width_px, unsigned int height_px, unsigned int drawFlags) |
HDC | InsertPage (unsigned int pageIndex, unsigned int width_u, unsigned int height_u, unsigned int width_px, unsigned int height_px, unsigned int drawFlags) |
HDC | UpdatePage (unsigned int pageIndex, unsigned int width_px, unsigned int height_px, unsigned int drawFlags) |
void | FinishPage (HDC hDC) |
HDC | AddResource (unsigned int width_u, unsigned int height_u, unsigned int width_px, unsigned int height_px, unsigned int drawFlags) |
unsigned int | FinishResource (HDC hDC) |
void | DeletePage (unsigned int pageIndex) |
void | AddPagesFrom (litePDF::TLitePDF *from, unsigned int pageIndex, unsigned int pageCount) |
void | InsertPageFrom (unsigned int pageIndexTo, litePDF::TLitePDF *from, unsigned int pageIndexFrom) |
unsigned int | AddPageFromAsResource (litePDF::TLitePDF *from, unsigned int pageIndex, bool useTrimBox=false) |
unsigned int | PageToResource (unsigned int pageIndex) |
void | GetResourceSize (unsigned int resourceID, unsigned int *width_u, unsigned int *height_u) |
void | DrawResource (unsigned int resourceID, unsigned int pageIndex, TLitePDFUnit unitValue, int x, int y, int scaleX, int scaleY) |
void | DrawResourceWithMatrix (unsigned int resourceID, unsigned int pageIndex, double a, double b, double c, double d, double e, double f) |
void | SetDocumentInfo (const char *name, const wchar_t *value) |
bool | GetDocumentInfoExists (const char *name) |
std::wstring | GetDocumentInfo (const char *name) |
bool | GetDocumentIsSigned (void) |
unsigned int | GetSignatureCount (void) |
std::string | GetSignatureName (unsigned int index) |
unsigned int | CreateSignature (const char *name, unsigned int annotationPageIndex, int annotationX_u, int annotationY_u, int annotationWidth_u, int annotationHeight_u, unsigned int annotationFlags) |
bool | GetSignatureHasData (unsigned int index) |
bool | GetSignatureData (unsigned int index, BYTE *data, unsigned int *dataLength) |
bool | GetSignatureRanges (unsigned int index, unsigned __int64 *pRangesArray, unsigned int *pRangesArrayLength) |
void | SetSignatureDate (unsigned int index, __int64 dateOfSign) |
__int64 | GetSignatureDate (unsigned int index) |
void | SetSignatureReason (unsigned int index, const wchar_t *reason) |
std::wstring | GetSignatureReason (unsigned int index) |
void | SetSignatureLocation (unsigned int index, const wchar_t *location) |
std::wstring | GetSignatureLocation (unsigned int index) |
void | SetSignatureCreator (unsigned int index, const char *creator) |
std::string | GetSignatureCreator (unsigned int index) |
void | SetSignatureAppearance (unsigned int index, TLitePDFAppearance appearanceType, unsigned int resourceID, int offsetX_u, int offsetY_u) |
void | SetSignatureCertification (unsigned int index, TLitePDFCertificationPermission permission) |
void | SetSignatureSize (unsigned int requestBytes) |
void | SetSignatureHash (TLitePDFSignatureHash signatureHash) |
void | AddSignerPFX (const BYTE *pfxData, unsigned int pfxDataLength, const char *pfxPassword) |
void | AddSignerPEM (const BYTE *pemData, unsigned int pemDataLength, const BYTE *pkeyData, unsigned int pkeyDataLength, const char *pkeyPassword) |
void | SaveToFileWithSign (const char *fileName, unsigned int signatureIndex) |
void | SaveToFileWithSignW (const wchar_t *fileName, unsigned int signatureIndex) |
bool | SaveToDataWithSign (unsigned int signatureIndex, BYTE *data, unsigned int *dataLength) |
void | SaveToFileWithSignManual (const char *fileName, unsigned int signatureIndex, TLitePDFAppendSignatureDataFunc appendSignatureData, void *append_user_data, TLitePDFFinishSignatureFunc finishSignature, void *finish_user_data) |
void | SaveToFileWithSignManualW (const wchar_t *fileName, unsigned int signatureIndex, TLitePDFAppendSignatureDataFunc appendSignatureData, void *append_user_data, TLitePDFFinishSignatureFunc finishSignature, void *finish_user_data) |
bool | SaveToDataWithSignManual (unsigned int signatureIndex, TLitePDFAppendSignatureDataFunc appendSignatureData, void *append_user_data, TLitePDFFinishSignatureFunc finishSignature, void *finish_user_data, BYTE *data, unsigned int *dataLength) |
void | EmbedFile (const char *fileName) |
void | EmbedFileW (const wchar_t *fileName) |
void | EmbedData (const char *fileName, const BYTE *data, unsigned int dataLength) |
void | EmbedDataW (const wchar_t *fileName, const BYTE *data, unsigned int dataLength) |
int | GetEmbeddedFileCount (void) |
std::string | GetEmbeddedFileName (unsigned int index) |
std::wstring | GetEmbeddedFileNameW (unsigned int index) |
bool | GetEmbeddedFileData (unsigned int index, BYTE *data, unsigned int *dataLength) |
void * | GetPoDoFoDocument (void) |
void | DrawDebugPage (const char *filename) |
void | CreateLinkAnnotation (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) |
void | CreateURIAnnotation (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 | CreateBookmarkRoot (const wchar_t *title, unsigned int flags, COLORREF titleColor, unsigned int destinationPageIndex, unsigned int destinationX_u, unsigned int destinationY_u) |
unsigned int | CreateBookmarkChild (unsigned int parentBookmarkID, const wchar_t *title, unsigned int flags, COLORREF titleColor, unsigned int destinationPageIndex, unsigned int destinationX_u, unsigned int destinationY_u) |
unsigned int | CreateBookmarkSibling (unsigned int previousBookmarkID, const wchar_t *title, unsigned int flags, COLORREF titleColor, unsigned int destinationPageIndex, unsigned int destinationX_u, unsigned int destinationY_u) |
litePDF::TLitePDF::TLitePDF | ( | ) |
Creates a new TLiteDPF object.
|
virtual |
HDC litePDF::TLitePDF::AddPage | ( | 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 document 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.
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 TLitePDFDrawFlags values and influences only AddPage, InsertPage, UpdatePage and AddResource functions. |
unsigned int litePDF::TLitePDF::AddPageFromAsResource | ( | litePDF::TLitePDF * | from, |
unsigned int | pageIndex, | ||
bool | useTrimBox = false |
||
) |
Adds an existing page as a resource of a given PDF. This resource can be referenced multiple times by its identifier. Both objects should hold memory-based documents.
from | a LitePDF object, from which add the page. |
pageIndex | Page index which to add from from; counts from 0. |
useTrimBox | If true, try to use trimbox for size of the resource (XObject) |
void litePDF::TLitePDF::AddPagesFrom | ( | litePDF::TLitePDF * | from, |
unsigned int | pageIndex, | ||
unsigned int | pageCount | ||
) |
Adds existing pages as the last pages from another PDF. Both objects should hold memory-based documents.
from | a LitePDF object from which add the pages. |
pageIndex | Page index which to add from from; counts from 0. |
pageCount | How many pages to add; 0 means whole document. |
HDC litePDF::TLitePDF::AddResource | ( | 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 document of the given size. This cannot be called when other drawing is in progress.
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 TLitePDFDrawFlags values and influences only AddPage, InsertPage, UpdatePage and AddResource functions. |
void litePDF::TLitePDF::AddSignerPEM | ( | 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 SaveToFileWithSign or SaveToDataWithSign. The passed-in certificate and private key are in the PEM format.
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. |
void litePDF::TLitePDF::AddSignerPFX | ( | const BYTE * | pfxData, |
unsigned int | pfxDataLength, | ||
const char * | pfxPassword | ||
) |
Adds a signer to be used when digitally signing the document with SaveToFileWithSign or SaveToDataWithSign. The passed-in certificate is in the PFX format and should include the private key.
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 litePDF::TLitePDF::Close | ( | void | ) |
Closes PDF data in a LitePDF object, thus the object doesn't hold anything afterward, aka it's like a newly created object. The function does nothing, if the object 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 PrepareEncryption.
unsigned int litePDF::TLitePDF::CreateBookmarkChild | ( | unsigned int | parentBookmarkID, |
const wchar_t * | title, | ||
unsigned int | flags, | ||
COLORREF | titleColor, | ||
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 object 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.
parentBookmarkID | Bookmark ID of the parent bookmark. The child will be created under this bookmark. |
title | Title of the bookmark. |
flags | Bit-or of TLitePDFBookmarkFlags flags. |
titleColor | RGB 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 litePDF::TLitePDF::CreateBookmarkRoot | ( | const wchar_t * | title, |
unsigned int | flags, | ||
COLORREF | titleColor, | ||
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 object 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.
title | Title of the bookmark. |
flags | Bit-or of TLitePDFBookmarkFlags flags. |
titleColor | RGB 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 litePDF::TLitePDF::CreateBookmarkSibling | ( | unsigned int | previousBookmarkID, |
const wchar_t * | title, | ||
unsigned int | flags, | ||
COLORREF | titleColor, | ||
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 object 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.
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 TLitePDFBookmarkFlags flags. |
titleColor | RGB 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 litePDF::TLitePDF::CreateFileDocument | ( | const char * | fileName | ) |
Makes the LitePDF object hold a new PDF, which writes directly to a file. The object should not have opened any other PDF data. Call Close, to close the file, and possibly save changes to it. Most of the operations require memory-based PDF, which can be created with CreateMemDocument.
fileName | File name to write the PDF result to. |
void litePDF::TLitePDF::CreateFileDocumentW | ( | const wchar_t * | fileName | ) |
This is the same as CreateFileDocument, the only difference is that the fileName is a wide string.
void litePDF::TLitePDF::CreateLinkAnnotation | ( | 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 object 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.
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 TLitePDFAnnotationFlags 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. |
void litePDF::TLitePDF::CreateMemDocument | ( | void | ) |
Makes the litePDF object hold a memory-based PDF. Such PDF can be saved with SaveToFile or SaveToData. The PDF should be closed with Close.
unsigned int litePDF::TLitePDF::CreateSignature | ( | const char * | name, |
unsigned int | annotationPageIndex, | ||
int | annotationX_u, | ||
int | annotationY_u, | ||
int | annotationWidth_u, | ||
int | annotationHeight_u, | ||
unsigned int | annotationFlags | ||
) |
Creates a new signature field named name. The field is created completely empty. Use SetSignatureDate, SetSignatureReason, SetSignatureLocation, SetSignatureCreator, SetSignatureAppearance and such to populate it with required values. Finally, to sign the signature field use SaveToFileWithSign family functions.
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 TLitePDFAnnotationFlags flags. |
void litePDF::TLitePDF::CreateURIAnnotation | ( | 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.
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 TLitePDFAnnotationFlags 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. |
void litePDF::TLitePDF::DeletePage | ( | unsigned int | pageIndex | ) |
Deletes page at given index. It doesn't delete page resources, because these can be used by other pages.
pageIndex | Page index which to update; counts from 0. |
void litePDF::TLitePDF::DrawDebugPage | ( | 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).
filename | File name with full path for litePDF debug page. |
void litePDF::TLitePDF::DrawResource | ( | unsigned int | resourceID, |
unsigned int | pageIndex, | ||
TLitePDFUnit | unitValue, | ||
int | x, | ||
int | y, | ||
int | scaleX, | ||
int | scaleY | ||
) |
Draws an existing resource at the given position. The resource ID was returned from AddPageFromAsResource, PageToResource or 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 LitePDFUnit_1000th_mm or LitePDFUnit_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).
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. |
void litePDF::TLitePDF::DrawResourceWithMatrix | ( | unsigned int | resourceID, |
unsigned int | pageIndex, | ||
double | a, | ||
double | b, | ||
double | c, | ||
double | d, | ||
double | e, | ||
double | 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 AddPageFromAsResource or FinishResource. The constructed transformation matrix is a standard 3x3 matrix:
| a b 0 |
| c d 0 |
| e f 1 |
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 PDF units. |
b | Transformation matrix [ a b c d e f ] parameter 'b', in PDF units. |
c | Transformation matrix [ a b c d e f ] parameter 'c', in PDF units. |
d | Transformation matrix [ a b c d e f ] parameter 'd', in PDF units. |
e | Transformation matrix [ a b c d e f ] parameter 'e', in PDF units. |
f | Transformation matrix [ a b c d e f ] parameter 'f', in PDF units. |
void litePDF::TLitePDF::EmbedData | ( | const char * | fileName, |
const BYTE * | data, | ||
unsigned int | dataLength | ||
) |
Embeds a data (file) into a PDF document.
fileName | File name to be used for the data identification. |
data | Actual data to be attached. |
dataLength | Length of the data. |
void litePDF::TLitePDF::EmbedDataW | ( | const wchar_t * | fileName, |
const BYTE * | data, | ||
unsigned int | dataLength | ||
) |
This is the same as EmbedData, the only difference is that the fileName is a wide string.
void litePDF::TLitePDF::EmbedFile | ( | const char * | fileName | ) |
Embeds a file into a PDF document.
fileName | File name of the file to be attached. |
void litePDF::TLitePDF::EmbedFileW | ( | const wchar_t * | fileName | ) |
This is the same as EmbedFile, the only difference is that the fileName is a wide string.
void litePDF::TLitePDF::FinishPage | ( | 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.
hDC | Device context previously returned by AddPage, InsertPage or UpdatePage. |
unsigned int litePDF::TLitePDF::FinishResource | ( | 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.
hDC | Device context previously returned by AddResource. |
std::wstring litePDF::TLitePDF::GetDocumentInfo | ( | const char * | name | ) |
Gets information about the document. The name can be one of the LitePDFDocumentInfo predefined constants.
name | Document info property name to get. |
bool litePDF::TLitePDF::GetDocumentInfoExists | ( | const char * | name | ) |
Checks whether information about the document of the given name exists. The name can be one of the LitePDFDocumentInfo predefined constants.
name | Document info property name to test. |
bool litePDF::TLitePDF::GetDocumentIsSigned | ( | void | ) |
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.
int litePDF::TLitePDF::GetEmbeddedFileCount | ( | void | ) |
Gets count of embedded files stored in a PDF document.
bool litePDF::TLitePDF::GetEmbeddedFileData | ( | 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.
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. |
std::string litePDF::TLitePDF::GetEmbeddedFileName | ( | unsigned int | index | ) |
Gets embedded file's name, as stored in a PDF document.
index | Index of the embedded file; returns failure, if out of range. |
std::wstring litePDF::TLitePDF::GetEmbeddedFileNameW | ( | unsigned int | index | ) |
This is the same as GetEmbeddedFileName, the only difference is that the return fileName is a wide string.
DWORD litePDF::TLitePDF::getLastErrorCode | ( | void | ) | const |
Returns the last error code, which was notified by the litePDF library, if any. Most of the object calls usually throw a TLitePDFException on errors.
const char* litePDF::TLitePDF::getLastErrorMessage | ( | void | ) | const |
Returns the last error message, which was notified by the litePDF library, if any. Most of the object calls usually throw a TLitePDFException on errors.
unsigned int litePDF::TLitePDF::GetPageCount | ( | void | ) |
Returns count of pages in an opened PDF document.
int litePDF::TLitePDF::GetPageRotation | ( | unsigned int | pageIndex | ) |
Gets rotation of an existing page, in degrees. Expected values are 0, 90, 180 and 270.
pageIndex | Page index for which get the page size; counts from 0. |
void litePDF::TLitePDF::GetPageSize | ( | unsigned int | pageIndex, |
unsigned int * | width_u, | ||
unsigned int * | height_u | ||
) |
Gets size of an existing page, in the current unit.
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* litePDF::TLitePDF::GetPoDoFoDocument | ( | void | ) |
void litePDF::TLitePDF::GetResourceSize | ( | 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 AddPageFromAsResource or FinishResource.
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. |
unsigned int litePDF::TLitePDF::GetSignatureCount | ( | void | ) |
Provides how many signature fields the currently opened document contains. It returns the count of the all fields, not only those already signed.
std::string litePDF::TLitePDF::GetSignatureCreator | ( | unsigned int | index | ) |
Gets signature creator.
index | Which signature to use; counts from 0. This might be less than GetSignatureCount. |
bool litePDF::TLitePDF::GetSignatureData | ( | unsigned int | index, |
BYTE * | data, | ||
unsigned int * | dataLength | ||
) |
Gathers raw signature data for the given signature in the currently opened document. Use GetSignatureHasData to check whether the given signature field is signed or not.
index | Which signature data to get; counts from 0. This might be less than 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. |
__int64 litePDF::TLitePDF::GetSignatureDate | ( | unsigned int | index | ) |
Gets signature field date of sign.
index | Which signature to use; counts from 0. This might be less than GetSignatureCount. |
bool litePDF::TLitePDF::GetSignatureHasData | ( | unsigned int | index | ) |
Checks whether the given signature field contains any data, which means whether the signature field is signed.
index | Which signature data to get; counts from 0. This might be less than GetSignatureCount. |
std::wstring litePDF::TLitePDF::GetSignatureLocation | ( | unsigned int | index | ) |
Gets signature location.
index | Which signature to use; counts from 0. This might be less than GetSignatureCount. |
std::string litePDF::TLitePDF::GetSignatureName | ( | unsigned int | index | ) |
Gets the signature field name at the given index.
index | Which signature field name to get; counts from 0. This might be less than GetSignatureCount. |
bool litePDF::TLitePDF::GetSignatureRanges | ( | 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 (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.
index | Which signature ranges to get; counts from 0. This might be less than 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. |
std::wstring litePDF::TLitePDF::GetSignatureReason | ( | unsigned int | index | ) |
Gets signature reason.
index | Which signature to use; counts from 0. This might be less than GetSignatureCount. |
TLitePDFUnit litePDF::TLitePDF::GetUnit | ( | void | ) |
Gets the currently set unit, which is used in functions which expect non-pixel size and position values. It can be one of TLitePDFUnit values. The default is LitePDFUnit_mm.
double litePDF::TLitePDF::InchToUnit | ( | double | inchValue | ) |
Converts a value from inches to the current unit. The caller does the rounding as needed.
inchValue | A value in inches to convert to the current unit. |
double litePDF::TLitePDF::InchToUnitEx | ( | TLitePDFUnit | useUnit, |
double | inchValue | ||
) | const |
Converts a value from inches to useUnit. The caller does the rounding as needed.
useUnit | The TLitePDFUnit unit to convert the value to. |
inchValue | The value in inches to convert. |
HDC litePDF::TLitePDF::InsertPage | ( | 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 document 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 AddPage.
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 TLitePDFDrawFlags values and influences only AddPage, InsertPage, UpdatePage and AddResource functions. |
void litePDF::TLitePDF::InsertPageFrom | ( | unsigned int | pageIndexTo, |
litePDF::TLitePDF * | from, | ||
unsigned int | pageIndexFrom | ||
) |
Inserts an existing page at the given index from another PDF. Both objects should hold memory-based documents.
pageIndexTo | Page index where to add the page; counts from 0. Adds page at the end, if out of bounds. |
from | a LitePDF object, from which add the page. |
pageIndexFrom | Page index which to add from from; counts from 0. |
void litePDF::TLitePDF::LoadFromData | ( | const BYTE * | data, |
unsigned int | dataLength, | ||
const char * | password, | ||
bool | forUpdate = false |
||
) |
Makes the LitePDF object hold a memory-based PDF, which is loaded with a PDF data. This should be closed with 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.
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. Default is false. |
void litePDF::TLitePDF::LoadFromFile | ( | const char * | fileName, |
const char * | password, | ||
bool | loadCompletely, | ||
bool | forUpdate = false |
||
) |
Makes the LitePDF object hold a memory-based PDF, which is loaded from a disk file. This should be closed with 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.
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. Default is false. |
void litePDF::TLitePDF::LoadFromFileW | ( | const wchar_t * | fileName, |
const char * | password, | ||
bool | loadCompletely, | ||
bool | forUpdate = false |
||
) |
This is the same as LoadFromFile, the only difference is that the fileName is a wide string.
double litePDF::TLitePDF::MMToUnit | ( | double | mmValue | ) |
Converts a value from millimeters to current unit. The caller does the rounding as needed.
mmValue | A value in millimeters to convert to the current unit. |
double litePDF::TLitePDF::MMToUnitEx | ( | TLitePDFUnit | useUnit, |
double | mmValue | ||
) | const |
Converts a value from millimeters to useUnit. The caller does the rounding as needed.
useUnit | The TLitePDFUnit unit to convert the value to. |
mmValue | The value in millimeters to convert. |
unsigned int litePDF::TLitePDF::PageToResource | ( | unsigned int | pageIndex | ) |
Creates a resource, which will reference an existing page. The page itself is not deleted after call of this.
pageIndex | Page index for which create the resource reference; counts from 0. |
void litePDF::TLitePDF::PrepareEncryption | ( | const char * | userPassword, |
const char * | ownerPassword, | ||
unsigned int | permissions, | ||
unsigned int | algorithm | ||
) |
Prepares encryption for newly created documents. The LitePDF object should be empty. The encryption is used only with CreateFileDocument and 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.
userPassword | User's password, can be an empty string, or NULL, then the user doesn't need to write any password. |
ownerPassword | Owner's password. Can be NULL or an empty string, to unset encryption properties. |
permissions | Bit-or of TLitePDFEncryptPermission flags, to set user's permissions for the document. |
algorithm | One of TLitePDFEncryptAlgorithm constants, an algorithm to be used to encrypt the document. |
bool litePDF::TLitePDF::SaveToData | ( | BYTE * | data, |
unsigned int * | dataLength | ||
) |
Saves memory-based PDF into a data. The object should hold PDF created only with CreateMemDocument, LoadFromFile or LoadFromData. Using any other object results in an error.
In case the PDF document had been loaded with LoadFromFile, LoadFromFileW or 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.
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 litePDF::TLitePDF::SaveToDataWithSign | ( | unsigned int | signatureIndex, |
BYTE * | data, | ||
unsigned int * | dataLength | ||
) |
Digitally signs a PDF document opened at the LitePDF object. The caller is responsible to set at least one signer with either AddSignerPFX or AddSignerPEM first. An alternative SaveToDataWithSignManual is provided when it's required to compute the signature hash manually by the caller.
In case the document had been loaded with LoadFromFile, LoadFromFileW or 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.
signatureIndex | Which signature to use; counts from 0. This might be less than 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 litePDF::TLitePDF::SaveToDataWithSignManual | ( | unsigned int | signatureIndex, |
TLitePDFAppendSignatureDataFunc | appendSignatureData, | ||
void * | append_user_data, | ||
TLitePDFFinishSignatureFunc | finishSignature, | ||
void * | finish_user_data, | ||
BYTE * | data, | ||
unsigned int * | dataLength | ||
) |
Digitally signs a PDF document opened at the LitePDF object. The caller is responsible for a detached hash computations and related certificate management.
In case the document had been loaded with LoadFromFile, LoadFromFileW or 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.
signatureIndex | Which signature to use; counts from 0. This might be less than 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. |
void litePDF::TLitePDF::SaveToFile | ( | const char * | fileName | ) |
Saves memory-based PDF into a file. The object should hold PDF created only with CreateMemDocument, LoadFromFile or LoadFromData. Using any other object results in an error.
In case the PDF document had been loaded with LoadFromFile, LoadFromFileW or 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.
fileName | File name to which save the memory-based PDF. |
void litePDF::TLitePDF::SaveToFileW | ( | const wchar_t * | fileName | ) |
This is the same as SaveToFile, the only difference is that the fileName is a wide string.
void litePDF::TLitePDF::SaveToFileWithSign | ( | const char * | fileName, |
unsigned int | signatureIndex | ||
) |
Digitally signs a PDF document opened at the LitePDF object. The caller is responsible to set at least one signer with either AddSignerPFX or AddSignerPEM first. An alternative SaveToFileWithSignManual is provided when it's required to compute the signature hash manually by the caller.
In case the document had been loaded with LoadFromFile, LoadFromFileW or 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.
fileName | A file name where to save signed PDF document. |
signatureIndex | Which signature to use; counts from 0. This might be less than GetSignatureCount. |
void litePDF::TLitePDF::SaveToFileWithSignManual | ( | const char * | fileName, |
unsigned int | signatureIndex, | ||
TLitePDFAppendSignatureDataFunc | appendSignatureData, | ||
void * | append_user_data, | ||
TLitePDFFinishSignatureFunc | finishSignature, | ||
void * | finish_user_data | ||
) |
Digitally signs a PDF document opened at the LitePDF object. The caller is responsible for a detached hash computations and related certificate management.
In case the document had been loaded with LoadFromFile, LoadFromFileW or 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.
fileName | A file name where to save signed PDF document. |
signatureIndex | Which signature to use; counts from 0. This might be less than 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. |
void litePDF::TLitePDF::SaveToFileWithSignManualW | ( | const wchar_t * | fileName, |
unsigned int | signatureIndex, | ||
TLitePDFAppendSignatureDataFunc | appendSignatureData, | ||
void * | append_user_data, | ||
TLitePDFFinishSignatureFunc | finishSignature, | ||
void * | finish_user_data | ||
) |
This is the same as SaveToFileWithSignManual, the only difference is that the fileName is a wide string.
void litePDF::TLitePDF::SaveToFileWithSignW | ( | const wchar_t * | fileName, |
unsigned int | signatureIndex | ||
) |
This is the same as SaveToFileWithSign, the only difference is that the fileName is a wide string.
void litePDF::TLitePDF::SetDocumentInfo | ( | const char * | name, |
const wchar_t * | value | ||
) |
Sets information about the document. The name can be one of the LitePDFDocumentInfo predefined constants.
name | Document info property name to set. |
value | Null-terminated Unicode value to set. |
void litePDF::TLitePDF::SetEvalFontFlagCallback | ( | TLitePDFEvalFontFlagCB | callback, |
void * | userData | ||
) |
Sets a callback to evaluate what to do with a font. The callback can be NULL, to unset any previously set value. See TLitePDFEvalFontFlagCB for more information about the callback parameters and what it can do.
callback | A TLitePDFEvalFontFlagCB callback to set, or NULL. |
userData | A user data to pass to callback when called. |
void litePDF::TLitePDF::setOnError | ( | MLitePDFErrorEvent | pOnError, |
void * | pOnErrorUserData | ||
) |
Sets a custom callback for errors notified by the litePDF library. It's not necessary to be set. The errors are those returned during any function calls, but also during drawing, for example when some draw operation is not supported. Most of the object calls usually throw a TLitePDFException on errors.
pOnError | A callback to call. |
pOnErrorUserData | user data for the callback. |
void litePDF::TLitePDF::SetPageRotation | ( | unsigned int | pageIndex, |
int | degrees | ||
) |
Sets rotation of an existing page, in degrees. Expected values are 0, 90, 180 and 270.
pageIndex | Page index for which get the page size; counts from 0. |
degrees | Rotation of the page to set, in degrees. |
void litePDF::TLitePDF::SetSignatureAppearance | ( | unsigned int | index, |
TLitePDFAppearance | appearanceType, | ||
unsigned int | resourceID, | ||
int | offsetX_u, | ||
int | offsetY_u | ||
) |
Sets the signature appearance.
index | Which signature to use; counts from 0. This might be less than GetSignatureCount. |
appearanceType | One of the LitePDFAppearance_Normal, LitePDFAppearance_Rollover and LitePDFAppearance_Down constants. At least the LitePDFAppearance_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. |
void litePDF::TLitePDF::SetSignatureCertification | ( | unsigned int | index, |
TLitePDFCertificationPermission | 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.
index | Which signature to use; counts from 0. This might be less than GetSignatureCount. |
permission | One of the LitePDFCertificationPermission_NoPerms, LitePDFCertificationPermission_FormFill and LitePDFCertificationPermission_Annotations constants. |
void litePDF::TLitePDF::SetSignatureCreator | ( | unsigned int | index, |
const char * | creator | ||
) |
Sets signature creator. This can be left unset.
index | Which signature to use; counts from 0. This might be less than GetSignatureCount. |
creator | The value to set. |
void litePDF::TLitePDF::SetSignatureDate | ( | unsigned int | index, |
__int64 | dateOfSign | ||
) |
Sets signature field date of sign.
index | Which signature to use; counts from 0. This might be less than 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. |
void litePDF::TLitePDF::SetSignatureHash | ( | TLitePDFSignatureHash | signatureHash | ) |
Sets the signature hash algorithm to be used. The default value is LitePDFSignatureHash_SHA512. It is used only when the SaveToFileWithSign or SaveToDataWithSign are used. The supported values are LitePDFSignatureHash_SHA1, LitePDFSignatureHash_SHA256, LitePDFSignatureHash_SHA384 and LitePDFSignatureHash_SHA512.
This value is remembered in general, not for any signature in particular.
signatureHash | The hash algorithm to use. |
void litePDF::TLitePDF::SetSignatureLocation | ( | unsigned int | index, |
const wchar_t * | location | ||
) |
Sets signature location, aka where the signature had been made. This can be left unset.
index | Which signature to use; counts from 0. This might be less than GetSignatureCount. |
location | The value to set. |
void litePDF::TLitePDF::SetSignatureReason | ( | unsigned int | index, |
const wchar_t * | reason | ||
) |
Sets signature reason.
index | Which signature to use; counts from 0. This might be less than GetSignatureCount. |
reason | The value to set. |
void litePDF::TLitePDF::SetSignatureSize | ( | unsigned int | requestBytes | ) |
Sets how many bytes the signature may require. The default value is 4096 bytes and it is automatically adjusted when the SaveToFileWithSign or 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.
requestBytes | How many bytes the signature will require. |
void litePDF::TLitePDF::SetUnit | ( | TLitePDFUnit | unitValue | ) |
Sets a unit to use in functions which expect non-pixel size and position values. It can be one of TLitePDFUnit values. The default is LitePDFUnit_mm.
unitValue | One of TLitePDFUnit values, to set as a unit. |
double litePDF::TLitePDF::UnitToInch | ( | double | unitValue | ) |
Converts a value from the current unit to inches. The caller does the rounding as needed.
unitValue | A value in the current unit to convert to inches. |
double litePDF::TLitePDF::UnitToInchEx | ( | TLitePDFUnit | useUnit, |
double | unitValue | ||
) | const |
Converts a value from useUnit to inches. The caller does the rounding as needed.
useUnit | The TLitePDFUnit unit to convert the value from. |
unitValue | The value in useUnit to convert. |
double litePDF::TLitePDF::UnitToMM | ( | double | unitValue | ) |
Converts a value from the current unit to millimeters. The caller does the rounding as needed.
unitValue | A value in the current unit to convert to millimeters. |
double litePDF::TLitePDF::UnitToMMEx | ( | TLitePDFUnit | useUnit, |
double | unitValue | ||
) | const |
Converts a value from useUnit to millimeters. The caller does the rounding as needed.
useUnit | The TLitePDFUnit unit to convert the value from. |
unitValue | The value in useUnit to convert. |
HDC litePDF::TLitePDF::UpdatePage | ( | 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 GetPageSize. The function fails, and returns NULL, if the pageIndex is out of bounds.
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 TLitePDFDrawFlags values and influences only AddPage, InsertPage, UpdatePage and AddResource functions. |