3#ifndef PDFSDK_CORE_DOCUMENT_H_INCLUDED_
4#define PDFSDK_CORE_DOCUMENT_H_INCLUDED_
13#include <pdfsdk/core/pdfa_flavor.h>
36typedef struct PDPageRec_* PDPage;
38#define kPDPageIndexNull ((size_t)(-1))
50typedef void(PDFSDK_CALLCONV* PDDocPagesChangedProc)(
PDPageOperation operation,
const PDPageRange* pageRange,
void* clientData);
84typedef PDErrCode (PDFSDK_CALLCONV* PDDocAuthFreeDataProc)(
void* authProcData);
88 PDDocAuthFreeDataProc free;
91typedef PDErrCode (PDFSDK_CALLCONV* PDDocStreamReadAtProc)(
void* streamData, uint64_t pos,
void* buffer,
size_t nbytes,
size_t* pRead);
92typedef PDErrCode (PDFSDK_CALLCONV* PDDocStreamGetSizeProc)(
void* streamData, uint64_t* pSize);
93typedef PDErrCode (PDFSDK_CALLCONV* PDDocStreamFreeDataProc)(
void* streamData);
96 PDDocStreamReadAtProc readAt;
97 PDDocStreamGetSizeProc getSize;
98 PDDocStreamFreeDataProc free;
103 const wchar_t* filePath;
132typedef uint32_t PDDocSaveFlags;
152typedef uint32_t PDOptSaveFlags;
167 PDOptSaveFlags flags;
210PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocCreate(PDDoc* pDoc);
212PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocIsCompressed(PDDoc doc,
bool* pValue);
213PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocIsModified(PDDoc doc,
bool* pValue);
214PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocSetModified(PDDoc doc,
bool value);
215PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocIsRepaired(PDDoc doc,
bool* pRepaired);
217PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocPurgeCaches(PDDoc doc);
218PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocGetFilePath(PDDoc doc,
wchar_t* buffer,
size_t bufSize,
size_t* pSize);
219PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocGetPage(PDDoc doc,
size_t index, PDPage* pPage);
220PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocGetNumPages(PDDoc doc,
size_t* pNumPages);
221PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocAttachPagesChangedCallback(PDDoc doc, PDDocPagesChangedProc proc,
void* clientData);
222PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocDetachPagesChangedCallback(PDDoc doc, PDDocPagesChangedProc proc,
void* clientData);
224PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocCreatePage(PDDoc doc,
size_t insertAt,
const PDRectF* mediaBox, PDPage* pPage);
225PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocCreatePages(PDDoc doc,
size_t insertAt,
size_t count,
const PDRectF* mediaBox);
227PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocInsertPages(PDDoc doc,
size_t insertAt, PDDoc sourceDoc,
const PDPageRange* sourceRange,
const PDProgressMonitor* progress,
void* progressData);
228PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocInsertPage(PDDoc doc, PDPage page,
size_t insertAt);
230PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocFindPageIndexForLabel(PDDoc doc,
const wchar_t* label,
size_t labelSize,
size_t* pIndex);
231PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocGetLabelForPageIndex(PDDoc doc,
size_t index,
wchar_t* buffer,
size_t bufferSize,
size_t* pSize);
232PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocGetID(PDDoc doc,
const char** pPermaID,
size_t* pPermaLen,
const char** pInstanceID,
size_t* pInstanceLen);
233PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocGetVersion(PDDoc doc,
PDVersion* pVersion);
234PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocGetFileSize(PDDoc doc, uint64_t* pFileSize);
320PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocGetCreationDate(PDDoc doc,
PDDateTime* creationDate);
321PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocSetCreationDate(PDDoc doc,
const PDDateTime* creationDate);
324PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocSetModDate(PDDoc doc,
const PDDateTime* modDate);
326PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocSetPageLayout(PDDoc doc, PDAtom layout);
337PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocSetPageMode(PDDoc doc, PDAtom mode);
367PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDPageGetDoc(PDPage page, PDDoc* pDoc);
368PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDPageGetIndex(PDPage page,
size_t* pIndex);
369PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDPageIsContentModified(PDPage page,
bool* pValue);
370PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDPageSetContentModified(PDPage page,
bool value);
383PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDPageSetMediaBox(PDPage page,
const PDRectF* mediaBox);
398PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDPageSetCropBox(PDPage page,
const PDRectF* cropBox);
412PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDPageSetTrimBox(PDPage page,
const PDRectF* trimBox);
413PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDPageGetTrimBox(PDPage page,
PDRectF* pTrimBox);
414PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDPageSetArtBox(PDPage page,
const PDRectF* artBox);
415PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDPageGetArtBox(PDPage page,
PDRectF* pArtBox);
416PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDPageSetBleedBox(PDPage page,
const PDRectF* bleedBox);
417PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDPageGetBleedBox(PDPage page,
PDRectF* pBleedBox);
418PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDPageSetRotate(PDPage page,
PDRotate rotate);
427PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDPageSetUserUnitSize(PDPage page,
float unitSize);
437PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDPageGetPDObject(PDPage page,
PDObject* pObj);
PDPageOperation
Specifies a page operation.
Definition document.h:28
@ kPDRotatePages
Definition document.h:32
@ kPDMovePages
Definition document.h:31
@ kPDDeletePages
Definition document.h:30
@ kPDInsertPages
Definition document.h:29
@ kPDResizePages
Definition document.h:33
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocGetPDFAFlavor(PDDoc doc, PDFAFlavor *pFlavor)
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:157
@ kPDOptSaveImageQualityLow
Definition document.h:159
@ kPDOptSaveImageQualityMedium
Definition document.h:160
@ kPDOptSaveImageQualityHigh
Definition document.h:161
@ kPDOptSaveImageQualityMin
Definition document.h:158
@ kPDOptSaveImageQualityMax
Definition document.h:162
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocGetXmpMetadata(PDDoc doc, char *buffer, size_t bufSize, size_t *pSize)
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:204
@ kPDPageDirectionL2R
Definition document.h:205
@ kPDPageDirectionR2L
Definition document.h:206
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)
@ kPDOptSaveDownsampleImages
Definition document.h:140
@ kPDOptSaveRemoveInfo
Definition document.h:150
@ kPDOptSaveRemoveBookmarks
Definition document.h:144
@ kPDOptSaveRemoveAcroform
Definition document.h:145
@ kPDOptSaveRemoveAttachments
Definition document.h:143
@ kPDOptSaveRemoveOpenActions
Definition document.h:148
@ kPDOptSaveRemoveOCProperties
Definition document.h:146
@ kPDOptSaveRemoveStructTree
Definition document.h:142
@ kPDOptSaveRemoveMetadata
Definition document.h:141
@ kPDOptSaveRemoveAnnotations
Definition document.h:147
@ kPDOptSaveRemoveHiddenObjects
Definition document.h:138
@ kPDOptSaveRemoveJavaScript
Definition document.h:149
PDDocSaveFlagsBits
Specifies methods or optimizations applied during a saving operation.
Definition document.h:113
@ kPDDocSaveXRefCompressed
Definition document.h:128
@ kPDDocSaveFull
Definition document.h:117
@ kPDDocSaveIncremental
Definition document.h:114
@ kPDDocSaveCopy
Definition document.h:119
@ kPDDocSaveLinearized
Definition document.h:122
@ kPDDocSaveCompressed
Definition document.h:124
PDErrCode(PDFSDK_CALLCONV * PDDocAuthProc)(void *authProcData, PDAtom securityHandlerName, void *pAuthData)
Definition document.h:83
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocSetXmpMetadata(PDDoc doc, const char *buffer, size_t bufSize)
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:102
Definition document.h:173
void * progressData
A pointer to pass to progress each time it is called.
Definition document.h:187
PDDocSaveFlags flags
A combination of PDDocSaveFlags.
Definition document.h:175
const PDVersion * version
The version number of the document. Pass null to keep the current version.
Definition document.h:193
const PDProgressMonitor * progress
The progress monitor to receive notifications about the saving process. It may be null.
Definition document.h:184
PDWriteStream outputStream
The stream to write output document to. Used only if filePath is null.
Definition document.h:181
const PDOptSaveSettings * optSettings
The settings to use in "Reduce File Size". Pass null for the regular save.
Definition document.h:190
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:178
Definition document.h:166
Specifies a structure to define a set of pages.
Definition document.h:44
size_t numPages
Definition document.h:47
const size_t * iPages
Definition document.h:45
Definition progress_monitor.h:15
Definition math_types.h:30
PDRotate
Specifies degrees of rotation.
Definition types.h:38