-1
The request was denied. #define PDPermReqDenied
(
PDPermReqStatus
)
(
-
1
)
0
The request was granted. #define PDPermReqGranted
(
PDPermReqStatus
)
(
0
)
3
The operation is not applicable for the specified object. #define PDPermReqOperationNA
#define PDPermReqPending
(
PDPermReqStatus
)
(
4
)
1
The object is unknown. #define PDPermReqUnknownObject
(
PDPermReqStatus
)
(
1
)
2
The operation is unknown. #define PDPermReqUnknownOperation
(
PDPermReqStatus
)
(
2
)
#define PDPermReqVersion
0x0004
#define STDSEC_CryptRevision1
1
#define STDSEC_CryptRevision2
2
#define STDSEC_CryptRevision3
3
#define STDSEC_CryptRevision4
4
#define STDSEC_CryptRevision5
5
#define STDSEC_CryptRevision6
6
#define STDSEC_CryptVersionV1
1
#define STDSEC_CryptVersionV2
2
#define STDSEC_CryptVersionV3
3
#define STDSEC_CryptVersionV4
4
#define STDSEC_CryptVersionV5
5
#define STDSEC_KEYLENGTH_AES128
16
#define STDSEC_KEYLENGTH_AES256
32
#define STDSEC_KEYLENGTH_RC4_V1
5
#define STDSEC_KEYLENGTH_RC4_V2
16
#define STDSEC_METHOD_AES_V1
5
#define STDSEC_METHOD_AES_V2
6
#define STDSEC_METHOD_AES_V3
7
#define STDSEC_METHOD_RC4_V2
2
Allows the AcroForm client to request that all the AcroForm data be read ahead, before the viewer needs it. This flag is ignored if the PDF file does not contain a Forms hint table. See the description of the Forms Hint Table in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, Annex F, section F.4.5, on page 693.
You can find this document on the web store of the International Standards Organization (ISO).
#define kPDDocReadAheadAcroForms
0x0001
#define kPDDocReadAheadPageLabels
0x0004
#define kPDDocReadAheadRenditions
0x0010
#define kPDDocReadAheadStructure
0x0008
#define kPDDocReadAheadTemplates
0x0002
#define pdInfoCanCopy
pdPermCopy
#define pdInfoCanEdit
pdPermEdit
#define pdInfoCanEditNotes
pdPermEditNotes
#define pdInfoCanPrint
pdPermPrint
#define pdInfoHasOwnerPW
pdPermSecure
#define pdInfoHasUserPW
pdPermOpen
#define pdOpAddResource
pdOpAddResources
#define pdOpRemoveResource
pdOpRemoveResources
#define pdPermAll
0xFFFFFFFF
#define pdPermCopy
0x10
#define pdPermEdit
0x08
#define pdPermEditNotes
0x20
#define pdPermExt
0x80
#define pdPermOpen
0x01
#define pdPermOwner
0x8000
#define pdPermPrint
0x04
Note: This cannot be set by clients.
#define pdPermSaveAs
0x40
#define pdPermSecure
0x02
#define pdPermSettable
(
pdPermPrint
+
pdPermEdit
+
pdPermCopy
+
pdPermEditNotes
)
#define pdPermUser
(
pdPermAll
-
pdPermOpen
-
pdPermSecure
)
#define pdPrivPermAccessible
0x200
#define pdPrivPermDocAssembly
0x400
#define pdPrivPermFillandSign
0x100
#define pdPrivPermFormSpawnTempl
0x20000
#define pdPrivPermFormSubmit
0x10000
#define pdPrivPermHighPrint
0x800
PDDocOCWillChange()
and PDDocOCDidChange()
notifications. These notifications typically pass in the affected page, or PDAllPages
if all pages may be affected. kPDOCGCreate | Optional Content Groups (OCGs) created.
|
kPDOCGProperties | OCG properties changed.
|
kPDOCGReplace | An OCG was replaced by another.
|
kPDOCGDestroy | An OCG was destroyed.
|
kPDOCMDAttach | Content was made optional.
|
kPDOCMDRemove | Content was made optional.
|
kPDOCConfigCreate | An OC config was created.
|
kPDOCConfigChange | An OC config was changed.
|
kPDOCConfigDestroy | An OC config was destroyed.
|
kPDDocRemoveOC | OC was removed from document.
|
kPDOC_LastDocChangeType = kPDDocRemoveOC |
PDDocNeedsSave = 0x0001 | The document has been modified and needs to be saved. (get/set)
|
PDDocRequiresFullSave = 0x0002 | The document cannot be saved incrementally; when it is saved using PDDocSave(), the
PDSaveFull flag must be specified (see PDSaveFlags). (get/set) |
PDDocIsModified = 0x0004 | The document has been modified slightly (for example, bookmarks or text annotations have been opened or closed), but not in a way that warrants saving. (get only)
|
PDDocDeleteOnClose = 0x0008 | The document is based on a temporary file that must be deleted when the document is closed or saved. (get/set)
|
PDDocWasRepaired = 0x0010 | The document was repaired when it was opened. (get only)
|
PDDocNewMajorVersion = 0x0020 | The document's major version is newer than current. (get only)
|
PDDocNewMinorVersion = 0x0040 | The document's minor version is newer than current. (get only)
|
PDDocOldVersion = 0x0080 | The document's version is older than current. (get only)
|
PDDocSuppressErrors = 0x0100 | Do not display errors. (get/set)
|
PDDocIsEmbedded = 0x0200 | The document is embedded in a compound document (OLE, OpenDoc). (get/set)
|
PDDocIsLinearized = 0x0400 | The document is linearized (optimized) for page-served remote (network) access. (get only)
|
PDDocIsOptimized = 0x0800 | The document is optimized. If this flag is cleared, the Batch Optimizer plug-in and the Adobe PDF Library do not save the file optimized. You can, therefore, linearize a PDF file without optimizing it. Optimizing without linearizing is not allowed, however. (set only)
|
PDDocIsPXDF = 0x1000 | The underlying file is PxDF (get/set).
|
PDDocIsOpen = 0x2000 | The document is fully opened (didOpen). (get only)
|
Value options for PDDocRequestReason.
kPDDocRequestUnderway = 0 | The request is still being processed.
|
kPDDocRequestComplete | The requested data has arrived.
|
kPDDocRequestCancelled | The request is cancelled because the file is being closed.
|
kPDDocRequestError | An error occurred.
|
saveFlags
parameter. All undefined flags should be set to zero.
Value options for PDSaveFlags.
PDSaveIncremental = 0x00 | Save only those portions of the document that have changed. This is provided only as the opposite of
PDSaveFull , since there is no bit value of 0 . |
PDSaveFull = 0x01 | Save the entire document. Plug-ins that set
PDSaveFull are also encouraged to set PDSaveCollectGarbage . |
PDSaveCopy = 0x02 | Save a copy of the document (the PDDoc continues to use the old file). This flag is ignored if
PDSaveFull is off. |
PDSaveLinearized = 0x04 | Write the PDF file in a format that is optimized for page-served remote (network) access ( linearized). This flag is ignored if Linearizing a file used to cause Cos objects to be invalidated, which required that some plug-ins use notifications to release and re-acquire objects. But Cos objects are no longer invalidated after a linearized save. |
PDSaveWithPSHeader = 0x08 | (Obsolete. In effect, it is always off). Write a PostScript header as part of the saved file.
|
PDSaveBinaryOK = 0x10 | (Obsolete. In effect, it is always on). It is okay to store binary data in the PDF file.
|
PDSaveCollectGarbage = 0x20 | Remove unreferenced objects, often reducing file size. Plug-ins are encouraged to use this flag. This flag is ignored if
PDSaveFull is off. |
PDSaveForceIncremental = 0x40 | Perform an incremental save even if the save is to a different file or the document's version number has changed.
|
PDSaveKeepModDate = 0x80 | Do not update ModDate in InfoDict.
|
PDSaveLeaveOpen = 0x100 | Leave the file open after the save (do not Close the file)
|
PDSaveLinearizedNoOptimizeFonts = 0x200 | Save the document as Linearized the same as PDSaveLinearized but inherently PDSaveOptimizeFonts is disabled. For documents with a large number of fonts, font optimization can have poor performance and is often uncessary.
|
saveFlags
parameter ( PDSaveFlags2
). All undefined flags should be set to zero. The first three flags, PDSaveUncompressed
, PDSaveCompressed
, and PDSaveCompressStructureOnly
, are mutually exclusive; they can all be off, but at most one can be on. PDSaveUncompressed = 1 << 0 | Do not use object streams when saving the document ( decompress all objects). The result is compatible with all versions of PDF and Acrobat. This flag is ignored if
PDSaveFull is off. |
PDSaveCompressed = 1 << 1 | Compress objects, without restrictions about which objects to compress. This flag is ignored if
PDSaveFull is off. |
PDSaveCompressStructureOnly = 1 << 2 | Compress only those objects that are related to logical structure (for example, tagged PDF). The result is compatible with any version of PDF or Acrobat, but the compressed objects are not usable. This flag is ignored if
PDSaveFull is off. |
PDSaveRemoveASCIIFilters = 1 << 3 | Remove ASCII85 filters from all streams. This flag is ignored if
PDSaveFull is off. |
PDSaveAddFlate = 1 << 4 | Encode any unencoded stream with Flate, except for metadata streams, which are never encoded, and for streams that would be larger if encoded. This flag is ignored if
PDSaveFull is off. |
PDSaveReplaceLZW = 1 << 5 | Replace all LZW filters with FlateEncode filters. This flag is ignored if
PDSaveFull is off. |
PDSaveOptimizeXObjects = 1 << 6 | Merge identical forms and images, as determined by an MD5 hash of their contents (it causes OptimizeXObjects() to be called).
|
PDSaveOptimizeContentStreams = 1 << 7 | Look for common initial sub-sequences among content streams (the sequences of marking operators), and generate substreams that can be shared (it causes OptimizeGraphics() to be called).
|
PDSaveOptimizeFonts = 1 << 8 | Merge identical font descriptors and encodings. Does not merge the top-level font dictionary (it causes OptimizeFonts() to be called).
|
PDSaveOptimizeMarkedJBIG2Dictionaries = 1 << 9 | Delete symbols specific to deleted images from JBIG2 dictionaries that could not be processed at the time of image deletion. It is currently only effective after deleting pages or extracting pages (it causes OptimizeMarkedJBIG2Dictionaries() to be called).
|
PDSaveEnsure7bitASCII = 1 << 10 | (Obsolete. In effect, it is always off).
|
PDSaveAutoSave = 1 << 11 | The
PDSaveAutoSave flag is used to indicate that the save that occurred is an auto-save event. It is only set when an auto-save occurs. It is a read-only flag. |
PDSaveOverrideCollections = 1 << 12 | The
PDSaveOverrideCollections flag controls whether CosObjCollection objects set up prior to saving are honored when doing a non-linearized save. Linearized save always uses its own rules for assigning objects to collections and object streams, so this flag is only used when the PDSaveLinearized flag is off. Furthermore, it is only used if either the PDSaveCompressed or PDSaveCompressStructureOnly flags is set. If this flag is set, the PDDocSave will remove all CosObj objects from their CosObjCollection objects and reassign objects to CosObjCollection objects (and object streams) using its own partitioning algorithms. If the flag is not set, the partitioning algorithms will preserve CosObj objects' existing membership in collections. |
PDDoNotSaveFileAttributes = 1 << 13 | Do not save the new file output with the file attributes of the original
|
PDSaveOriginalMetaData = 1 << 14 | Save the new file Metadata stream with the Metadata stream of the original
|
PDSaveOptimizeObjects = 1 << 15 | Merge identical objects, as determined by an MD5 hash of their contents.
|
avpPageViewLayoutMode
preference (set by AVAppSetPreference()) or in a view of a document by the pageViewLayoutMode
field in AVDocViewDef (set by AVDocGetViewDef()).
Value options for PDLayoutMode.
PDLayoutDontCare | (Default) Use the user preference when opening the file, as specified in the
avpPageViewLayoutMode preference, set by AVAppSetPreference(). |
PDLayoutSinglePage | Use single-page mode.
|
PDLayoutOneColumn | Use one-column continuous mode.
|
PDLayoutTwoColumnLeft | Use two-column continuous mode with the first page on the left.
|
PDLayoutTwoColumnRight | Use two-column continuous mode with the first page on the right.
|
PDLayoutTwoPageLeft | |
PDLayoutTwoPageRight |
Did
notifications have corresponding Will
notifications.
Value options for PDOperation.
pdOpInsertPages | Page insertion.
|
pdOpDeletePages | Page deletion.
|
pdOpReplacePages | Page replacement.
|
pdOpMovePages | Page rearrangment.
|
pdOpRotatePages | Page rotation.
|
pdOpCropPages | Page cropping.
|
pdOpAddResources | Only PDDocDidChangePages() exists, not PDDocWillChangePages().
|
pdOpRemoveResources | Only PDDocDidChangePages() exists, not PDDocWillChangePages().
|
pdOpAddContents | Only PDDocDidChangePages() exists, not PDDocWillChangePages().
|
pdOpRemoveContents | Only PDDocDidChangePages() exists, not PDDocWillChangePages().
|
pdOpSetMediaBox | Page media box modification.
|
pdOpSetBleedBox | Page bleed box modification.
|
pdOpSetTrimBox | Page trim box modification.
|
pdOpSetArtBox | Page art box modification.
|
pdOpSetTabOrder | Page tab order modification.
|
PDPermReqOprAll
PDPermReqOprModify
(Doc Info, open action, page label, modifying document)PDPermReqOprCopy
(Copy to clipboard)PDPermReqOprAccessible
PDPermReqOprSelect
(Selection only)PDPermReqOprOpen
PDPermReqOprSecure
PDPermReqOprPrintHigh
PDPermReqOprPrintLow
PDPermReqOprFullSave
PDPermReqOprImport
(Non-PDF)PDPermReqOprExport
(Non-PDF and text extraction API, Search & Catalog)PDPermReqOprAny
PDPermReqObjDoc = 1 | |
PDPermReqObjPage | |
PDPermReqObjLink | |
PDPermReqObjBookmark | |
PDPermReqObjThumbnail | |
PDPermReqObjAnnot | |
PDPermReqObjForm | Form fields other than signature form fields.
|
PDPermReqObjSignature | Signature form fields.
|
PDPermReqObjEF | Named embedded files.
|
PDPermReqObjReaderAnnot | Annots: Few Annots will be available in Reader.Refer PDPermGetReqObjFromAnnotType
|
PDPermReqObjLast | Used for checking cache size.
|
Value options for PDPermReqOpr.
PDPermReqOprAll = 1 | Check all operations.
|
PDPermReqOprCreate | Generic.
|
PDPermReqOprDelete | Delete.
|
PDPermReqOprModify | Modify.
|
PDPermReqOprCopy | Copy.
|
PDPermReqOprAccessible | For accessibility use.
|
PDPermReqOprSelect | For document or page, selecting (not copying) text or graphics.
|
PDPermReqOprOpen | For document open.
|
PDPermReqOprSecure | For the document: changing security settings.
|
PDPermReqOprPrintHigh | For the document: regular printing.
|
PDPermReqOprPrintLow | For the document: low quality printing.
|
PDPermReqOprFillIn | Form fill-in, or sign the existing field.
|
PDPermReqOprRotate | Rotate.
|
PDPermReqOprCrop | Crop.
|
PDPermReqOprSummarize | For summarizing notes.
|
PDPermReqOprInsert | Insert.
|
PDPermReqOprReplace | For the page.
|
PDPermReqOprReorder | For the page.
|
PDPermReqOprFullSave | For the document.
|
PDPermReqOprImport | For the notes and image.
|
PDPermReqOprExport | For the notes. ExportPS should check print.
|
PDPermReqOprAny | Used for checking to see if any operation is allowed.
|
PDPermReqOprUnknownOpr | Used for error checking.
|
PDPermReqOprSubmitStandalone | Submit forms outside of the browser.
|
PDPermReqOprSpawnTemplate | Allow the form to spawn template pages.
|
PDPermReqOprOnline | For annotations and forms: enabling online functionality.
|
PDPermReqOprSummaryView | For annotations: enabling a summary view of annotations in Adobe Reader.
|
PDPermReqOprBarcodePlaintext | For forms: enables form appearance to be rendered as a plain text barcode.
|
PDPermReqOprUIsave | For controlling the "save" UI from a UIPerms handler
|
PDPermReqOprUIprint | For controlling the "print" UI from a UIPerms handler
|
PDPermReqOprUIemail | For controlling the "email" UI from a UIPerms handler
|
PDPermReqOprLast | This should be always the last item
|
PDVertAlign.
kPDVertTop = 0 | |
kPDVertCenter | |
kPDVertBottom |
Value options for PDWatermarkDrawOption.
kPDWatermarkTryAnnotation | |
kPDWatermarkTryFormXObject | |
kPDWatermarkAnnotation | Draw watermark as an Annotation, even if the option zOrderTop is false.
|
kPDWatermarkFormXObject | Draw watermark as a Form XObject, even if fixedPrint is true.
|
The underlying PDF representation of a document. There is a correspondence between a PDDoc and an ASFile; the PDDoc object is the hidden object behind every AVDoc. An ASFile may have zero or more underlying files, so a PDF file does not always correspond to a single disk file. For example, an ASFile may provide access to PDF data in a database.
Through PDDoc objects, your application can perform most of the menu items for pages from Acrobat (delete, replace, and so on). Thumbnails can be created and deleted through this object. You can set and retrieve document information fields through this object as well. The first page in a PDDoc is page 0
.
typedef
struct
_t_PDDoc
*
PDDoc
;
signed
int
(which is never negative), for historical reasons. typedef
ASInt32
PDDocFlags
;
typedef
struct
_t_PDDocInsertPagesParams
*
PDDocInsertPagesParams
;
PDDocOCWillChange()
and PDDocOCDidChange()
notifications. These notifications typically pass in the affected page, or PDAllPages
if all pages may be affected.
For value options see PDDocOCChangeTypes.
typedef
ASUns8
PDDocOCChangeType
;
typedef
struct
_t_PDDocOpenParams
*
PDDocOpenParams
;
For value options see PDDocRequestReasons.
typedef
ASEnum8
PDDocRequestReason
;
typedef
struct
_t_PDDocSaveParams
*
PDDocSaveParams
;
signed
int
(which is never negative), for historical reasons. typedef
ASInt16
PDDocVersion
;
avpPageViewLayoutMode
preference (set by AVAppSetPreference()) or in a view of a document by the pageViewLayoutMode
field in AVDocViewDef (set by AVDocGetViewDef()).
For value options see PDLayoutModes.
typedef
ASEnum8
PDLayoutMode
;
PDPermReqOprAll
PDPermReqOprModify
(Doc Info, open action, page label, modifying document)PDPermReqOprCopy
(Copy to clipboard)PDPermReqOprAccessible
PDPermReqOprSelect
(Selection only)PDPermReqOprOpen
PDPermReqOprSecure
PDPermReqOprPrintHigh
PDPermReqOprPrintLow
PDPermReqOprFullSave
PDPermReqOprImport
(Non-PDF)PDPermReqOprExport
(Non-PDF and text extraction API, Search & Catalog)PDPermReqOprAny
typedef
ASUns32
PDPermReqObj
;
For value options see PDPermReqOprOptions.
typedef
ASUns32
PDPermReqOpr
;
typedef
ASInt16
PDPermReqStatus
;
typedef
ASUns32
PDPerms
;
For value options see PDPrintWhat_Options.
typedef
ASEnum8
PDPrintWhat
;
saveFlags
parameter. All undefined flags should be set to zero.
For value options see PDDocSaveFlags.
typedef
ASEnum16
PDSaveFlags
;
saveFlags2
bitfield of the PDDocSaveParams structure passed to PDDocSaveWithParams(). These flags are an extension to those defined by the PDSaveFlags enumeration, which are stored in the saveFlags
bitfield of the PDDocSaveParams structure. typedef
ASFlagBits
PDSaveFlags2
;
typedef
ASUns16
PDSmallFlagBits
;
PDVertAlignments.
typedef
ASEnum8
PDVertAlign
;
For value options see PDWatermarkOptions.
typedef
ASEnum8
PDWatermarkDrawOption
;
typedef
char
StdPassword
[
MAX_PWCHARS
+
1
]
;
ASBool
PDAuthProc(
PDDoc
pdDoc
);
ASBool
PDAuthProcEx(
PDDoc
pdDoc
,
void
*
clientData
);
ASBool
PDDocEnumProc(
PDDoc
pdDoc
,
void
*
clientData
);
pdDoc | IN/OUT The PDDoc currently being enumerated.
|
clientData | IN/OUT User-supplied data that was passed in the call to PDEnumDocs().
|
void
PDDocPreSaveProc(
PDDoc
pdDoc
,
PDDocPreSaveInfo
preSaveInfo
,
void
*
clientData
);
pdDoc | IN/OUT The PDDoc to be saved.
|
preSaveInfo | IN/OUT A PDDocPreSaveInfo structure containing information to use during processing before the save.
|
clientData | IN/OUT User-supplied data that was specified in
preSaveProcClientData of the PDDocSaveParams structure. |
void
PDDocPreWriteProc(
PDDoc
pdDoc
,
void
*
clientData
);
pdDoc | The PDDoc to be saved.
|
clientData | User-supplied data that was specified in
preWriteProcClientData of the PDDocSaveParams structure. |
ASInt32
PDDocRequestEntireFileProc(
PDDoc
pdDoc
,
PDDocRequestReason
reason
,
void
*
clientData
);
pdDoc | The PDDoc to be saved.
|
reason |
|
clientData | User-supplied data passed in the PDDocRequestPages() method.
|
0
when successful, a non-zero error code otherwise. ASInt32
PDDocRequestPagesProc(
PDDoc
pdDoc
,
ASInt32
startPage
,
ASInt32
nPages
,
PDDocRequestReason
reason
,
void
*
clientData
);
Note: This is a different callback than PDDocWillExportAnnotProc().
ASBool
PDDocWillExportAnnotCallback(
PDDoc
doc
,
PDPage
pdpage
,
PDAnnot
src
,
CosObj
dict
);
doc | IN/OUT The document from which annotations may be exported.
|
pdpage | IN/OUT The page from which the annotation may be exported.
|
src | IN/OUT The annotation that may be exported.
|
dict | IN/OUT A copy of the annotation in a Cos object.
|
Note: This is a different callback than PDDocWillImportAnnotCallback().
ASBool
PDDocWillExportAnnotProc(
PDAnnotHandler
pdanh
,
PDAnnot
src
,
PDAnnot
dst
);
pdanh | IN/OUT The annotation handler of the annotation type to export.
|
src | IN/OUT The annotation that may be exported.
|
dst | IN/OUT A copy of
src , which is actually exported. |
Note: This is a different callback than PDDocWillImportAnnotProc().
ASBool
PDDocWillImportAnnotCallback(
PDDoc
doc
,
PDPage
pdPage
,
PDAnnot
annot
);
doc | IN/OUT The document into which annotations may be imported.
|
pdPage | IN/OUT The page in which the annotation may be imported.
|
annot | IN/OUT The annotation that may be imported.
|
Note: This is a different callback than PDDocWillImportAnnotCallback().
ASBool
PDDocWillImportAnnotProc(
PDAnnotHandler
pdanh
,
PDDoc
doc
,
PDPage
pdpage
,
PDAnnot
annot
);
pdanh | IN/OUT The annotation handler of the annotation type to import.
|
doc | IN/OUT The document into which annotations may be imported.
|
pdpage | IN/OUT The page in which the annotation may be imported.
|
annot | IN/OUT The annotation that may be imported.
|
| |
The annotation count.
| |
A pointer to an array of PDAnnots.
| |
|
| |
The size of the data structure.
| |
A pointer to a set of redaction annotations representing the redaction marks to be applied. If
NULL , then all redaction marks present in the document should be applied. | |
A boolean value indicating that the redaction marks themselves should be not removed.
| |
A set of callbacks for providing feedback to the caller. It may be
NULL . | |
The amount that the current value for the progress monitor in
statusProcs should be incremented during the application process. If it is less than or equal to 0 , then beginOperation will be called, an unspecified positive duration will be set, the current value will be incremented up to that duration, and endOperation will be called. This value is ignored if statusProcs is NULL . | |
|
| |
The size of the data structure.
| |
The page range of the document to which the watermark should be added.
| |
A boolean specifying whether this watermark is a FixedPrint watermark. FixedPrint watermarks maintain their size and position regardless of the dimensions of the target media.
| |
A boolean specifying whether the watermark should be visible when viewing on screen.
| |
A boolean specifying whether the watermark should be printed.
| |
The horizontal alignment to be used when adding the watermark to a page.
| |
The vertical alignment to be used when adding the watermark to a page.
| |
float horizValue ; | The horizontal offset value to be used when adding the watermark on a page. If
percentageVals is true , this value is a percentage of the page width, with 1.0 meaning 100%. Otherwise this value is in user units. |
float vertValue ; | The vertical offset value to be used when adding the watermark on a page. If
percentageVals is true , this value is a percentage of the page height, with 1.0 meaning 100%. Otherwise this value is in user units. |
float scale ; | The scale factor to be used when adding the watermark, with
1.0 meaning 100%. |
float rotation ; | The counter-clockwise rotation, in degrees, to be used when adding the watermark.
|
float opacity ; | The opacity to be used when adding the watermark, with
0.0 meaning fully transparent and 1.0 meaning fully opaque. |
The progress monitor to be updated when adding the watermark. It may be
NULL . | |
void * progMonData ; | |
The cancel procedure to be checked when adding the watermark. It may be
NULL . | |
void * cancelProcData ; | |
This option indicates how the watermark should be added; either as an Annotation or as a Form XObject. If zOrderTop is false, watermark must be drawn as form object, if fixedPrint is true, watermark must be drawn as annotation. When both of them are true or both of them are false, the behavior is not well defined. This flag can be introduced to provide desired output, the details are listed as below: kPDWatermarkTryAnnotation-- Attempt to create the watermark as an annotation, however if these conditions (fixedPrint is true, zOrderTop is true) are not met then it will be drawn as a Form XObject. kPDWatermarkTryFormXObject-- Attempt to create the watermark as an Form XObject, however if these conditions (zOrderTop is false, fixedPrint is not true) are not met then it will be drawn as an annotation. kPDWatermarkAnnotation-- Draw watermark as an Annotation, even if the option zOrderTop is false. kPDWatermarkFormXObject-- Draw watermark as a Form XObject, even if fixedPrint is true.
| |
|
| |
The size of the data structure. It must be set to
sizeof(PDDocCopyParamsRec) . | |
The path name to copy to, specified in whatever format is correct for
fileSys . | |
A pointer to an ASFileSysRec containing the file system that does the copy.
| |
A progress monitor. It may be
NULL | |
void * progMonData ; | |
A cancel procedure. It may be
NULL . | |
void * cancelProcData ; | |
Determines whether changes should be saved if the document is dirty. When it is
true , if the document is dirty and the product is Acrobat, save all in-memory changes to the new copy. Otherwise, just copy the on-disk bytes. It is ignored in Adobe Reader. | |
|
| |||||||||
The size of the data structure. It must be set to
sizeof(PDDocInsertPagesParamsRec) . | |||||||||
The document into which pages are inserted. This document must have at least one page.
| |||||||||
The page number in
targetDoc after which pages from srcDoc are inserted. The first page is 0 . If PDBeforeFirstPage (see PDExpT.h) is used, the pages are inserted before the first page in targetDoc . Use PDLastPage to insert pages after the last page in targetDoc . | |||||||||
The document containing the pages that are inserted into
targetDoc . | |||||||||
The page number of the first page in
srcDoc to insert into targetDoc . The first page is 0 . | |||||||||
The page number of the last page in
srcDoc to insert into targetDoc. | |||||||||
Flags that determine what additional information is copied from
srcDoc into targetDoc . It must be an OR of the following:
| |||||||||
An error code which is only valid for the PDDocDidInsertPagesEx() notification.
| |||||||||
|
| |
The size of the data structure. It must be set to
sizeof(PDDocOpenParamsRec) . | |
The path name to the file, specified in whatever format is correct for
fileSys . | |
The path name to the file, specified in whatever format is correct for
fileSys . | |
A pointer to an ASFileSysRec containing the file system in which the file resides.
| |
An authorization callback, called only if the file is encrypted. This callback should obtain whatever information is needed to determine whether the user is authorized to open the file, then call PDDocAuthorize() (which returns the permissions that the authentication data enables). If the file is encrypted and
authProcEx is NULL or returns false , pdErrPassword is raised. The Acrobat viewer's built-in authorization procedure requires the user to enter a password, and allows the user to try three times before giving up. | |
void * authProcClientData ; | A pointer to user-specified data to pass to authProcEx() each time it is called.
|
The permissions to remove from the document.
| |
|
| |
The size of structure. Set it to
sizeof(PDDocPreSaveInfoRec) . | |
|
| |
Set this to be the size of this
struct . | |
It must be one of the PDSaveFlags values.
| |
The path to which the file is saved. A path must be specified when either If | |
The file system. If it is
NULL , it uses the file system of the document's current backing file. | |
Progress monitor. Use AVAppGetDocProgressMonitor() to obtain the default. It may be
NULL . | |
void * monClientData ; | |
A callback to test whether an operation should be cancelled. A
CancelProc is typically passed to some method that takes a long time to complete. At frequent intervals, the method calls the CancelProc . If it returns true , then the method cancels its operation; if false , it continues. | |
void * cancelProcClientData ; | |
A callback to flag Cos objects you wish to access while the PDDoc is being saved.
| |
void * preSaveProcClientData ; | A pointer to user-specified data to pass to
preSaveProc each time it is called. |
A callback to get information about Cos objects while the PDDoc is being saved.
| |
void * offsetProcClientData ; | A pointer to user-specified data to pass to
offsetProc each time it is called. |
The major PDF version number of the document. If
major equals 0 , both major and minor are ignored. Make sure that the document conforms to the version number you are setting. | |
The minor PDF version number of the document.
| |
Specifies the number of bytes of padding to include in the XML packet containing the XMP metadata for the document, when
XMPPacketReadOnly is false (ignored when XMPPacketReadOnly is true ). Non-positive values specify the default padding of 2048 bytes; positive values specify the number of bytes of padding directly. | |
A callback that is called just before the document is written to disk.
| |
void * preWriteProcClientData ; | Client data to pass to the pre-write proc.
|
More flags for PDDocSave().
| |
The number of incremental saves to compact. It will eliminate the last This parameter is taken into account only if:
More precisely, compaction of incremental saves will only happen only if:
Moreover, if there are any signatures added in any of the incremental saves that are compacted, these signatures will be invalidated. It is up to the client to determine the incremental save at which it should stop compacting to avoid this. | |
A 64-bit callback to get information about Cos objects while the PDDoc is being saved.
| |
|
| |
The size of the data structure.
| |
The text to be used when generating a text-based watermark.
| |
The alignment to be used when justifying a text-based watermark.
| |
The name of a system font to be used when generating a text-based watermark. The font will be embedded/subsetted when possible. This parameter is ignored if
pdeFont is non- NULL . | |
float fontSize ; | The size of the font, in points, to be used when generating a text-based watermark.
|
The color to be used when generating a text-based watermark.
| |
|
| |||||||||||
The size of this stucture.
| |||||||||||
true if the user password should be changed. | |||||||||||
true if there is a user password. | |||||||||||
The user password.
| |||||||||||
The owner password.
| |||||||||||
The permissions to allow.
| |||||||||||
The encryption key length in bytes.
| |||||||||||
Indicates a /R value.
| |||||||||||
A flag that indicates whether document metadata will be encrypted.
| |||||||||||
New for Acrobat 7.0. The method of encryption for filters to use. It is only valid if the version is 4 or greater.
The valid values are:
| |||||||||||
A flag to indicate that only attachments are encrypted.
encryptMetadata and encryptAttachmentsOnly cannot both be true . | |||||||||||
Indicates a /V value. New for Acrobat 9.0.
| |||||||||||
|
void
PDDocAcquire(
PDDoc
doc
);
doc | IN/OUT The document whose reference count is incremented.
|
CSmartPDPage
class, as it ensures that the page is released as it goes out of scope. PDPage
PDDocAcquirePage(
PDDoc
doc
,
ASInt32
pageNum
);
doc | The document containing the page to acquire.
|
pageNum | The page number of the page to acquire. The first page is
0 . |
void
PDDocAddJobID(
PDDoc
doc
,
ASInt32
jobId
);
doc | The document whose jobId is being set.
|
jobId | The job Id being added to the document's list of job ids.
|
void
PDDocAddThread(
PDDoc
doc
,
ASInt32
addAfterIndex
,
PDThread
thread
);
doc | IN/OUT The document in which the thread is added. It must match the document used in the call to PDThreadNew() that created the thread.
|
addAfterIndex | IN/OUT The index of the thread after which
thread is added. |
thread | IN/OUT The thread to add.
|
void
PDDocAddWatermarkFromPDPage(
PDDoc
pdDoc
,
PDPage
pdPage
,
PDDocAddWatermarkParamsRec
*
pParams
);
pdDoc | The document onto which the watermark will be added.
|
pdPage | The page to be added as a watermark.
|
pParams | Structure specifying how the watermark should be added to the document.
|
void
PDDocAddWatermarkFromText(
PDDoc
pdDoc
,
PDDocWatermarkTextParamsRec
*
pTextParams
,
PDDocAddWatermarkParamsRec
*
pParams
);
pdDoc | The document onto which the watermark will be added.
|
pTextParams | Structure describing the text-based watermark to be added.
|
pParams | Structure specifying how the watermark should be added to the document.
|
ASBool
PDDocApplyRedactions(
PDDoc
pdDoc
,
PDApplyRedactionParams
applyParams
);
pdDoc | IN/OUT The document to which the redaction marks should be applied.
|
applyParams | IN/OUT A pointer to a
PDApplyRedactionParams specifying which redaction marks to apply and what parameters to use when applying them. If NULL , then all redaction marks present in the document will be applied. |
is raised if any specified redaction marks are invalid
|
Deprecated in Acrobat 7.0. Use PDDocPermRequest() instead.
Adds permissions to the specified document, if permitted. It calls the PDCryptAuthorizeProc() callback of the document's security handler to determine which of the specified permissions will actually be granted. After calling this method, the document's permissions will be the OR
of the previous permissions and the permissions granted by the PDCryptAuthorizeProc() callback.
Use PDDocPermRequest() to determine if a document's permissions allow a particular operation for a particular object.
PDPerms
PDDocAuthorize(
PDDoc
pdDoc
,
PDPerms
permsWanted
,
void
*
authData
);
pdDoc | The document for which new permissions are requested.
|
permsWanted | The new permissions being requested. It must be an
OR of the PDPerms values. |
authData | A pointer to data to pass to the PDCryptAuthorizeProc() callback of the document's security handler. For the Acrobat viewer's built-in security handler,
authData is a char * containing the password. |
OR
of the previous value of the document's permissions field, and the permissions granted by the PDCryptAuthorizeProc() callback of the document's security handler. The result will be an OR
of the PDPerms values. is raised if no security handler is associated with
pdDoc . It also raises whatever exceptions are raised by the security handler's PDCryptAuthorizeProc() callback. |
pdDoc
to all registered handlers. void
PDDocCalculateImplicitMetadata(
IN
PDDoc
pdDoc
);
pdDoc | The document for which implicit metadata is calculated.
|
PDDocClearErrors
was called. void
PDDocClearErrors(
PDDoc
doc
);
doc | The document in which the non-fatal errors have occurred.
|
void
PDDocClearFlags(
PDDoc
doc
,
ASInt32
flags
);
doc | IN/OUT The document whose flags are cleared.
|
flags | IN/OUT The flags to clear. It must be an
OR of the PDDocFlags values. |
Closes a document and releases its resources. If doc
is NULL
, it does nothing. Changes are not saved. You must use PDDocSave() to save any modifications before calling PDDocClose().
If the document has been modified but you wish to mark it as clean, use PDDocClearFlags().
void
PDDocClose(
PDDoc
doc
);
doc | The document to close.
|
is raised if there are any outstanding references to objects in the document, and the document will still be valid (its resources will not be released).
| |
is raised if the document's open count is less than one.
|
void
PDDocCopyToFile(
PDDoc
pdDoc
,
PDDocCopyParams
params
);
pdDoc | The document to copy.
|
params | A structure that defines how the PDF file is copied.
|
is raised if an invalid argument is passed in params.
| |
is raised if the target and source files are the same.
| |
is raised if there is no space for the copy.
| |
is raised if a read error occurred on the source.
| |
is raised if a write error occurred on the destination.
|
Creates a new document. The only Cos object in the document will be a Catalog.
See the description of Document Structure in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.7, page 70.
You can find this document on the web store of the International Standards Organization (ISO).
After the document is created, at least one page must be added using PDDocCreatePage() or PDDocInsertPages() before the Acrobat viewer can display or save the document.
When you are done with the document, you must call PDDocClose() to release the resources used by the PDDoc; do not call PDDocRelease().
PDDoc
PDDocCreate(
void
);
PDNameTree
PDDocCreateNameTree(
PDDoc
thePDDoc
,
ASAtom
theTree
);
thePDDoc | The document in which the name tree is created.
|
theTree | The name of the name tree to create. A string can be converted to an ASAtom using ASAtomFromString().
|
NULL
PDNameTree if pdDoc
has no root dictionary. The return value should be tested with PDNameTreeIsValid(). PDCollection
PDDocCreatePDCollection(
PDDoc
pdDoc
);
pdDoc | The document that will host the new collection.
|
PDPage
PDDocCreatePage(
PDDoc
doc
,
ASInt32
afterPageNum
,
ASFixedRect
mediaBox
);
doc | The document in which the page is created.
|
afterPageNum | The page number after which the new page is inserted. The first page is
0 . Use PDBeforeFirstPage() (see PDExpT.h) to insert the new page at the beginning of a document. |
mediaBox | A rectangle specifying the page's media box, specified in user space coordinates.
|
PDDocApplyRedactions
is called with this mark. PDAnnot
PDDocCreateRedaction(
PDDoc
pdDoc
,
PDRedactParams
redactionProps
);
pdDoc | IN/OUT The document for which the new redaction mark should be created.
|
redactionProps | IN A set of properties to be used for the new redaction mark.
|
is raised if
redactionProps is NULL or if contains an invalid page number or an empty list of quads. |
Note: When this method is used to create a text selection on a rotated page, you must pass in a rotated boundingRect
.
PDTextSelect
PDDocCreateTextSelect(
PDDoc
doc
,
ASInt32
pageNum
,
ASFixedRect
*
boundingRect
);
doc | The document in which a text selection is created.
|
pageNum | The page number on which the text selection is created.
|
boundingRect | A pointer to a rectangle specifying the text selection's bounding rectangle, specified in user space coordinates.
|
Note: When this method is used to create a text selection on a rotated page, you must pass in a rotated boundingRect
.
PDTextSelect
PDDocCreateTextSelectUCS(
PDDoc
doc
,
ASInt32
pageNum
,
ASFixedRect
*
fxBoundingRectP
);
doc | The document in which a text selection is created.
|
pageNum | The page number on which the text selection is created.
|
boundingRect | A pointer to a rectangle specifying the text selection's bounding rectangle, specified in user space coordinates.
|
Creates thumbnail images for the specified range of pages. Thumbnail images are only created for pages that have none.
Use as large a page range as possible, because the color space object is shared by all the thumbnails created by a single invocation of this method. This means that if you call this method separately for each page, there will be duplicate color space objects.
See the description of Color Spaces in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 8.6, page 139.
You can find this document on the web store of the International Standards Organization (ISO).
See Developing Plug-ins and Applications for additional important information about creating thumbnails.
void
PDDocCreateThumbs(
PDDoc
doc
,
ASInt32
firstPage
,
ASInt32
lastPage
,
PDThumbCreationServer
server
,
void
*
serverClientData
,
ASAtom
colorSpace
,
ASInt32
bitsPerComponent
,
ASInt32
hiVal
,
char
*
lookupTable
,
ProgressMonitor
progMon
,
void
*
progMonClientData
,
CancelProc
cancelProc
,
void
*
cancelProcClientData
);
doc | IN/OUT The document for which thumbnail images are created.
|
firstPage | IN/OUT The page number of the first page for which thumbnails are created. The first page is
0 . |
lastPage | IN/OUT The page number of the last page for which thumbnails are created. The constant PDLastPage (see PDExpT.h) can also be used.
|
server | IN/OUT A server (set of callback procedures) that provides the sampled image used as the thumbnail image. Pass
NULL to use the default server. |
serverClientData | IN/OUT User-supplied data to pass to the thumbnail creation server.
|
colorSpace | IN/OUT The color space in which the thumbnail data is represented. It must be
DeviceRGB . Thumbnails may be created in either a direct or an indexed color space; however, it is strongly recommended that you use indexed color spaces over direct color spaces. Using direct color spaces with this version of Acrobat may cause bad looking thumbnails. To specify a direct color space, pass 0 for hiVal and NULL for lookupTable . To specify an indexed color space, pass the appropriate values in hiVal and lookupTable . Direct color spaces on Windows are supported in Acrobat. |
bitsPerComponent | IN/OUT The number of bits per color component in the thumbnail image's data.
8 is the only valid value. |
hiVal | IN/OUT Used only for indexed color space; pass
0 for direct color spaces, as described in colorSpace . hiVal specifies the highest valid index in lookupTable . Because indices start at 0 , the number of entries in lookupTable is hiVal + 1 . hiVal must be 0 for device color spaces. |
lookupTable |
NULL for direct color spaces, as described in colorSpace . lookupTable is a table that maps data values to colors. It is used only for indexed color spaces. It must be NULL for device color spaces. For an indexed color space, the size of the lookup table must be (hiVal + 1) : |
progMon | IN/OUT A monitor to call to display thumbnail creation progress. Use AVAppGetDocProgressMonitor() to obtain the standard progress monitor to pass for this parameter.
NULL may be passed, in which case no progress monitor is used. |
progMonClientData | |
cancelProc | IN/OUT A procedure to call frequently to allow the user to cancel thumbnail creation. Use AVAppGetCancelProc() to obtain the default cancel proc for this parameter. It may be
NULL , in which case no cancel proc is used. |
cancelProcClientData |
Creates a word finder that is used to extract text in the host encoding from a PDF file. The word finder may either be used by PDWordFinderEnumWords() (which enumerates words one-by-one) or by PDWordFinderAcquireWordList() (which fills a table with all the words on a page).
After you are done using the WordFinder, you must release it with PDWordFinderDestroy().
A default ligature table is used, containing the following ligatures:
The glyph name is substituted for the ligature.
This method also works for non-Roman (CJK or Chinese-Japanese-Korean) viewers. In this case, words are extracted to the host encoding. Developers desiring Unicode output must use PDDocCreateWordFinderUCS(), which does the extraction for Roman or non-Roman text.
The type of PDWordFinder determines the encoding of the string returned by PDWordGetString(). For instance, if PDDocCreateWordFinderUCS() is used to create the word finder, PDWordGetString() returns only Unicode.
For CJK viewers, words are stored internally using CID encoding.
See the description of Composite Fonts and CID fonts in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7, page 267.
You can find this document on the web store of the International Standards Organization (ISO).
For detailed information on CIDFonts, see:
Technical Note #5092, CID-Keyed Font Technology Overview
https://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5092.CID_Overview.pdf
Technical Note #5014, Adobe CMap and CIDFont Files Specification
https://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5014.CIDFont_Spec.pdf
PDWordFinder
PDDocCreateWordFinder(
PDDoc
doc
,
ASUns16
*
outEncInfo
,
char
*
*
outEncVec
,
char
*
*
ligatureTbl
,
ASInt16
algVersion
,
ASUns16
rdFlags
,
void
*
clientData
);
doc | The document on which the word finder is used.
| ||||||||||
outEncInfo | An array of 256 flags, specifying the type of character at each position in the encoding. Each flag is an
OR of the Character Type Codes. If outEncInfo is NULL , the platform's default encoding info is used. Use outEncInfo and outEncVec together; for every outEncInfo use a corresponding outEncVec to specify the character at that position in the encoding. Regardless of the characters specified in outEncInfo as word separators, a default set of word separators is used (see Glyph Names of Word Separators). There is no way to change the list of characters that are considered to be word separators. | ||||||||||
outEncVec | Array of 256 For descriptions of
You can find this document on the web store of the International Standards Organization (ISO). Use this parameter with | ||||||||||
ligatureTbl |
NULL -terminated array of NULL -terminated strings. Each string is the glyph name of a ligature in the font. When a word contains a ligature, the glyph name of the ligature is substituted for the ligature (for example, ff is substituted for the ff ligature). This table must be terminated with NULL . If ligatureTbl is NULL , a default ligature table is used, containing the following ligatures: | ||||||||||
algVersion | The version of the word-finding algorithm to use (see PDExpT.h), as follows (pass
0 if your client does not care):
| ||||||||||
rdFlags | Word-finding options that determine the tables filled when using PDWordFinderAcquireWordList(). It must be an
OR of one or more of the WordFinder Sort Order Flags. In Acrobat 5.0 this parameter is ignored and you should pass in NULL . | ||||||||||
clientData | A pointer to user-supplied data to pass to the newly created word finder.
|
This is a version 6.0 replacement for PDDocCreateWordFinder() and PDDocCreateWordFinderUCS() that adds configurable word-breaking behavior. This method creates a word finder that is used to extract text from a PDF file, according to the given configuration. The word finder can be used to enumerate words one-by-one or to fill a table with all the words on a page. You can choose to find only words that are visible in a given context.
You can use version 6.0 methods such as PDWordGetCharOffsetEx() to extract character information from words if you create the word finder with WF_VERSION_3 or later.
After you are done using the WordFinder, you must release it with PDWordFinderDestroy().
PDWordFinder
PDDocCreateWordFinderEx(
PDDoc
doc
,
ASInt16
algVersion
,
ASBool
outUnicode
,
PDWordFinderConfig
wbConfig
);
doc | The document on which the word finder is used.
| ||||||||||
algVersion | The version of the word-finding algorithm to use (see PDExpT.h), as follows (pass
0 if your client does not care):
| ||||||||||
outUnicode | Whether to return Unicode. When
true , the word finder encodes the extracted text in Unicode format. Otherwise, the word finder extracts the text in the host encoding. | ||||||||||
wbConfig | A pointer to a configuration record for the new word finder that customizes the way the extraction is performed. The configuration is only used if the algorithm version is WF_VERSION_3 or higher. When it is
NULL , the default configuration is used. |
Creates a word finder that is used to extract text in Unicode format from a PDF file. The word finder may either be used by PDWordFinderEnumWords() (which enumerates words one-by-one) or by PDWordFinderAcquireWordList() (which fills a table with all the words on a page).
After you are done using the WordFinder, you must release it with PDWordFinderDestroy().
PDDocCreateWordFinder() also works for non-Roman character set viewers. For PDDocCreateWordFinder(), words are extracted to the host encoding. Users desiring Unicode output should use PDDocCreateWordFinderUCS().
The type of PDWordFinder determines the encoding of the string returned by PDWordGetString(). If PDDocCreateWordFinderUCS() is used to create the word finder, PDWordGetString() returns only Unicode. Note that there is no way to detect Unicode strings returned by PDWordGetString(), since there is no UCS header (FEFF) added to each string returned.
In CJK viewers, words are stored internally using CID encoding. See the description of Composite Fonts and CIDFonts in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7, page 267.
You can find this document on the web store of the International Standards Organization (ISO).
For detailed information on CIDFonts, see:
Technical Note #5092, CID-Keyed Font Technology Overview
https://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5092.CID_Overview.pdf
Technical Note #5014, Adobe CMap and CIDFont Files Specification
https://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5014.CIDFont_Spec.pdf
Note: The word finder also extracts text from Form XObjects that are executed in the page contents. See the description of Form XObjects in the ISO 32000-1:2008, Document Management- Portable Document Format-Part 1: PDF 1.7, section 8.10, page 217. You can find this document on the web store of the International Standards Organization (ISO).
Note: PDDocCreateWordFinderUCS() is useful for converting non-Roman text (CJK or Chinese-Japanese-Korean) to Unicode. This method also converts Roman text to Unicode in any document.
PDWordFinder
PDDocCreateWordFinderUCS(
PDDoc
doc
,
ASInt16
algVersion
,
ASUns16
rdFlags
,
void
*
clientData
);
doc | The document on which the word finder is used.
|
algVersion | The version of the word-finding algorithm to use. If it is WF_LATEST_VERSION (see PDExpT.h), the most recent version is used. Set to
0 to ignore the version. |
rdFlags | Word-finding options that determine the tables filled when using PDWordFinderAcquireWordList(). It must be an
OR of one or more of the WordFinder Sort Order Flags. |
clientData | A pointer to user-supplied data to pass to the newly created word finder.
|
void
PDDocDeleteCollection(
PDDoc
pdDoc
);
pdDoc | The document whose collection dictionary is to be removed.
|
void
PDDocDeletePages(
PDDoc
doc
,
ASInt32
firstPage
,
ASInt32
lastPage
,
ProgressMonitor
progMon
,
void
*
progMonClientData
);
doc | The document from which pages are deleted.
|
firstPage | The page number of the first page to delete. The first page is
0 . |
lastPage | The page number of the last page to delete.
|
progMon | A progress monitor. Use AVAppGetDocProgressMonitor() to obtain the default progress monitor.
NULL may be passed, in which case no progress monitor is used. |
progMonClientData |
void
PDDocDeleteThumbs(
PDDoc
doc
,
ASInt32
firstPage
,
ASInt32
lastPage
,
ProgressMonitor
progMon
,
void
*
progMonClientData
);
doc | IN/OUT The document from which thumbnail images are deleted.
|
firstPage | IN/OUT The page number of the first page in
doc whose thumbnail image is deleted. The first page is 0 . |
lastPage | IN/OUT The page number of the last page in
doc whose thumbnail image is deleted. |
progMon | IN/OUT A monitor to call to display thumbnail deletion progress. Use AVAppGetDocProgressMonitor() to obtain the standard progress monitor to pass for this parameter.
NULL may be passed, in which case no progress monitor is used. |
progMonClientData |
void
PDDocEnumFonts(
PDDoc
doc
,
ASInt32
firstPage
,
ASInt32
lastPage
,
PDFontEnumProc
eproc
,
void
*
clientData
,
ProgressMonitor
progMon
,
void
*
progMonClientData
);
doc | The document whose fonts are enumerated.
|
firstPage | The page number of the first page for which fonts are enumerated. The first page is
0 . |
lastPage | The page number of the last page for which fonts are enumerated.
|
eproc | A user-supplied callback to call for each font. Enumeration terminates if
eproc returns false . |
clientData | A pointer to user-supplied data to pass to
eproc each time it is called. |
progMon | A progress monitor. Use AVAppGetDocProgressMonitor() to obtain the standard progress monitor.
NULL may be passed, in which case no progress monitor is used. |
progMonClientData |
void
PDDocEnumLoadedFonts(
PDDoc
doc
,
PDFontEnumProc
proc
,
void
*
clientData
);
doc | IN/OUT The document whose loaded fonts are enumerated.
|
proc | IN/OUT A user-supplied callback to call for each loaded font. Enumeration terminates if
proc returns false . |
clientData | IN/OUT A pointer to user-supplied data to pass to
proc each time it is called. |
void
PDDocEnumOCConfigs(
PDDoc
pdDoc
,
PDOCConfigEnumProc
enumProc
,
void
*
clientData
);
pdDoc | The document whose configurations are enumerated.
|
enumProc | A user-supplied callback to call for each configuration. Enumeration terminates if
enumProc returns false . |
clientData | A pointer to user-supplied data to pass to
proc each time it is called. |
enumProc
returns false
. Each group is reported once, even if it is referenced multiple times in a page, or on multiple pages. void
PDDocEnumOCGs(
PDDoc
pdDoc
,
PDOCGEnumProc
enumProc
,
void
*
clientData
);
pdDoc | The document whose groups are enumerated.
|
enumProc | A user-supplied callback to call for each group. Enumeration terminates if
enumProc returns false . |
clientData | A pointer to user-supplied data to pass to
enumProc each time it is called. |
Enumerates the specified type of page resources, for a specified range of pages.
This method enumerates resources in each page's Resources dictionary (ColorSpace resources, Fonts, ExtGState objects, or others). In addition, it looks inside in-line images and page contents to enumerate ColorSpace resources that are not in the Resources dictionary, such as DeviceGray, DeviceRGB, and DeviceCMYK.
void
PDDocEnumResources(
PDDoc
pdDoc
,
ASInt32
startPage
,
ASInt32
endPage
,
ASAtom
resourceType
,
CosObjEnumProc
enumProc
,
void
*
clientData
);
pdDoc | IN/OUT The document whose resources are enumerated.
|
startPage | IN/OUT The first page whose resources are enumerated. The first page in a document is
0 . |
endPage | IN/OUT The last page whose resources are enumerated.
|
resourceType | IN/OUT Resource type to enumerate. It must be one of the valid PDF resource types, such as Font, ColorSpace, XObject, Pattern, and so on. See the description of PDF resource types under "Resource Dictionaries" in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.8.3, page 83. You can find this document on the web store of the International Standards Organization (ISO). Pass ASAtomNull to enumerate all resource types. |
enumProc | IN/OUT A user-supplied callback to call once for each resource of the specified type. The resource is presented as a CosObj, and it is the first parameter of
enumProc (the second parameter is unused). |
clientData | IN/OUT User-supplied data to pass to
enumProc each time it is called. |
sourceDoc
. It does not create a new document if sourceDoc
contains no notes. CosDoc
PDDocExportNotes(
PDDoc
doc
,
ASFileSys
unused1
,
ASPathName
unused2
,
void
*
unused3
,
/* ASProgressMonitor */
void
*
unused4
,
PDDocWillExportAnnotCallback
exportFilter
,
ASInt32
*
numNotesP
);
doc | The document from which notes are exported.
|
unused1 | Currently unused.
|
unused2 | Currently unused.
|
unused3 | Currently unused.
|
unused4 | Currently unused.
|
exportFilter | A user-supplied routine that selects which notes to export.
|
numNotesP | If non-
NULL , the number of notes exported. |
Note: Make sure to explicitly include popups.
CosDoc
PDDocExportSomeNotes(
PDDoc
doc
,
ASFileSys
unused1
,
ASPathName
unused2
,
void
*
unused3
,
/* ASProgressMonitor */
void
*
unused4
,
PDDocWillExportAnnotCallback
exportFilter
,
PDAnnotArray
pdanArray
,
ASInt32
*
numNotesP
);
doc | The document from which notes are exported.
|
unused1 | Currently unused.
|
unused2 | Currently unused.
|
unused3 | Currently unused.
|
unused4 | Currently unused.
|
exportFilter | A user-supplied routine that selects which notes to export.
|
pdanArray | An array of PDAnnotArrayRec objects; the number of items in the arrray is the number of pages in
doc . |
numNotesP | (Filled by the method) If non-
NULL , the number of notes exported. |
Superseded by PDDocFindPageNumForLabelEx() in Acrobat 6.0.
Finds the first page in the document with a specified label.
ASInt32
PDDocFindPageNumForLabel(
PDDoc
pdDoc
,
const
char
*
labelStr
,
ASInt32
labelLen
);
pdDoc | The document to search for the page named in
labelStr . |
labelStr | The label of the page to find.
|
labelLen | The length of
labelStr . |
-1
if no such page exists. Supersedes PDDocFindPageNumForLabel in Acrobat 6.0.
Finds the first page in the document with a specified label.
ASInt32
PDDocFindPageNumForLabelEx(
PDDoc
pdDoc
,
ASConstText
labelText
);
pdDoc | The document to search for the page named in
labelStr . |
labelText | The label of the page to find.
|
-1
if no such page exists. ASBool
PDDocFlattenOC(
PDDoc
pdDoc
,
PDOCContext
context
);
pdDoc | The document to be modified.
|
context | The optional-content context in which content is checked for visibility.
|
PDDoc
PDDocFromCosDoc(
CosDoc
cosDoc
);
cosDoc | The Cos-level document object for which a PDDoc is obtained. This object represents the PDF.
|
is raised if the CosDoc is not valid.
| |
AdobePDFVersion
PDDocGetAdobePDFVersion(
PDDoc
doc
);
doc | IN/OUT The document whose version is obtained.
|
PDBookmark
PDDocGetBookmarkRoot(
PDDoc
pdDoc
);
pdDoc | IN/OUT Document whose root bookmark is obtained.
|
CosDoc
PDDocGetCosDoc(
PDDoc
doc
);
doc | The document whose CosDoc is obtained.
|
ASAtom
PDDocGetCryptHandler(
PDDoc
doc
);
doc | The document whose new security handler is obtained.
|
void
*
PDDocGetCryptHandlerClientData(
PDDoc
pdDoc
);
pdDoc | The document whose encryption handler client data is obtained.
|
cryptRevision
param based on the Security handler of the document. This is either retrieved directly from the Security handler or read from the encrypt dict. ASInt32
PDDocGetCryptRevision(
PDDoc
pdDoc
);
pdDoc | The document.
|
cryptVersion
param based on the Security handler of the document. This is either retrieved directly from the Security handler or read from the encrypt dict. ASInt32
PDDocGetCryptVersion(
PDDoc
pdDoc
);
pdDoc | The document.
|
ASFile
PDDocGetFile(
PDDoc
doc
);
doc | The document whose ASFile is obtained.
|
ASInt32
PDDocGetFlags(
PDDoc
doc
);
doc | IN/OUT The document whose flags are obtained.
|
OR
of the PDDocFlags values. ASBool
PDDocGetFullScreen(
PDDoc
pdDoc
);
pdDoc | The document to test.
|
Gets an element of a document's file identifier. See the description of File Identifiers in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 14.4, page 551.
You can find this document on the web store of the International Standards Organization (ISO).
ASInt32
PDDocGetID(
PDDoc
doc
,
ASInt32
nElemNum
,
ASUns8
*
buffer
,
ASInt32
bufferSize
);
doc | The document whose file ID is obtained.
| ||||||
nElemNum | The element number to get from the document's file ID. It must be one of the following:
| ||||||
buffer | (Filled by the method) If
buffer is non- NULL , then up to bufferSize bytes of the ID will be written to the buffer. | ||||||
bufferSize | The length of
buffer in bytes. |
Superseded by PDDocGetLabelForPageNumEx() in Acrobat 6.0.
Retrieves the label string associated with the given page number. The page number is returned in host encoding and is truncated to the length of the buffer.
ASInt32
PDDocGetLabelForPageNum(
PDDoc
pdDoc
,
ASInt32
pageNum
,
char
*
buffer
,
ASInt32
bufferLen
);
pdDoc | The document containing the page for which a label is requested.
|
pageNum | The number of the page whose label is requested.
|
buffer | If a label exists for
pageNum , it will be placed in this buffer. |
bufferLen | The length of the label (
NULL -terminated). |
pageNum
+
1
. Supersedes PDDocGetLabelForPageNum() in Acrobat 6.0.
Retrieves the label string associated with the given page number. The page number is returned in host encoding as a ASText object.
void
PDDocGetLabelForPageNumEx(
PDDoc
pdDoc
,
ASInt32
pageNum
,
ASText
text
);
pdDoc | The document containing the page for which a label is requested.
|
pageNum | The number of the page whose label is requested.
|
text | If a label exists for
pageNum , it is returned in this object. |
PDLayoutMode
PDDocGetLayoutMode(
PDDoc
doc
);
doc | IN The document whose layout mode is obtained.
|
theTree
, from the Names dictionary of thePDDoc
. PDNameTree
PDDocGetNameTree(
PDDoc
thePDDoc
,
ASAtom
theTree
);
thePDDoc | IN/OUT The document containing the name tree desired.
|
theTree | IN/OUT The name of the tree requested. This can be created by passing a string to the ASAtomFromString() method.
|
Gets the specified document's new security handler (that is, the security handler that will be used after the document is saved).
If the document does not have a new security handler, it returns the document's current security handler.
ASAtom
PDDocGetNewCryptHandler(
PDDoc
doc
);
doc | The document whose new security handler is obtained.
|
pdfName
of the document's new security handler. It returns ASAtomNull if the document does not have a new security handler. void
*
PDDocGetNewSecurityData(
PDDoc
doc
);
doc | The document whose new security data structure is obtained.
|
Gets the security information from the specified document's new security handler. It calls the PDCryptGetSecurityInfoProc() callback of the document's new security handler. No permissions are required to call this method.
It raises only those exceptions raised by the new security handler's PDCryptGetSecurityInfoProc() callback.
void
PDDocGetNewSecurityInfo(
PDDoc
pdDoc
,
ASUns32
*
secInfo
);
pdDoc | IN/OUT The document whose new security information is obtained.
|
secInfo | IN/OUT (Filled by the method) The document's new security information. The value must be an
OR of the Security Info Flags. It is set to pdInfoCanPrint | pdInfoCanEdit | pdInfoCanCopy | pdInfoCanEditNotes (see PDPerms) if the document's new security handler does not have a PDCryptGetSecurityInfoProc() callback. |
PDDocClearErrors
was called. ASInt32
PDDocGetNthError(
PDDoc
doc
,
ASInt32
errNumber
,
ASInt32
*
errorP
,
char
*
buffer
,
ASInt32
bufSize
);
doc | The document in which the error has occurred.
|
errNumber | This is the serial number of the non-fatal error to be returned.
|
errorP | The error code. Use
ASGetErrorString () to get the error message. |
buffer | |
bufSize | The maximum number of bytes that will be written to the buffer.
|
PDDocClearErrors
was called. ASInt32
PDDocGetNumErrors(
PDDoc
doc
);
doc | The document in which the non-fatal errors have occurred.
|
ASUns32
PDDocGetNumOCGs(
PDDoc
pdDoc
);
pdDoc | The document whose groups are counted.
|
ASInt32
PDDocGetNumPages(
PDDoc
doc
);
doc | IN/OUT The document for which the number of pages is obtained.
|
1
from this value if you are going to pass it to a PD- level method that takes a zero-based page number. ASInt32
PDDocGetNumThreads(
PDDoc
doc
);
doc | IN/OUT The document whose article thread count is obtained.
|
PDOCConfig
PDDocGetOCConfig(
PDDoc
pdDoc
);
pdDoc | The document whose configuration is obtained.
|
PDOCContext
PDDocGetOCContext(
PDDoc
pdDoc
);
pdDoc | The document whose context is obtained.
|
PDOCG
*
PDDocGetOCGs(
PDDoc
pdDoc
);
pdDoc | The document whose OCGs are obtained.
|
PDAction
PDDocGetOpenAction(
PDDoc
doc
);
doc | IN/OUT The document whose open action is obtained.
|
PDCollection
PDDocGetPDCollection(
PDDoc
pdDoc
);
pdDoc | The document.
|
PDPageLabel
PDDocGetPageLabel(
PDDoc
pdDoc
,
ASInt32
pageNum
,
ASInt32
*
firstPage
,
ASInt32
*
lastPage
);
pdDoc | The document for which a page label is desired.
|
pageNum | The page number of the page for which a label is requested.
|
firstPage | (Filled by the method) If non-
NULL , it is the number of the first page that the page label is attached to. |
lastPage |
firstPage
and lastPage
will be set to-1
. Note: PDDocGetFullScreen should be used when the page mode is set to full screen.
PDPageMode
PDDocGetPageMode(
PDDoc
doc
);
doc | IN/OUT The document whose page mode is obtained.
|
CosObj
PDDocGetPageObjByNum(
PDDoc
pdd
,
ASInt32
nPage
);
pdd | The PDDoc containing the given page.
|
nPage | The page number.
|
Deprecated in Acrobat 5.0. Use PDDocPermRequest() instead.
Gets the permissions for the specified document. You can set permissions with PDDocAuthorize().
PDPerms
PDDocGetPermissions(
PDDoc
doc
);
doc | The document whose permissions are obtained.
|
OR
of the PDPerms values. Superseded in Acrobat 5.0 by PDDocPermRequest.
Gets the security data structure for the specified document's current security handler. Use PDDocGetNewSecurityData() to get the data structure for the document's new security handler.
void
*
PDDocGetSecurityData(
PDDoc
doc
);
doc | The document whose security data structure is obtained.
|
PDThread
PDDocGetThread(
PDDoc
doc
,
ASInt32
index
);
doc | IN/OUT The document containing the article thread.
|
index | IN/OUT The index of the article thread to obtain.
|
ASInt32
PDDocGetThreadIndex(
PDDoc
doc
,
PDThread
thread
);
doc | IN/OUT The document containing the thread.
|
thread | IN/OUT The thread whose index is obtained.
|
-1
if thread
is not in doc
. ASAtom
PDDocGetTrapped(
PDDoc
pdDoc
);
pdDoc | The document whose Trapped key value is obtained.
|
Gets the major and minor PDF document versions. This is the PDF version of the document, which is specified in the header of a PDF file in the string "%PDF-xx.
yy"
where xx
is the major version and yy
is the minor version. For example, version 1.2 has the string "%PDF
-1
.2"
.
See the description of PDF Version Numbers in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section I.2, page 727.
You can find this document on the web store of the International Standards Organization (ISO).
void
PDDocGetVersion(
PDDoc
doc
,
ASInt16
*
majorP
,
ASInt16
*
minorP
);
doc | IN/OUT The document whose version is obtained.
|
majorP | IN/OUT (Filled by the method) The major version number.
|
minorP | IN/OUT (Filled by the method) The minor version number.
|
Returns the Adobe version of the PDF format to which the PDF file conforms. For PDF versions 1.0 through 1.7, this method will return a major version of 1, a minor version in the range of 0 through 7, and an adbeExtensionLevel
of 0. For Acrobat 9, this method will return a major version of 1 and a minor version of 8. For Acrobat 10, this method will return a major version of 1 and a minor version of 9. Starting with Acrobat 9, Adobe extensions to the PDF format will be identified via the Adobe Extensions Dictionary for the ISO 32000 standard in the catalog; in this case, the major and minor versions will be returned, and the Adobe extension level will be returned via the last argument. When the Extensions Dictionary is added to a PDF document, it allows PDF features provided in Adobe Acrobat after PDF version 1.7 to be used with that document. The version of the PDF file is drawn from the Extensions Dictionary instead of from the file header.
See https://www.adobe.com/devnet/pdf/pdf_reference.html
void
PDDocGetVersionEx(
PDDoc
doc
,
ASUns32
*
majorP
,
ASUns32
*
minorP
,
CosObj
*
adbeExtensionBaseP
,
ASUns32
*
adbeExtensionLevelP
);
doc | IN/OUT The document whose version is obtained.
|
majorP | IN/OUT (Filled by the method) The major version number.
|
minorP | IN/OUT (Filled by the method) The minor version number.
|
adbeExtensionBaseP | IN/OUT (Filled in by the method) The value of the BaseVersion entry in the ADBE dictionary. If there is no Extensions dictionary or no ADBE sub-dictionary, the value returned will be a null CosObj.
|
adbeExtensionLevelP | IN/OUT (Filled in by the method) The values of the ExtensionLevel entry in the ADBE dictionary. If there is no Extensions dictionary or no ADBE sub-dictionary, the value returned will be zero.
|
PDWordFinder
PDDocGetWordFinder(
PDDoc
docP
,
ASInt16
WXEVersion
);
docP | The document whose word finder is obtained.
|
WXEVersion | The version of the word finder to get.
|
NULL
if the document does not have a word finder or its version does not match the version requested. is thrown if an invalid version number is passed.
|
Returns true if the document contains the Adobe Extensions Dictionary for specifying the inclusion of features beyond the ISO 32000 specification. Starting with Acrobat 9, Adobe extensions to the PDF format will be identified via this Extensions Dictionary in the catalog. When the Extensions Dictionary is added to a PDF document, it allows PDF features provided in Adobe Acrobat after PDF version 1.7 to be used with that document. The version of the PDF file is drawn from the Extensions Dictionary instead of from the file header.
See https://www.adobe.com/devnet/pdf/pdf_reference.html
ASBool
PDDocHasISOExtensions(
PDDoc
doc
);
doc | IN/OUT The document tested for ISO extensions.
|
ASBool
PDDocHasOC(
PDDoc
pdDoc
);
pdDoc | The document whose OC status is obtained.
|
Adds text annotations from sourceDoc
to doc
.
It raises an exception if the given object has the wrong Cos type. It also raises exceptions if storage is exhausted or file access fails.
ASInt32
PDDocImportCosDocNotes(
PDDoc
doc
,
CosDoc
src
,
const
char
*
noteTitle
,
ASInt32
noteTitleLen
,
PDColorValue
color
,
void
*
progMon
,
/* ASProgressMonitor */
void
*
monClientData
,
PDDocWillImportAnnotCallback
importFilter
);
doc | The document that will receive the imported annotations.
|
src | The document from which the annotations will be imported.
|
noteTitle | Not currently used.
|
noteTitleLen | Not currently used.
|
color | If non-
NULL , the color attribute of imported annotations. color indicates the color space (PDDeviceGray, PDDeviceRGB, PDDeviceCMYK), and color values for the annotation. |
progMon | If supplied, it is a procedure to call regularly to update a progress bar for the user.
|
monClientData | If supplied, it is a pointer to the private data buffer used by
progMon . |
importFilter | A user-supplied procedure that will be called to provide a filtering process, allowing only desired annotations to import.
|
Adds text annotations (notes) from sourceDoc
to doc
.
It raises an exception if the given object has the wrong Cos type. Also raises exceptions if storage is exhausted or file access fails.
ASInt32
PDDocImportNotes(
PDDoc
doc
,
PDDoc
sourceDoc
,
void
*
progMon
,
/* ASProgressMonitor */
void
*
monClientData
,
PDDocWillImportAnnotCallback
importFilter
);
doc | The document to which the notes are exported.
|
sourceDoc | The document from which the notes are exported.
|
progMon | A user-supplied progress monitor.
|
monClientData | Data supplied by the monitoring routine.
|
importFilter | A user-supplied filter which determines what type of notes will be exported.
|
Inserts numPages
pages from doc2
into doc
. All annotations, and anything else associated with the page (such as a thumbnail image) are copied from the doc2
pages to the new pages in doc
. This method does not insert pages if doc
equals doc2
.
The insertFlags
parameter controls whether bookmarks and threads are inserted along with the specified pages. Setting The PDInsertAll flag has two effects:
doc2
are inserted.In addition to inserting the pages themselves, it also merges other document data from doc2
into doc
:
doc2
(of PDF 1.1 and later) are copied into doc
. If there are named destinations in doc2
with the same name as some named destination in doc
, the ones in doc
retain their names and the copied named destinations are given new names based on the old ones, with distinguishing digits added. Actions and bookmarks referring to the old names are made to refer to the new names after being copied into doc
.mergeAfterThisPage
denotes the last page of the document, then document metadata is merged, and the optional content properties are merged in a more symmetrical manner than would otherwise be the case.
Document logical structure from doc2
is copied into doc
. If less than the whole of doc2
is being inserted, only those structure elements having content on the copied pages, and the ancestors of those elements, are copied into the logical structure tree of doc
. The top-level children of the structure tree root of doc2
are copied as new top-level children of the structure tree root of doc
; a structure tree root is created in doc
if there was none before. The role maps of the two structure trees are merged, with name conflicts resolved in favor of the role mappings present in doc
. Attribute objects having scalar values, or values that are arrays of scalar values, are copied. Class map information from doc2
is also merged into that for doc
.
void
PDDocInsertPages(
PDDoc
doc
,
ASInt32
mergeAfterThisPage
,
PDDoc
doc2
,
ASInt32
startPage
,
ASInt32
numPages
,
ASUns16
insertFlags
,
ProgressMonitor
progMon
,
void
*
progMonClientData
,
CancelProc
cancelProc
,
void
*
cancelProcClientData
);
doc | The document into which pages are inserted. This document must have at least one page.
| ||||||||
mergeAfterThisPage | The page number in
doc after which pages from doc2 are inserted. The first page is 0 . If PDBeforeFirstPage (see PDExpT.h) is used, the pages are inserted before the first page in doc . Use PDLastPage to insert pages after the last page in doc . | ||||||||
doc2 | The document containing the pages that are inserted into
doc . | ||||||||
startPage | The page number of the first page in
doc2 to insert into doc . The first page is 0 If PDAllPages is used, all pages from doc2 are inserted into doc. | ||||||||
numPages | The number of pages in
doc2 to insert into doc . Use PDAllPages to insert all pages from startPage of doc2 into doc . | ||||||||
insertFlags | Flags that determine what additional information is copied from
doc2 into doc . It is an OR of the following constants (see PDExpT.h):
| ||||||||
progMon | A progress monitor. Use AVAppGetDocProgressMonitor() to obtain the default progress monitor.
NULL may be passed, in which case no progress monitor is used. | ||||||||
progMonClientData | |||||||||
cancelProc | A cancel procedure. Use AVAppGetCancelProc() to obtain the current cancel procedure. It may be
NULL , in which case no cancel proc is used. | ||||||||
cancelProcClientData |
is raised unless
doc is editable and doc2 is not encrypted or the owner opened it. | |
is raised if
doc2 is a newer major version than the Acrobat viewer understands. | |
is raised if the insertion would result in a document with too many pages.
| |
is raised if
mergeAfterThisPage is an invalid page number or doc has no pages. | |
is raised if there is insufficient memory to perform the insertion.
| |
is raised if an error occurs while trying to recover from an error during inserting.
|
void
PDDocMovePage(
PDDoc
doc
,
ASInt32
moveToAfterThisPage
,
ASInt32
pageToMove
);
doc | The document in which the page is moved.
|
moveToAfterThisPage | The new location of the page to move. The first page is
0 . It may either be a page number, or the constant PDBeforeFirstPage (see PDExpT.h). |
pageToMove | The page number of the page to move.
|
is raised if
moveAfterThisPage or pageToMove is invalid. Other exceptions may be raised as well. |
Creates a security data structure appropriate for the specified document's new security handler. The new security handler must have been previously set using PDDocSetNewCryptHandler(). The structure is created by calling the new security handler's PDCryptNewSecurityDataProc().
After calling PDDocNewSecurityData(), fill the structure as appropriate, call PDDocSetNewSecurityData() with the structure, and then free the structure using ASfree().
void
*
PDDocNewSecurityData(
PDDoc
doc
);
doc | The document for which a security data structure is created.
|
is raised if the document does not have a new security handler.
|
doRepair
set to true
. This allows the application to decide whether to perform the time-consuming repair operation. PDDoc
PDDocOpen(
ASPathName
fileName
,
ASFileSys
fileSys
,
PDAuthProc
authProc
,
ASBool
doRepair
);
fileName | A path name to the file, specified in whatever format is correct for
fileSys . |
fileSys | A pointer to an ASFileSysRec containing the file system in which the file resides. If it is
NULL , it uses the default file system. |
authProc | An authorization callback, called only if the file has been secured (that is, if the file has either the user or the master password set). This callback should obtain whatever information is needed to determine whether the user is authorized to open the file, then call PDDocPermRequest(). The Acrobat viewer's built-in authorization procedure requires the user to enter a password, and allows the user to try three times before giving up. If the
authProc requires data, use PDDocOpenEx() instead of PDDocOpen(). |
doRepair |
or genErrNoMemory is raised if there is insufficient memory to open the document.
| |
is raised if the document needs to be rebuilt and
doRepair is false . | |
is raised if the Outlines object appears to be invalid (if the value of the Outlines key in the Catalog is not a
NULL or dictionary object). | |
is raised if the Catalog object (as returned by CosDocGetRoot()) is not a dictionary.
| |
is raised if the Pages tree appears to be invalid (if the value of the Pages key in the Catalog is not a
NULL or dictionary object). | |
is raised if the document contains too many pages.
| |
is raised if the document's header appears to be bad.
| |
is raised if no end-of-file line can be located.
| |
is raised if
doRepair is true and rebuild failed. |
doRepair
equal to true
. This allows the application to decide whether to perform the time-consuming repair operation. PDDoc
PDDocOpenEx(
ASPathName
fileName
,
ASFileSys
fileSys
,
PDAuthProcEx
authProcEx
,
void
*
authProcClientData
,
ASBool
doRepair
);
fileName | A path name to the file, specified in whatever format is correct for
fileSys . |
fileSys | A pointer to an ASFileSysRec containing the file system in which the file resides.
|
authProcEx | An authorization callback, called only if the file has been secured (meaning that the file has either the user or the master password set). This callback should obtain whatever information is needed to determine whether the user is authorized to open the file, then call PDDocAuthorize()() (which returns the permissions that the authentication data enables). The Acrobat viewer's built-in authorization procedure requires the user to enter a password, and allows the user to try three times before giving up.
|
authProcClientData | A pointer to user-supplied data to pass to authProcEx() each time it is called.
|
doRepair |
or genErrNoMemory is raised if there is insufficient memory to open the document.
| |
is raised if the document needs to be rebuilt and
doRepair is false . | |
is raised if the Outlines object appears to be invalid (if the value of the Outlines key in the Catalog is not a
NULL or dictionary object). | |
is raised if the Catalog object (as returned by CosDocGetRoot()) is not a dictionary.
| |
is raised if the Pages tree appears to be invalid (if the value of the Pages key in the Catalog is not a
NULL or dictionary object). | |
is raised if the document contains too many pages.
| |
is raised if the document's header appears to be bad.
| |
is raised if no end-of-file line can be located.
| |
is raised if
doRepair is true and rebuild failed. |
Opens the document specified by the ASFile. aFile
must be a valid ASFile. It is the caller's responsibility to dispose of the ASFile after calling PDDocClose().
This method is useful when the document referenced by the ASFile is not on the local machine, and is being retrieved incrementally using the multi-read protocol of an ASFileSys. If the bytes required to open a PDDoc are not yet available, this method will raise the exception fileErrBytesNotReady. The client should call PDDocOpenFromASFile() until this exception is no longer raised.
PDDoc
PDDocOpenFromASFile(
ASFile
aFile
,
PDAuthProc
authProc
,
ASBool
doRepair
);
aFile | |
authProc | An authorization callback, called only if the file is encrypted. This callback should obtain whatever information is needed to determine whether the user is authorized to open the file, then call PDDocAuthorize() (which returns the permissions that the authentication data enables). The Acrobat viewer's built-in authorization procedure requires the user to enter a password, and allows the user to try three times before giving up.
|
doRepair |
is raised if the bytes required to open a PDDoc are not yet available.
|
Opens the document specified by the ASFile. aFile
must be a valid ASFile. It is the caller's responsibility to dispose of the ASFile after calling PDDocClose().
This method is useful when the document referenced by the ASFile is not on the local machine, and is being retrieved incrementally using the multiread protocol of an ASFileSys. If the bytes required to open a PDDoc are not yet available, this method will raise the exception fileErrBytesNotReady. The client should call PDDocOpenFromASFile() until this exception is no longer raised.
PDDoc
PDDocOpenFromASFileEx(
ASFile
aFile
,
PDAuthProcEx
authProcEx
,
void
*
authProcClientData
,
ASBool
doRepair
);
aFile | |
authProcEx | An authorization callback, called only if the file is encrypted. This callback should obtain whatever information is needed to determine whether the user is authorized to open the file, then call PDDocAuthorize() (which returns the permissions that the authentication data enables). The Acrobat viewer's built-in authorization procedure requires the user to enter a password, and allows the user to try three times before giving up.
|
authProcClientData | A pointer to user-supplied data to pass to authProcEx() each time it is called.
|
doRepair |
is raised if the bytes required to open a PDDoc are not yet available.
|
PDDoc
PDDocOpenWithParams(
PDDocOpenParams
openParams
);
openParams | IN/OUT A structure that defines which PDF file is opened. It contains parameters such as a file name, a file system, an authorization procedure, and a set of flags that define what permissions the user has on a file.
|
openParams
. This method supersedes PDDocGetPermissions().
Checks the permissions associated with the specified document using the latest permissions format, and determines whether the requested operation is allowed for the specified object in the document.
This method first checks the requested object and operation in a cached permissions list. If a value is not found, it calls the document's permission handlers, followed by security handlers via PDCryptAuthorizeExProc() to request permissions for the operation. The final permission is a logical AND
of the permissions granted by individual permissions and/or security handlers. If the document's security handler does not support this Acrobat 5.0 call, the method calls PDCryptAuthorizeProc() instead. The method then interprets the returned PDPerms
to determine whether the requested operation is allowed for the specified object in the document.
This method may throw exceptions.
PDPermReqStatus
PDDocPermRequest(
PDDoc
pdDoc
,
PDPermReqObj
reqObj
,
PDPermReqOpr
reqOpr
,
void
*
authData
);
pdDoc | The PDDoc whose permissions are being requested.
|
reqObj | The target object of the permissions request.
|
reqOpr | The target operation of the permissions request.
|
authData | A pointer to an authorization data structure.
|
0
if the requested operation is allowed, a non-zero status code otherwise.
PDDocPermRequestNoUB() indicates whether the permission would have been granted had the document not been Rights Enabled.
This may throw numerous exceptions.
PDPermReqStatus
PDDocPermRequestNoUB(
PDDoc
pdDoc
,
PDPermReqObj
reqObj
,
PDPermReqOpr
reqOpr
,
void
*
authData
);
pdDoc | The PDDoc whose permissions are being requested.
|
reqObj | The target object of the permissions request.
|
reqOpr | The target operation of the permissions request.
|
authData | A pointer to an authorization data structure.
|
0
if the requested operation is allowed, a non-zero status code otherwise. void
PDDocReadAhead(
PDDoc
doc
,
ASUns32
flags
,
void
*
clientData
);
doc | IN/OUT The document being read.
|
flags | IN/OUT Flags describing type of data to read ahead. It must be an
OR of flags in PDDocReadAhead() Flags. |
clientData | IN/OUT Currently unused.
|
void
PDDocReadAheadEmbeddedFile(
PDDoc
doc
,
CosObj
embeddedFileObj
);
doc | The document being read.
|
embeddedFileObj | The Cos object of the embedded file stream (the stream referenced by entries in the EF dictionary).
|
nPages
starting at startPage
(if the file is linearized). void
PDDocReadAheadPages(
PDDoc
doc
,
ASInt32
startPage
,
ASInt32
nPages
);
doc | IN/OUT The document for which pages are read ahead.
|
startPage | IN/OUT The page for which read ahead is initiated.
|
nPages | IN/OUT The number of pages to read ahead.
|
void
PDDocRelease(
PDDoc
doc
);
doc | IN/OUT The document whose reference count is decremented.
|
void
PDDocRemoveNameTree(
PDDoc
thePDDoc
,
ASAtom
theTree
);
thePDDoc | IN/OUT The document from which a name tree is removed.
|
theTree | IN/OUT The name tree to remove.
|
void
PDDocRemoveOpenAction(
PDDoc
doc
);
doc | IN/OUT The document whose open action is removed.
|
void
PDDocRemovePageLabel(
PDDoc
pdDoc
,
ASInt32
pageNum
);
pdDoc | The document from which a page label is removed.
|
pageNum | The page from which the page label is removed.
|
void
PDDocRemoveThread(
PDDoc
doc
,
ASInt32
index
);
doc | IN/OUT The document from which the thread is removed.
|
index | IN/OUT The index of the thread to remove.
|
void
PDDocReplaceOCG(
PDOCG
replaceOCG
,
PDOCG
keepOCG
);
replaceOCG | The OCG to replace.
|
keepOCG | The replacement OCG.
|
Note: Annotations in the replaced pages are not replaced and remain with the page. Use PDDocDeletePages() to remove annotations.
void
PDDocReplacePages(
PDDoc
doc
,
ASInt32
startPage
,
PDDoc
doc2
,
ASInt32
startPageDoc2
,
ASInt32
numPages
,
ASBool
mergeTextAnnots
,
ProgressMonitor
progMon
,
void
*
progMonClientData
,
CancelProc
cancelProc
,
void
*
cancelProcClientData
);
doc | The document in which pages are replaced.
|
startPage | The first page number in
doc to replace. The first page is 0 . |
doc2 | The document from which pages are copied into
doc . |
startPageDoc2 | The page number of the first page in
doc2 to copy. The first page is 0 . |
numPages | The number of pages to replace.
|
mergeTextAnnots | If
true , text annotations from doc2 are appended if they are different than all existing annotations on the page in doc . No other types of annotations are copied. |
progMon | A progress monitor. Use AVAppGetDocProgressMonitor() to obtain the default progress monitor.
NULL may be passed, in which case no progress monitor is used. |
progMonClientData | |
cancelProc | Currently unused. A cancel procedure. Use AVAppGetCancelProc() to obtain the current cancel procedure. It may be
NULL , in which case no cancel proc is used. |
cancelProcClientData |
is raised unless
doc is editable and doc2 is not encrypted or the owner opened it. | |
is raised if
doc2 is a newer major version than the Acrobat viewer understands. | |
| |
is raised if there is insufficient memory to perform the insertion.
|
void
PDDocRequestEntireFile(
PDDoc
doc
,
PDDocRequestEntireFileProc
requestProc
,
void
*
clientData
);
doc | The document for which pages are read ahead.
|
requestProc | The procedure to call to process the request.
|
clientData | A pointer to user-defined data to pass to the
requestProc . |
nPages
starting at startPage
, and performs a specified procedure on them. void
PDDocRequestPages(
PDDoc
doc
,
ASInt32
startPage
,
ASInt32
nPages
,
PDDocRequestPagesProc
requestProc
,
void
*
clientData
);
doc | The document for which pages are read ahead.
|
startPage | The first page requested.
|
nPages | The number of pages requested.
|
requestProc | The procedure to call to process the request.
|
clientData | A pointer to user-defined data to pass to the
requestProc . |
void
PDDocResetInkUsage(
PDDoc
doc
);
doc | IN The document on which to reset set the ink usage.
|
Saves a document to disk. If a full save is requested to the original path, the file is saved to a file system-determined temporary file, the old file is deleted, and the temporary file is renamed to newPath
. You must call PDDocClose() to release resources; do not call PDDocRelease().
If the document was created with PDDocCreate(), at least one page must be added using PDDocCreatePage() or PDDocInsertPages() before Acrobat can save the document.
You can replace this method with your own version, using HFTReplaceEntry().
A full save with linearization optimizes the PDF file. During optimization, all objects in a PDF file are rearranged, many of them acquiring not only a new file position, but also a new Cos object number. At the end of the save operation, Acrobat flushes its information of the PD layer and below to synchronize its in-memory state with the new disk file just written.
It is crucial that all objects that have been acquired from a PDDoc be released before Acrobat attempts to flush its in-memory state. This includes any object that was acquired with a PD
*Acquire
method, such as PDDocAcquirePage() or PDBeadAcquirePage(). Failing to release these objects before the full save results in a save error, and the resulting PDF file is not valid. In addition, all PD level objects and Cos objects derived from the PDDoc are no longer valid after the full save. Attempting to use these objects after a full save produces undefined results.
Clients and applications should register for the PDDocWillSaveEx() and PDDocDidSave() notifications so that they can clean up appropriately. See these notifications for more information on releasing and reacquiring objects from the PDDoc.
Note: Not replaceable in Adobe Reader.
void
PDDocSave(
PDDoc
doc
,
PDSaveFlags
saveFlags
,
ASPathName
newPath
,
ASFileSys
fileSys
,
ProgressMonitor
progMon
,
void
*
progMonClientData
);
doc | The document to save.
|
saveFlags | A bit field composed of an
OR of the PDSaveFlags values. |
newPath | The path to which the file is saved. A path must be specified when either PDSaveFull or PDSaveCopy are used for saveFlags. If PDSaveIncremental is specified in saveFlags, then
newPath should be NULL . If PDSaveFull is specified and newPath is the same as the file's original path, the new file is saved to a file system-determined temporary path, then the old file is deleted and the new file is renamed to newPath . |
fileSys | The file system. If it is
NULL , uses the fileSys of the document's current backing file. Files can only be saved to the same file system. fileSys must be either NULL or the default file system obtained with ASGetDefaultFileSys(), otherwise an error is raised. |
progMon | A progress monitor. Use AVAppGetDocProgressMonitor() to obtain the default.
NULL may be passed, in which case no progress monitor is used. |
progMonClientData |
is raised if the save was completed successfully, but there were problems cleaning up afterwards. The document is no longer consistent and cannot be changed. It must be closed and reopened.
| |
is raised if saving is not permitted. Saving is permitted if either
edit or editNotes (see PDPerms) is allowed, or you are doing a full save and saveAs is allowed. | |
is raised if PDSaveFull is used, and the file specified by
newPath is already open. |
Saves a document to disk as specified in a parameter's structure. This is essentially the same as PDDocSave() with two additional parameters: a cancel proc and cancel proc client data (so you could cut and paste description information and other information from PDDocSave()).
You can replace this method with your own version, using HFTReplaceEntry().
Note: Saving a PDDoc invalidates all objects derived from it. See PDDocSave() for important information about releasing objects that you may have acquired or used from a PDDoc before it is saved.
Note: Not replaceable in Adobe Reader.
void
PDDocSaveWithParams(
PDDoc
doc
,
PDDocSaveParams
inParams
);
doc | The document to save.
|
inParams | A PDDocSaveParams structure specifying how the document should be saved.
|
void
PDDocSetAdobePDFVersion(
PDDoc
doc
,
const
AdobePDFVersion
version
);
doc | IN/OUT The document whose version is to be updated.
|
version | IN/OUT version to which document is updated.
|
void
PDDocSetFlags(
PDDoc
doc
,
ASInt32
flags
);
doc | IN/OUT The document whose flags are set.
|
flags | IN/OUT A bit field composed of an
OR of the PDDocFlags values. |
void
PDDocSetFullScreen(
PDDoc
pdDoc
,
ASBool
fs
);
pdDoc | The document to set.
|
fs |
void
PDDocSetLayoutMode(
PDDoc
doc
,
PDLayoutMode
mode
);
doc | IN The document whose page mode is set.
|
mode | IN The layout mode to set.
|
void
PDDocSetMinorVersion(
PDDoc
pdDoc
,
ASInt16
minor
);
pdDoc | The document.
|
minor | The minimum required minor version
|
void
PDDocSetNewCryptFilterData(
PDDoc
doc
,
ASAtom
filterName
,
char
*
cryptData
,
ASInt32
cryptDataLen
);
doc | The document whose new encrypted data is set.
|
filterName | The ASAtom corresponding to the name of the security filter used by the document.
|
cryptData | The new encrypted data for the document.
|
cryptDataLen | The length of
cryptData in bytes. |
is raised if there is no security handler registered for the document.
| |
is raised if the document's permissions do not allow its data to be modified.
|
void
PDDocSetNewCryptFilterMethod(
PDDoc
doc
,
ASAtom
filterName
,
ASAtom
method
);
doc | The document whose new security filter method is set.
|
filterName | The ASAtom corresponding to the name of the security filter to use.
|
method |
|
is raised if there is no security handler registered for the document.
|
Sets the specified document's new security handler (that is, the security handler that will be used after the document is saved).
This method returns with no action if the new security handler is the same as the old one. Otherwise, it calls the new security handler's PDCryptNewSecurityDataProc() to set the document's newSecurityData
field. If the new security handler does not have this callback, the document's newSecurityData
field is set to 0
.
void
PDDocSetNewCryptHandler(
PDDoc
pdDoc
,
ASAtom
newCryptHandler
);
pdDoc | The document whose new security handler is set.
|
newCryptHandler | The ASAtom for the name of the new security handler to use for the document. This name must be the same as the
pdfName used when the security handler was registered using PDRegisterCryptHandler(). Use ASAtomNull to remove security from the document. |
is raised if there is no security handler registered with the specified name and the name is not ASAtomNull.
| |
is raised if the document's permissions do not allow its security to be modified.
|
Extends PDDocSetNewCryptHandler() for Acrobat 6.0. It sets the specified document's new security handler (that is, the security handler that will be used after the document is saved). This method should be called when the current document's security handler requires authorization data to validate permission to change security handlers.
This method returns with no action if the new security handler is the same as the old one. Otherwise, the new security handler's PDCryptNewSecurityDataProc() is called to set the document's newSecurityData
field. If the new security handler does not have this callback, the document's newSecurityData
field is set to 0
.
void
PDDocSetNewCryptHandlerEx(
PDDoc
pdDoc
,
ASAtom
newCryptHandler
,
void
*
currentAuthData
);
pdDoc | The document whose new security handler is set.
|
newCryptHandler | The ASAtom corresponding to the name of the new security handler to use for the document. This name must be the same as the
pdfName used when the security handler was registered using PDRegisterCryptHandler(). Use ASAtomNull to remove security from the document. |
currentAuthData | A pointer to authorization data to be passed to the PDCryptAuthorizeProc() callback for the document's current security handler. For the Acrobat viewer's built-in security handler, the password is passed in the
authData parameter. |
is raised if there is no security handler registered with the specified name and the name is not ASAtomNull.
| |
is raised if the document's permissions do not allow its security to be modified.
|
void
PDDocSetNewDefaultFilters(
PDDoc
doc
,
ASAtom
defaultStmFilterName
,
ASAtom
defaultStrFilterName
);
doc | The document whose new security filter is set.
|
defaultStmFilterName | The ASAtom corresponding to the name of the default security filter to use for streams. The filter must exist and be registered.
|
defaultStrFilterName | The ASAtom corresponding to the name of the default security filter to use for strings. The filter must exist and be registered.
|
is raised if there is no security handler registered for the document.
|
void
PDDocSetNewSecurityData(
PDDoc
pdDoc
,
void
*
secData
);
pdDoc | IN/OUT The document whose new security data structure is set.
|
secData | IN/OUT A pointer to the new security data structure to set for
doc . See PDDocNewSecurityData() for information on creating and filling this structure. |
is raised if the document does not have a new security handler.
| |
is raised if the document's permissions cannot be changed.
|
void
PDDocSetOpenAction(
PDDoc
doc
,
PDAction
action
);
doc | The document whose open action is set.
|
action | The open action you want to set.
|
Attaches a label to a page. This establishes the numbering scheme for that page and all pages following it, until another page label is encountered. This label allows PDF producers to define a page numbering system other than the Acrobat default.
If pageNum
is less than 0
or greater than the number of pages in pdDoc
, the method does nothing.
void
PDDocSetPageLabel(
PDDoc
pdDoc
,
ASInt32
pageNum
,
PDPageLabel
pgLabel
);
pdDoc | The document containing the page to label.
|
pageNum | The number of the page to label.
|
pgLabel | The label for the page specified by
pageNum . |
is raised if
pgLabel is not a valid PDPageLabel. |
void
PDDocSetPageMode(
PDDoc
doc
,
PDPageMode
mode
);
doc | IN/OUT The document whose page mode is set.
|
mode | IN/OUT The page mode to set.
|
void
PDDocSetTrapped(
PDDoc
pdDoc
,
ASAtom
newValue
);
pdDoc | The document whose Trapped key value to set.
|
newValue | The new value of the Trapped key in the Info dictionary, or ASAtomNull to remove any existing entry. The method does not check that the value is one of the allowed values for the key.
|
void
PDEnumDocs(
PDDocEnumProc
proc
,
void
*
clientData
);
proc | |
clientData | IN/OUT A pointer to user-supplied data to pass to
proc each time it is called. |