3#ifndef PDFSDK_CORE_DOCUMENT_H_INCLUDED_
4#define PDFSDK_CORE_DOCUMENT_H_INCLUDED_
35typedef struct PDPageRec_* PDPage;
37#define kPDPageIndexNull ((size_t)(-1))
45typedef void(PDFSDK_CALLCONV* PDDocPagesChangedProc)(
PDPageOperation operation,
const PDPageRange* pageRange,
void* clientData);
79typedef PDErrCode (PDFSDK_CALLCONV* PDDocAuthFreeDataProc)(
void* authProcData);
83 PDDocAuthFreeDataProc free;
86typedef PDErrCode (PDFSDK_CALLCONV* PDDocStreamReadAtProc)(
void* streamData, uint64_t pos,
void* buffer,
size_t nbytes,
size_t* pRead);
87typedef PDErrCode (PDFSDK_CALLCONV* PDDocStreamGetSizeProc)(
void* streamData, uint64_t* pSize);
88typedef PDErrCode (PDFSDK_CALLCONV* PDDocStreamFreeDataProc)(
void* streamData);
91 PDDocStreamReadAtProc readAt;
92 PDDocStreamGetSizeProc getSize;
93 PDDocStreamFreeDataProc free;
98 const wchar_t* filePath;
127typedef uint32_t PDDocSaveFlags;
147typedef uint32_t PDOptSaveFlags;
162 PDOptSaveFlags flags;
205PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocCreate(PDDoc* pDoc);
207PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocIsCompressed(PDDoc doc,
bool* pValue);
208PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocIsModified(PDDoc doc,
bool* pValue);
209PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocSetModified(PDDoc doc,
bool value);
211PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocPurgeCaches(PDDoc doc);
212PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocGetFilePath(PDDoc doc,
wchar_t* buffer,
size_t bufSize,
size_t* pSize);
213PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocGetPage(PDDoc doc,
size_t index, PDPage* pPage);
214PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocGetNumPages(PDDoc doc,
size_t* pNumPages);
215PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocAttachPagesChangedCallback(PDDoc doc, PDDocPagesChangedProc proc,
void* clientData);
216PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocDetachPagesChangedCallback(PDDoc doc, PDDocPagesChangedProc proc,
void* clientData);
218PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocCreatePage(PDDoc doc,
size_t insertAt,
const PDRectF* mediaBox, PDPage* pPage);
219PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocCreatePages(PDDoc doc,
size_t insertAt,
size_t count,
const PDRectF* mediaBox);
221PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocInsertPages(PDDoc doc,
size_t insertAt, PDDoc sourceDoc,
const PDPageRange* sourceRange,
const PDProgressMonitor* progress,
void* progressData);
222PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocInsertPage(PDDoc doc, PDPage page,
size_t insertAt);
224PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocFindPageIndexForLabel(PDDoc doc,
const wchar_t* label,
size_t labelSize,
size_t* pIndex);
225PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocGetLabelForPageIndex(PDDoc doc,
size_t index,
wchar_t* buffer,
size_t bufferSize,
size_t* pSize);
226PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocGetID(PDDoc doc,
const char** pPermaID,
size_t* pPermaLen,
const char** pInstanceID,
size_t* pInstanceLen);
227PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocGetVersion(PDDoc doc,
PDVersion* pVersion);
228PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocGetFileSize(PDDoc doc, uint64_t* pFileSize);
267PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocGetCreationDate(PDDoc doc,
PDDateTime* creationDate);
268PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocSetCreationDate(PDDoc doc,
const PDDateTime* creationDate);
270PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocSetModDate(PDDoc doc,
const PDDateTime* modDate);
271PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocSetPageLayout(PDDoc doc, PDAtom layout);
282PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocSetPageMode(PDDoc doc, PDAtom mode);
312PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDStructTreeRoleMapGetTag(PDDoc doc, PDAtom tag, PDAtom* pValue);
313PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDStructTreeFindStructParent(PDDoc doc,
int structParent,
int MCID,
PDObject* pObj);
315PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDPageGetDoc(PDPage page, PDDoc* pDoc);
316PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDPageGetIndex(PDPage page,
size_t* pIndex);
317PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDPageIsContentModified(PDPage page,
bool* pValue);
318PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDPageSetContentModified(PDPage page,
bool value);
331PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDPageSetMediaBox(PDPage page,
const PDRectF* mediaBox);
346PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDPageSetCropBox(PDPage page,
const PDRectF* cropBox);
360PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDPageSetTrimBox(PDPage page,
const PDRectF* trimBox);
361PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDPageGetTrimBox(PDPage page,
PDRectF* pTrimBox);
362PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDPageSetArtBox(PDPage page,
const PDRectF* artBox);
363PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDPageGetArtBox(PDPage page,
PDRectF* pArtBox);
364PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDPageSetBleedBox(PDPage page,
const PDRectF* bleedBox);
365PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDPageGetBleedBox(PDPage page,
PDRectF* pBleedBox);
366PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDPageSetRotate(PDPage page,
PDRotate rotate);
375PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDPageSetUserUnitSize(PDPage page,
float unitSize);
385PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDPageGetPDObject(PDPage page,
PDObject* pObj);
PDPageOperation
Specifies a page operation.
Definition document.h:27
@ kPDRotatePages
Definition document.h:31
@ kPDMovePages
Definition document.h:30
@ kPDDeletePages
Definition document.h:29
@ kPDInsertPages
Definition document.h:28
@ kPDResizePages
Definition document.h:32
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocGetPageMode(PDDoc doc, PDAtom *pMode)
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDPageGetMediaBox(PDPage page, PDRectF *pMediaBox)
PDOptSaveImageQuality
Specifies image quality before a save operation.
Definition document.h:152
@ kPDOptSaveImageQualityLow
Definition document.h:154
@ kPDOptSaveImageQualityMedium
Definition document.h:155
@ kPDOptSaveImageQualityHigh
Definition document.h:156
@ kPDOptSaveImageQualityMin
Definition document.h:153
@ kPDOptSaveImageQualityMax
Definition document.h:157
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDPageFlushModifiedContent(PDPage page)
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocSetInfoString(PDDoc doc, PDAtom infoStringAtom, const wchar_t *buffer, size_t bufferSize)
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDPageGetCropBox(PDPage page, PDRectF *pCropBox)
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDPageGetRotate(PDPage page, PDRotate *pRotate)
PDPageDirection
Specifies the logical content order of text.
Definition document.h:199
@ kPDPageDirectionL2R
Definition document.h:200
@ kPDPageDirectionR2L
Definition document.h:201
@ kPDOptSaveDownsampleImages
Definition document.h:135
@ kPDOptSaveRemoveInfo
Definition document.h:145
@ kPDOptSaveRemoveBookmarks
Definition document.h:139
@ kPDOptSaveRemoveAcroform
Definition document.h:140
@ kPDOptSaveRemoveAttachments
Definition document.h:138
@ kPDOptSaveRemoveOpenActions
Definition document.h:143
@ kPDOptSaveRemoveOCProperties
Definition document.h:141
@ kPDOptSaveRemoveStructTree
Definition document.h:137
@ kPDOptSaveRemoveMetadata
Definition document.h:136
@ kPDOptSaveRemoveAnnotations
Definition document.h:142
@ kPDOptSaveRemoveHiddenObjects
Definition document.h:133
@ kPDOptSaveRemoveJavaScript
Definition document.h:144
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 PDPageGetUserUnitSize(PDPage page, float *pUnitSize)
PDDocSaveFlagsBits
Specifies methods or optimizations applied during a saving operation.
Definition document.h:108
@ kPDDocSaveXRefCompressed
Definition document.h:123
@ kPDDocSaveFull
Definition document.h:112
@ kPDDocSaveIncremental
Definition document.h:109
@ kPDDocSaveCopy
Definition document.h:114
@ kPDDocSaveLinearized
Definition document.h:117
@ kPDDocSaveCompressed
Definition document.h:119
PDErrCode(PDFSDK_CALLCONV * PDDocAuthProc)(void *authProcData, PDAtom securityHandlerName, void *pAuthData)
Definition document.h:78
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocGetPageLayout(PDDoc doc, PDAtom *pLayout)
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocGetPageDirection(PDDoc doc, PDPageDirection *pDirection)
int32_t PDErrCode
Definition errors.h:44
Definition document.h:168
void * progressData
A pointer to pass to progress each time it is called.
Definition document.h:182
PDDocSaveFlags flags
A combination of PDDocSaveFlags.
Definition document.h:170
const PDVersion * version
The version number of the document. Pass null to keep the current version.
Definition document.h:188
const PDProgressMonitor * progress
The progress monitor to receive notifications about the saving process. It may be null.
Definition document.h:179
PDWriteStream outputStream
The stream to write output document to. Used only if filePath is null.
Definition document.h:176
const PDOptSaveSettings * optSettings
The settings to use in "Reduce File Size". Pass null for the regular save.
Definition document.h:185
const wchar_t * filePath
The path to which the document is saved. If both this and outputStream are null, the current document...
Definition document.h:173
Definition document.h:161
Definition progress_monitor.h:15
Definition math_types.h:30
PDRotate
Specifies degrees of rotation.
Definition types.h:38