Comprehensive Guide for Developers: Features, Integration, and API Reference
Document API. More...
Go to the source code of this file.
Classes | |
struct | PDVersion |
struct | PDPageRange |
struct | PDDocAuthProcs |
struct | PDDocStreamProcs |
struct | PDDocOpenParams |
struct | PDOptSaveSettings |
struct | PDDocSaveParams |
Macros | |
#define | kPDPageIndexNull ((size_t)(-1)) |
Typedefs | |
typedef struct PDPageRec_ * | PDPage |
typedef void(PDFSDK_CALLCONV * | PDDocPagesChangedProc) (PDPageOperation operation, const PDPageRange *pageRange, void *clientData) |
typedef PDErrCode(PDFSDK_CALLCONV * | PDDocAuthProc) (void *authProcData, PDAtom securityHandlerName, void *pAuthData) |
typedef PDErrCode(PDFSDK_CALLCONV * | PDDocAuthFreeDataProc) (void *authProcData) |
typedef PDErrCode(PDFSDK_CALLCONV * | PDDocStreamReadAtProc) (void *streamData, uint64_t pos, void *buffer, size_t nbytes, size_t *pRead) |
typedef PDErrCode(PDFSDK_CALLCONV * | PDDocStreamGetSizeProc) (void *streamData, uint64_t *pSize) |
typedef PDErrCode(PDFSDK_CALLCONV * | PDDocStreamFreeDataProc) (void *streamData) |
typedef uint32_t | PDDocSaveFlags |
typedef uint32_t | PDOptSaveFlags |
Functions | |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDDocCreate (PDDoc *pDoc) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDDocOpen (const PDDocOpenParams *params, PDDoc *pDoc) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDDocIsCompressed (PDDoc doc, bool *pValue) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDDocIsModified (PDDoc doc, bool *pValue) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDDocSetModified (PDDoc doc, bool value) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDDocSave (PDDoc doc, const PDDocSaveParams *params) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDDocPurgeCaches (PDDoc doc) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDDocGetFilePath (PDDoc doc, wchar_t *buffer, size_t bufSize, size_t *pSize) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDDocGetPage (PDDoc doc, size_t index, PDPage *pPage) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDDocGetNumPages (PDDoc doc, size_t *pNumPages) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDDocAttachPagesChangedCallback (PDDoc doc, PDDocPagesChangedProc proc, void *clientData) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDDocDetachPagesChangedCallback (PDDoc doc, PDDocPagesChangedProc proc, void *clientData) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDDocNotifyPagesChanged (PDDoc doc, PDPageOperation operation, const PDPageRange *range) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDDocCreatePage (PDDoc doc, size_t insertAt, const PDRectF *mediaBox, PDPage *pPage) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDDocCreatePages (PDDoc doc, size_t insertAt, size_t count, const PDRectF *mediaBox) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDDocDeletePages (PDDoc doc, const PDPageRange *range, const PDProgressMonitor *progress, void *progressData) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDDocInsertPages (PDDoc doc, size_t insertAt, PDDoc sourceDoc, const PDPageRange *sourceRange, const PDProgressMonitor *progress, void *progressData) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDDocInsertPage (PDDoc doc, PDPage page, size_t insertAt) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDDocMovePages (PDDoc doc, size_t insertAt, const PDPageRange *range, const PDProgressMonitor *progress, void *progressData) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDDocFindPageIndexForLabel (PDDoc doc, const wchar_t *label, size_t labelSize, size_t *pIndex) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDDocGetLabelForPageIndex (PDDoc doc, size_t index, wchar_t *buffer, size_t bufferSize, size_t *pSize) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDDocGetID (PDDoc doc, const char **pPermaID, size_t *pPermaLen, const char **pInstanceID, size_t *pInstanceLen) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDDocGetVersion (PDDoc doc, PDVersion *pVersion) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDDocGetFileSize (PDDoc doc, uint64_t *pFileSize) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDDocGetInfoString (PDDoc doc, PDAtom infoStringAtom, wchar_t *buffer, size_t bufferSize, size_t *pSize) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDDocSetInfoString (PDDoc doc, PDAtom infoStringAtom, const wchar_t *buffer, size_t bufferSize) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDDocGetCreationDate (PDDoc doc, PDDateTime *creationDate) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDDocSetCreationDate (PDDoc doc, const PDDateTime *creationDate) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDDocGetModDate (PDDoc doc, PDDateTime *modDate) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDDocSetModDate (PDDoc doc, const PDDateTime *modDate) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDDocSetPageLayout (PDDoc doc, PDAtom layout) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDDocGetPageLayout (PDDoc doc, PDAtom *pLayout) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDDocSetPageMode (PDDoc doc, PDAtom mode) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDDocGetPageMode (PDDoc doc, PDAtom *pMode) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDDocSetPageDirection (PDDoc doc, PDPageDirection direction) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDDocGetPageDirection (PDDoc doc, PDPageDirection *pDirection) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDStructTreeRoleMapGetTag (PDDoc doc, PDAtom tag, PDAtom *pValue) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDStructTreeFindStructParent (PDDoc doc, int structParent, int MCID, PDObject *pObj) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDPageGetDoc (PDPage page, PDDoc *pDoc) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDPageGetIndex (PDPage page, size_t *pIndex) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDPageIsContentModified (PDPage page, bool *pValue) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDPageSetContentModified (PDPage page, bool value) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDPageFlushModifiedContent (PDPage page) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDPageSetMediaBox (PDPage page, const PDRectF *mediaBox) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDPageGetMediaBox (PDPage page, PDRectF *pMediaBox) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDPageSetCropBox (PDPage page, const PDRectF *cropBox) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDPageGetCropBox (PDPage page, PDRectF *pCropBox) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDPageSetTrimBox (PDPage page, const PDRectF *trimBox) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDPageGetTrimBox (PDPage page, PDRectF *pTrimBox) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDPageSetArtBox (PDPage page, const PDRectF *artBox) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDPageGetArtBox (PDPage page, PDRectF *pArtBox) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDPageSetBleedBox (PDPage page, const PDRectF *bleedBox) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDPageGetBleedBox (PDPage page, PDRectF *pBleedBox) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDPageSetRotate (PDPage page, PDRotate rotate) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDPageGetRotate (PDPage page, PDRotate *pRotate) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDPageSetUserUnitSize (PDPage page, float unitSize) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDPageGetUserUnitSize (PDPage page, float *pUnitSize) |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV | PDPageGetPDObject (PDPage page, PDObject *pObj) |
Document API.
typedef PDErrCode(PDFSDK_CALLCONV * PDDocAuthProc) (void *authProcData, PDAtom securityHandlerName, void *pAuthData) |
A callback used by PDDocOpen. It is called when an encrypted document is being opened to determine whether the user is authorized to open the file. It may be given in PDDocOpen()'s PDDocOpenParams::authProc (for the embedded standard security handler) OR be part of the PDCryptSecurityHandler callbacks.
pAuthorizationData will be created using the Security Handlers PDCryptNewAuthorizationDataProc when this is called. This callback must set the pAuthorizationData either by displaying a dialog and asking for a user / passowrd either by using whatever authorization strategy is necessary for this security handler. The data will be given to the security handler PDCryptAutorizeProc handler to continue with the autorization process.
The callback may be used at any point in the life of the document when autorization data needs to be updated. Generaly this is at the open of a document but it may also happen when an Embedded Encrypted File is accessed for the first time or when the user calls PDDocPermRequestAuthDataCallback.
[in] | authProcData | User-supplied data that was passed in the call to PDDocOpen() in PDDocOpenParams::authProcData. |
[in] | securityHandlerName | The name of the security handler as it appears in the Encrypt dictionary. kPDAtom_Standard is used for the embedded standard security handler. |
[out] | pAuthorizationData | Set by the callback after optionaly diplaying a dialog to collect data from the user. |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocGetInfoString | ( | PDDoc | doc, |
PDAtom | infoStringAtom, | ||
wchar_t * | buffer, | ||
size_t | bufferSize, | ||
size_t * | pSize ) |
Gets the document's general information, such as the document’s title, author from the Info dictionary.
See Section 14.3.3 in the PDF Reference for information about Info dictionaries.
doc | The document whose Info dictionary is obtained. |
infoStringAtom | Atom specifies what information string to retrieve. Supported atoms: Author, Title, Subject, Keywords, Creator, Producer. |
buffer | String buffer where requested info will be copied. |
bufferSize | Buffer size. |
pSize | Actual size of requested info string in symbols. |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocGetPageDirection | ( | PDDoc | doc, |
PDPageDirection * | pDirection ) |
Gets the value of the Direction key in the ViewerPreferences dialog entry in the Catalog dictionary.
From 12.2 Viewer Preferences: "This entry has no direct effect on the document’s contents or page numbering but may be used to determine the relative positioning of pages when displayed side by side or printed n-up."
doc | IN/OUT The document whose page mode is obtained. |
pMode | Page mode value from PDF Catalog dictionary. |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocGetPageLayout | ( | PDDoc | doc, |
PDAtom * | pLayout ) |
Gets the value of the PageLayout key in the Catalog dictionary.
doc | IN The document whose layout mode is obtained. |
pLayout | Layout mode value from the PDF Catalog dictionary. |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocGetPageMode | ( | PDDoc | doc, |
PDAtom * | pMode ) |
Gets the value of the PageMode key in the Catalog dictionary.
doc | IN/OUT The document whose page mode is obtained. |
pMode | Page mode value from PDF Catalog dictionary. |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocSetInfoString | ( | PDDoc | doc, |
PDAtom | infoStringAtom, | ||
const wchar_t * | buffer, | ||
size_t | bufferSize ) |
Sets the document's general information, such as the document’s title, author into the Info dictionary.
See Section 14.3.3 in the PDF Reference for information about Info dictionaries.
doc | The document whose Info dictionary is set. |
infoStringAtom | Atom specifies what information string to retrieve. Supported atoms: Author, Title, Subject, Keywords, Creator, Producer. |
buffer | String buffer which contains info string to be set. |
bufferSize | Size of the buffer. |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDPageFlushModifiedContent | ( | PDPage | page | ) |
Saves the contents of the page to a PDF stream.
[in] | page | The page whose content is saved. |
Gets the crop box for a page. The crop box is the region of the page to display and print.
[in] | page | The page whose crop box is obtained. |
[out] | pCropBox | A pointer to a rectangle specifying the page's crop box, specified in user space coordinates. |
Gets the media box for a page. The media box is the natural size of the page (for example, the dimensions of an A4 sheet of paper).
page | IN/OUT The page whose media box is obtained. |
pMediaBox | IN/OUT (Filled by the method) A pointer to a rectangle specifying the page's media box, specified in user space coordinates. |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDPageGetRotate | ( | PDPage | page, |
PDRotate * | pRotate ) |
Gets the rotation value for a page.
[in] | page | The page whose rotation is obtained. |
[out] | pRotate | Rotation value for the given page. It must be one of the PDRotate values. |
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDPageGetUserUnitSize | ( | PDPage | page, |
float * | pUnitSize ) |
Returns the UserUnit value for the page. If the key is not present in the page dictionary the default of 1.0
is returned.
page | The page whose UserUnit value is being obtained. |
pUnitSize | The value of UserUnit from the page dictionary, or a default value of 1.0 if not present. |