DL Logo

PDDoc Definitions

PDPermReqDenied

Header: PDExpT.h:4108

Description

-1 The request was denied.

Syntax

#define PDPermReqDenied ( PDPermReqStatus )( - 1 )

PDPermReqGranted

Header: PDExpT.h:4110

Description

0 The request was granted.

Syntax

#define PDPermReqGranted ( PDPermReqStatus )( 0 )

PDPermReqOperationNA

Header: PDExpT.h

Description

3 The operation is not applicable for the specified object.

Syntax

#define PDPermReqOperationNA

PDPermReqPending

Header: PDExpT.h:4120

Description

The handler does not have enough information to determine an answer at this point. Try again later.

Syntax

#define PDPermReqPending ( PDPermReqStatus )( 4 )

PDPermReqUnknownObject

Header: PDExpT.h:4112

Description

1 The object is unknown.

Syntax

#define PDPermReqUnknownObject ( PDPermReqStatus )( 1 )

PDPermReqUnknownOperation

Header: PDExpT.h:4114

Description

2 The operation is unknown.

Syntax

#define PDPermReqUnknownOperation ( PDPermReqStatus )( 2 )

PDPermReqVersion

Header: PDExpT.h:4123

Syntax

#define PDPermReqVersion 0x0004

STDSEC_CryptRevision1

Header: PDExpT.h:4363

Syntax

#define STDSEC_CryptRevision1 1

STDSEC_CryptRevision2

Header: PDExpT.h:4364

Syntax

#define STDSEC_CryptRevision2 2

STDSEC_CryptRevision3

Header: PDExpT.h:4365

Syntax

#define STDSEC_CryptRevision3 3

STDSEC_CryptRevision4

Header: PDExpT.h:4366

Syntax

#define STDSEC_CryptRevision4 4

STDSEC_CryptRevision5

Header: PDExpT.h:4374

Syntax

#define STDSEC_CryptRevision5 5

STDSEC_CryptRevision6

Header: PDExpT.h:4376

Syntax

#define STDSEC_CryptRevision6 6

STDSEC_CryptVersionV1

Header: PDExpT.h:4354

Syntax

#define STDSEC_CryptVersionV1 1

STDSEC_CryptVersionV2

Header: PDExpT.h:4355

Syntax

#define STDSEC_CryptVersionV2 2

STDSEC_CryptVersionV3

Header: PDExpT.h:4356

Syntax

#define STDSEC_CryptVersionV3 3

STDSEC_CryptVersionV4

Header: PDExpT.h:4358

Syntax

#define STDSEC_CryptVersionV4 4

STDSEC_CryptVersionV5

Header: PDExpT.h:4360

Description

New encryption method for Acrobat 9.0

Syntax

#define STDSEC_CryptVersionV5 5

STDSEC_KEYLENGTH_AES128

Header: PDExpT.h:4349

Syntax

#define STDSEC_KEYLENGTH_AES128 16

STDSEC_KEYLENGTH_AES256

Header: PDExpT.h:4351

Description

New encryption method for Acrobat 9.0

Syntax

#define STDSEC_KEYLENGTH_AES256 32

STDSEC_KEYLENGTH_RC4_V1

Header: PDExpT.h:4347

Syntax

#define STDSEC_KEYLENGTH_RC4_V1 5

STDSEC_KEYLENGTH_RC4_V2

Header: PDExpT.h:4348

Syntax

#define STDSEC_KEYLENGTH_RC4_V2 16

STDSEC_METHOD_AES_V1

Header: PDExpT.h:4342

Syntax

#define STDSEC_METHOD_AES_V1 5

STDSEC_METHOD_AES_V2

Header: PDExpT.h:4343

Syntax

#define STDSEC_METHOD_AES_V2 6

STDSEC_METHOD_AES_V3

Header: PDExpT.h:4345

Description

New encryption method for Acrobat 9.0

Syntax

#define STDSEC_METHOD_AES_V3 7

STDSEC_METHOD_RC4_V2

Header: PDExpT.h:4341

Syntax

#define STDSEC_METHOD_RC4_V2 2

kPDDocReadAheadAcroForms

Header: PDExpT.h:4066

Description

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).

Syntax

#define kPDDocReadAheadAcroForms 0x0001

kPDDocReadAheadPageLabels

Header: PDExpT.h:4082

Description

Requests that the PDF file's page label data be read ahead, before the viewer needs it. There is currently no page label hint table defined, so this flag simply causes the rest of the file to be read.

Syntax

#define kPDDocReadAheadPageLabels 0x0004

kPDDocReadAheadRenditions

Header: PDExpT.h:4093

Syntax

#define kPDDocReadAheadRenditions 0x0010

kPDDocReadAheadStructure

Header: PDExpT.h:4089

Description

Requests that the PDF file's logical structure data be read ahead, before the viewer needs it. There is currently no logical structure hint table defined, so this flag simply causes the rest of the file to be read.

Syntax

#define kPDDocReadAheadStructure 0x0008

kPDDocReadAheadTemplates

Header: PDExpT.h:4074

Description

Requests that the PDF file's Forms Template data be read ahead, before the viewer needs it. There is currently no Template hint table defined, so this flag simply causes the rest of the file to be read.

Syntax

#define kPDDocReadAheadTemplates 0x0002

pdInfoCanCopy

Header: PDExpT.h:4278

Description

The document text and graphics can be copied to the clipboard.

Syntax

#define pdInfoCanCopy pdPermCopy

pdInfoCanEdit

Header: PDExpT.h:4273

Description

The document can be modified (for example, by adding notes, links, or bookmarks).

Related Methods

Syntax

#define pdInfoCanEdit pdPermEdit

pdInfoCanEditNotes

Header: PDExpT.h:4284

Description

The document's notes, but nothing else, can be modified.

Related Methods

Syntax

#define pdInfoCanEditNotes pdPermEditNotes

pdInfoCanPrint

Header: PDExpT.h:4267

Description

The document can be printed.

Syntax

#define pdInfoCanPrint pdPermPrint

pdInfoHasOwnerPW

Header: PDExpT.h:4262

Description

The document has an owner password.

Syntax

#define pdInfoHasOwnerPW pdPermSecure

pdInfoHasUserPW

Header: PDExpT.h:4257

Description

The document has a user password.

Syntax

#define pdInfoHasUserPW pdPermOpen

pdOpAddResource

Header: PDExpT.h:1024

Syntax

#define pdOpAddResource pdOpAddResources

pdOpRemoveResource

Header: PDExpT.h:1023

Syntax

#define pdOpRemoveResource pdOpRemoveResources

pdPermAll

Header: PDExpT.h:1415

Syntax

#define pdPermAll 0xFFFFFFFF

pdPermCopy

Header: PDExpT.h:1331

Description

The user can copy information from the document to the clipboard. In the document restrictions, this corresponds to the Content Copying or Extraction entry.

Syntax

#define pdPermCopy 0x10

pdPermEdit

Header: PDExpT.h:1324

Description

The user can edit the document more than adding or modifying text notes (see also pdPermEditNotes). In the Document Security dialog, this corresponds to the Changing the Document entry.

Syntax

#define pdPermEdit 0x08

pdPermEditNotes

Header: PDExpT.h:1338

Description

The user can add, modify, and delete text notes (see also pdPermEdit). In the document restrictions, this corresponds to the Authoring Comments and Form Fields entry.

Syntax

#define pdPermEditNotes 0x20

pdPermExt

Header: PDExpT.h:1353

Syntax

#define pdPermExt 0x80

pdPermOpen

Header: PDExpT.h:1304

Description

The user can open and decrypt the document.

Syntax

#define pdPermOpen 0x01

pdPermOwner

Header: PDExpT.h:1398

Description

The user is permitted to perform all operations, regardless of the permissions specified by the document. Unless this permission is set, the document's permissions will be reset to those in the document after a full save.

Syntax

#define pdPermOwner 0x8000

pdPermPrint

Header: PDExpT.h:1317

Description

The user can print the document. Page Setup access is unaffected by this permission, since that affects Acrobat's preferences- not the document's. In the Document Security dialog, this corresponds to the Printing entry.

Syntax

#define pdPermPrint 0x04

pdPermSaveAs

Header: PDExpT.h:1348

Description

The user can perform a Save As.... If both pdPermEdit and pdPermEditNotes are disallowed, Save will be disabled but Save As... will be enabled. The Save As... menu item is not necessarily disabled even if the user is not permitted to perform a Save As....

Note: This cannot be set by clients.

Syntax

#define pdPermSaveAs 0x40

pdPermSecure

Header: PDExpT.h:1309

Description

The user can change the document's security settings.

Syntax

#define pdPermSecure 0x02

pdPermSettable

Header: PDExpT.h:1421

Description

The OR of all operations that can be set by the user in the security restrictions (pdPermPrint + pdPermEdit + pdPermCopy + pdPermEditNotes).

Syntax

#define pdPermSettable ( pdPermPrint + pdPermEdit + pdPermCopy + pdPermEditNotes )

pdPermUser

Header: PDExpT.h:1426

Description

All permissions.

Syntax

#define pdPermUser ( pdPermAll - pdPermOpen - pdPermSecure )

pdPrivPermAccessible

Header: PDExpT.h:1372

Description

Overrides pdPermCopy to enable the Accessibility API. If a document is saved in Rev2 format (Acrobat 4.0 compatible), only the pdPermCopy bit is checked to determine the Accessibility API state.

Syntax

#define pdPrivPermAccessible 0x200

pdPrivPermDocAssembly

Header: PDExpT.h:1378

Description

Overrides various pdPermEdit bits and allows the following operations: page insert/delete/rotate and create bookmark and thumbnail.

Syntax

#define pdPrivPermDocAssembly 0x400

pdPrivPermFillandSign

Header: PDExpT.h:1365

Description

Overrides other PDPerm bits. It allows the user to fill in or sign existing form or signature fields.

Syntax

#define pdPrivPermFillandSign 0x100

pdPrivPermFormSpawnTempl

Header: PDExpT.h:1410

Description

This should be set if the user can spawn template pages. This bit will allow page template spawning even if pdPermEdit and pdPermEditNotes are clear.

Syntax

#define pdPrivPermFormSpawnTempl 0x20000

pdPrivPermFormSubmit

Header: PDExpT.h:1404

Description

This should be set if the user can submit forms outside of the browser. This bit is a supplement to pdPrivPermFillandSign.

Syntax

#define pdPrivPermFormSubmit 0x10000

pdPrivPermHighPrint

Header: PDExpT.h:1385

Description

This bit is a supplement to pdPermPrint. If it is clear (disabled) only low quality printing (Print As Image) is allowed. On UNIX platforms where Print As Image doesn't exist, printing is disabled.

Syntax

#define pdPrivPermHighPrint 0x800

PDDoc Enumerations

PDDocOCChangeTypes

Header: PDExpT.h:5772

Description

PDDocOCChangeType is an enumeration of types of changes to the optional content structures of a PDDoc. These types of changes may effect visibility in all PDOCContext objects. This enumeration is used in the PDDocOCWillChange() and PDDocOCDidChange() notifications. These notifications typically pass in the affected page, or PDAllPages if all pages may be affected.

Enum Constants

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

PDDocOptions

Header: PDExpT.h:2052

Description

An enumerated data type that specifies various file status attributes. These flags indicate the state of the document and whether it needs to be saved or deleted on close, and so on. The flags are used as a bit field. More than one value may be set. Some flags may be set or get only. Most can be either set or get.

Enum Constants

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)

PDDocRequestReasons

Header: PDExpT.h:6496

Description

This tells the callback why it is being called.

Value options for PDDocRequestReason.

Enum Constants

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.

PDDocSaveFlags

Header: PDExpT.h:1449

Description

Flags for the PDDocSave saveFlags parameter. All undefined flags should be set to zero.

Value options for PDSaveFlags.

Related Methods

Enum Constants

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 PDSaveFull is off.

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.

PDDocSaveFlags2

Header: PDExpT.h:1516

Description

More flags for the PDDocSave() 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.

Related Methods

Enum Constants

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.

PDLayoutModes

Header: PDExpT.h:2015

Description

A structure that defines the layout of a document. The layout can be set as the viewer's 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.

Enum Constants

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

PDOperations

Header: PDExpT.h:974

Description

An enumerated data type that specifies the type of changes that occurred for the PDDocPrintingTiledPage() and PDDocDidChangePages() notifications. Not all Did notifications have corresponding Will notifications.

Value options for PDOperation.

Enum Constants

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.

PDPermReqObjOptions

Header: PDExpT.h:4137

Description

Enum Constants

PDPermReqObjDoc=1
PDPermReqObjPage
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.

PDPermReqOprOptions

Header: PDExpT.h:4174

Description

An enumerated data type used to describe the target operation of a permissions request.

Value options for PDPermReqOpr.

Enum Constants

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

PDVertAlignments

Header: PDExpT.h:6550

Description

Value options for PDVertAlign.

Enum Constants

kPDVertTop=0
kPDVertCenter
kPDVertBottom

PDWatermarkOptions

Header: PDExpT.h:6601

Description

An enumerated data type that specifies how to draw watermark. In general, if zOrderTop is false, watermark will be drawn as a Form XObject, and if fixedPrint is true, watermark will be drawn as an annotation. If zOrderTop is true AND fixedPrint is false, then it could be drawn either way. If zOrderTop is false AND fixedPrint is true, then there is a conflict and the wtrmrkDrawOption can be used to indicate a preference. If wtrmrkDrawOption is set to kPDWatermarkAnnotation or kPDWatermarkFormXObject, then the options zOrderTop and fixedPrint are ignored.

Value options for PDWatermarkDrawOption.

Enum Constants

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.

PDDoc Typedefs

PDDoc

Header: PDBasicExpT.h:68

Description

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.

Related Methods

PDEnumDocs PDEnumDocs

Syntax

typedef struct _t_PDDoc *PDDoc;

Returned From

Used By

Used In

PDDocFlags

Header: PDExpT.h:103

Description

A signed int (which is never negative), for historical reasons.

Syntax

typedef ASInt32 PDDocFlags;

PDDocInsertPagesParams

Header: PDExpT.h:1915

Syntax

typedef struct _t_PDDocInsertPagesParams *PDDocInsertPagesParams;

PDDocOCChangeType

Header: PDExpT.h:5807

Description

PDDocOCChangeType is an enumeration of types of changes to the optional content structures of a PDDoc. These types of changes may effect visibility in all PDOCContext objects. This enumeration is used in the 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.

Syntax

typedef ASUns8 PDDocOCChangeType;

PDDocOpenParams

Header: PDExpT.h:1923

Description

A structure used by PDDocOpenWithParams() to specify file open information. The parameters are very similar to those in PDDocOpenEx() and PDDocOpenFromASFileEx().

Syntax

typedef struct _t_PDDocOpenParams *PDDocOpenParams;

Used By

PDDocRequestReason

Header: PDExpT.h:6510

Description

This tells the callback why it is being called.

For value options see PDDocRequestReasons.

Syntax

typedef ASEnum8 PDDocRequestReason;

Used By

PDDocSaveParams

Header: PDExpT.h:1831

Syntax

typedef struct _t_PDDocSaveParams *PDDocSaveParams;

Used By

PDDocVersion

Header: PDExpT.h:95

Description

A signed int (which is never negative), for historical reasons.

Syntax

typedef ASInt16 PDDocVersion;

Returned From

Used By

Used In

PDLayoutMode

Header: PDExpT.h:2041

Description

A structure that defines the layout of a document. The layout can be set as the viewer's 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.

Syntax

typedef ASEnum8 PDLayoutMode;

Returned From

Used By

PDPermReqObj

Header: PDExpT.h:4167

Description

Syntax

typedef ASUns32 PDPermReqObj;

Used By

PDPermReqOpr

Header: PDExpT.h:4246

Description

An enumerated data type used to describe the target operation of a permissions request.

For value options see PDPermReqOprOptions.

Syntax

typedef ASUns32 PDPermReqOpr;

Used By

PDPermReqStatus

Header: PDExpT.h:4106

Description

The set of valid PDPermRequestStatus values providing the status of PDDoc-related permissions methods.

Syntax

typedef ASInt16 PDPermReqStatus;

Returned From

PDPerms

Header: PDExpT.h:1436

Description

Constant values that specify permissions which allow operations on a document file.

Related Methods

Syntax

typedef ASUns32 PDPerms;

Returned From

Used By

Used In

PDPrintWhat

Header: PDExpT.h:5621

Description

Passed to the PDDocWillPrintDocInMode() notification to specify the type of print operation being performed.

For value options see PDPrintWhat_Options.

Syntax

typedef ASEnum8 PDPrintWhat;

Used In

PDSaveFlags

Header: PDExpT.h:1506

Description

Flags for the PDDocSave saveFlags parameter. All undefined flags should be set to zero.

For value options see PDDocSaveFlags.

Syntax

typedef ASEnum16 PDSaveFlags;

Used By

Used In

PDSaveFlags2

Header: PDExpT.h:1629

Description

This enumeration defines the flags used in the 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.

Syntax

typedef ASFlagBits PDSaveFlags2;

Used In

PDSmallFlagBits

Header: PDExpT.h:67

Description

A flag value for use in PDDocInsertPagesParams().

Related Methods

Syntax

typedef ASUns16 PDSmallFlagBits;

Used In

PDVertAlign

Header: PDExpT.h:6551

Description

For value options see PDVertAlignments.

Syntax

typedef ASEnum8 PDVertAlign;

Used In

PDWatermarkDrawOption

Header: PDExpT.h:6619

Description

An enumerated data type that specifies how to draw watermark. In general, if zOrderTop is false, watermark will be drawn as a Form XObject, and if fixedPrint is true, watermark will be drawn as an annotation. If zOrderTop is true AND fixedPrint is false, then it could be drawn either way. If zOrderTop is false AND fixedPrint is true, then there is a conflict and the wtrmrkDrawOption can be used to indicate a preference. If wtrmrkDrawOption is set to kPDWatermarkAnnotation or kPDWatermarkFormXObject, then the options zOrderTop and fixedPrint are ignored.

For value options see PDWatermarkOptions.

Syntax

typedef ASEnum8 PDWatermarkDrawOption;

Used In

StdPassword

Header: PDExpT.h:4291

Syntax

typedef char StdPassword [MAX_PWCHARS + 1];

Used In

PDDoc Callback Signatures

PDAuthProc

Header: PDExpT.h:1264

Syntax

ASBool PDAuthProc(PDDoc pdDoc);

Used By

PDAuthProcEx

Header: PDExpT.h:1298

Syntax

ASBool PDAuthProcEx(PDDoc pdDoc, void *clientData);

Used By

Used In

PDDocEnumProc

Header: PDExpT.h:3666

Description

A callback for PDEnumDocs(). It is called once for each open PDDoc.

Syntax

ASBool PDDocEnumProc(PDDoc pdDoc, void *clientData);

Parameters

pdDoc
IN/OUT The PDDoc currently being enumerated.
clientData
IN/OUT User-supplied data that was passed in the call to PDEnumDocs().

Returns

true to continue enumeration, false to halt enumeration.

Used By

PDDocPreSaveProc

Header: PDExpT.h:1661

Description

A callback in the PDDocSaveParams structure used by PDDocSaveWithParams(). Use this callback to flag Cos objects you wish to access while a PDDoc is being saved.

Related Methods

Syntax

void PDDocPreSaveProc(PDDoc pdDoc, PDDocPreSaveInfo preSaveInfo, void *clientData);

Parameters

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.

Used In

PDDocPreWriteProc

Header: PDExpT.h:1671

Description

A callback in the PDDocSaveParams structure. It is invoked by PDDocSaveWithParams() immediately before a PDDoc is saved to disk.

Related Methods

Syntax

void PDDocPreWriteProc(PDDoc pdDoc, void *clientData);

Parameters

pdDoc
The PDDoc to be saved.
clientData
User-supplied data that was specified in preWriteProcClientData of the PDDocSaveParams structure.

Used In

PDDocRequestEntireFileProc

Header: PDExpT.h:6534

Description

A callback used by PDDocRequestEntireFile. Use this callback to process a document file.

Syntax

ASInt32 PDDocRequestEntireFileProc(PDDoc pdDoc, PDDocRequestReason reason, void *clientData);

Parameters

pdDoc
The PDDoc to be saved.
reason
clientData
User-supplied data passed in the PDDocRequestPages() method.

Returns

0 when successful, a non-zero error code otherwise.

Used By

PDDocRequestPagesProc

Header: PDExpT.h:6513

Description

A callback for PDDocRequestPages().

Syntax

ASInt32 PDDocRequestPagesProc(PDDoc pdDoc, ASInt32 startPage, ASInt32 nPages, PDDocRequestReason reason, void *clientData);

Used By

PDDocWillExportAnnotCallback

Header: PDExpT.h:6201

Description

A callback for PDDocExportNotes. It determines whether an annotation is exported.

Note: This is a different callback than PDDocWillExportAnnotProc().

Syntax

ASBool PDDocWillExportAnnotCallback(PDDoc doc, PDPage pdpage, PDAnnot src, CosObj dict);

Parameters

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.

Returns

true to export the annotation, false to not export the annotation.

Used By

PDDocWillExportAnnotProc

Header: PDExpT.h:628

Description

A callback for PDAnnotHandler. It determines whether an annotation is exported.

Note: This is a different callback than PDDocWillImportAnnotCallback().

Syntax

ASBool PDDocWillExportAnnotProc(PDAnnotHandler pdanh, PDAnnot src, PDAnnot dst);

Parameters

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.

Returns

true to export dst, false to not export dst.

Used In

PDDocWillImportAnnotCallback

Header: PDExpT.h:6218

Description

A callback for PDDocImportCosDocNotes() and PDDocImportNotes(). It determines whether an annotation will be imported.

Note: This is a different callback than PDDocWillImportAnnotProc().

Syntax

ASBool PDDocWillImportAnnotCallback(PDDoc doc, PDPage pdPage, PDAnnot annot);

Parameters

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.

Returns

true to import the annotation, false to not import the annotation.

Used By

PDDocWillImportAnnotProc

Header: PDExpT.h:646

Description

A callback for PDAnnotHandler. It determines whether an annotation will be imported.

Note: This is a different callback than PDDocWillImportAnnotCallback().

Syntax

ASBool PDDocWillImportAnnotProc(PDAnnotHandler pdanh, PDDoc doc, PDPage pdpage, PDAnnot annot);

Parameters

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.

Returns

true to import annot, false to not import annot.

Used In

PDDoc Structures

_s_PDAnnotArray

Header: PDExpT.h:6358

Description

Used by PDDocExportSomeNotes(). It represents an array of PDAnnot objects.

Syntax

struct _s_PDAnnotArray {
ASTArraySize annotCount;
The annotation count.
PDAnnot *annots;
A pointer to an array of PDAnnots.
} PDAnnotArrayRec, *PDAnnotArray;

Used By

_t_PDApplyRedactionParams

Header: PDExpT.h:6924

Description

Parameters used for applying redaction marks.

Syntax

struct _t_PDApplyRedactionParams {
ASUns32 size;
The size of the data structure.
PDAnnot *redactionAnnots;
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.
ASUns32 redactionCount;
The number of redaction marks in redactionAnnots. This value is ignored if redactionAnnots is NULL.
ASBool keepMarks;
A boolean value indicating that the redaction marks themselves should be not removed.
ASStatusMonitorProcs statusProcs;
A set of callbacks for providing feedback to the caller. It may be NULL.
ASText progressText;
The text to be displayed for the progress monitor in statusProcs. It may be NULL. This value is ignored if statusProcs is NULL.
ASInt32 progressDuration;
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.
} PDApplyRedactionParamsRec, *PDApplyRedactionParams;

Used By

_t_PDDocAddWatermarkParams

Header: PDExpT.h:6626

Description

Parameters used for adding and describing watermarks.

Syntax

struct _t_PDDocAddWatermarkParams {
ASSize_t size;
The size of the data structure.
PDPageRange targetRange;
The page range of the document to which the watermark should be added.
ASBool fixedPrint;
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.
ASBool zOrderTop;

A boolean specifying where in the page z-order the watermark should be added. If it is true, the watermark is added to the front of the page; otherwise, it is added as a background.

This parameter is ignored if fixedPrint is true, as all FixedPrint watermarks are added to the front of the page.

ASBool showOnScreen;
A boolean specifying whether the watermark should be visible when viewing on screen.
ASBool showOnPrint;
A boolean specifying whether the watermark should be printed.
PDHorizAlign horizAlign;
The horizontal alignment to be used when adding the watermark to a page.
PDVertAlign vertAlign;
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.
ASBool percentageVals;
A boolean specifying the units of horizValue and vertValue. If it is true, horizValue and vertValue represent percentages of the page dimensions. Otherwise horizValue and vertValue are 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 private data to be passed to progMon. This parameter is ignored if progMon is NULL.
ASCancelProc cancelProc;
The cancel procedure to be checked when adding the watermark. It may be NULL.
void *cancelProcData;
The private data to be passed to cancelProc. This parameter is ignored if cancelProc is NULL.
PDWatermarkDrawOption wtrmrkDrawOption;
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.
ASBool ignoreArtBoxForPDFPageWatermark;
The default behavior for adding a Watermark from a PDF Page is to use the Page's /ArtBox if present, and otherwise use the /CropBox. When set to false, the ArtBox is used when present. When set to true, the ArtBox is ignored.
} PDDocAddWatermarkParamsRec, *PDDocAddWatermarkParams;

Used By

_t_PDDocCopyParams

Header: PDExpT.h:6225

Description

A structure used by PDDocCopyToFile() to specify file copy information.

Syntax

struct _t_PDDocCopyParams {
ASSize_t size;
The size of the data structure. It must be set to sizeof(PDDocCopyParamsRec).
ASPathName newPath;
The path name to copy to, specified in whatever format is correct for fileSys.
ASFileSys fileSys;
A pointer to an ASFileSysRec containing the file system that does the copy.
A progress monitor. It may be NULL
void *progMonData;
A pointer to user-supplied data to pass to progMon each time it is called. It must be NULL if progMon is NULL.
ASCancelProc cancelProc;
A cancel procedure. It may be NULL.
void *cancelProcData;
A pointer to user-specified data to pass to cancelProc each time it is called. It must be NULL if cancelProc is NULL.
ASBool saveChanges;
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.
} PDDocCopyParamsRec, *PDDocCopyParams;

Used By

_t_PDDocInsertPagesParams

Header: PDExpT.h:1838

Description

A structure used to pass information to the PDDocWillInsertPagesEx() and PDDocDidInsertPagesEx() notifications.

Related Methods

Syntax

struct _t_PDDocInsertPagesParams {
ASSize_t size;
The size of the data structure. It must be set to sizeof(PDDocInsertPagesParamsRec).
PDDoc targetDoc;
The document into which pages are inserted. This document must have at least one page.
PDPageNumber insertAfterThisPage;
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.
PDDoc srcDoc;
The document containing the pages that are inserted into targetDoc.
PDPageNumber srcFromPage;
The page number of the first page in srcDoc to insert into targetDoc. The first page is 0.
PDPageNumber srcToPage;
The page number of the last page in srcDoc to insert into targetDoc.
PDSmallFlagBits insertFlags;
Flags that determine what additional information is copied from srcDoc into targetDoc. It must be an OR of the following:
Flag
Description
Inserts the entire document srcDoc into the document targetDoc. This operation not only inserts the pages themselves, but also merges other document data from srcDoc into targetDoc. In particular, the following happens:
  • The bookmark tree of srcDoc is merged into the bookmark tree of targetDoc by copying it as a new first-level sub-tree of the targetDoc object's bookmark tree root, of which it becomes the last child. If targetDoc has no bookmark tree, it acquires one identical to the bookmark tree from srcDoc.
  • Named destinations from srcDoc are copied into targetDoc. If there are named destinations in srcDoc with the same name as some named destination in targetDoc, the ones in targetDoc 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 targetDoc.
  • Document logical structure from srcDoc is copied into targetDoc. The top-level children of the structure tree root of srcDoc are copied as new top-level children of the structure tree root of targetDoc; a structure tree root is created in targetDoc 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 targetDoc. Attribute objects are not copied, nor is class map information from srcDoc merged into that for targetDoc.

    If the PDInsertAll flag is not set, pages copied from srcDoc into targetDoc will have their structure back-pointer information stripped off.

  • Inserts bookmarks as well as pages.
    Inserts threads as well as pages.
    ASErrorCode error;
    An error code which is only valid for the PDDocDidInsertPagesEx() notification.
    } PDDocInsertPagesParamsRec;

    Used In

    _t_PDDocOpenParams

    Header: PDExpT.h:1930

    Description

    A structure used by PDDocOpenWithParams() to specify file open information. The parameters are very similar to those in PDDocOpenEx() and PDDocOpenFromASFileEx().

    Related Methods

    Syntax

    struct _t_PDDocOpenParams {
    ASSize_t size;
    The size of the data structure. It must be set to sizeof(PDDocOpenParamsRec).
    ASFile file;
    The path name to the file, specified in whatever format is correct for fileSys.
    ASPathName fileName;
    The path name to the file, specified in whatever format is correct for fileSys.
    ASFileSys fileSys;
    A pointer to an ASFileSysRec containing the file system in which the file resides.
    PDAuthProcEx 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). 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.
    ASBool doRepair;
    If true, attempt to repair the file if it is damaged; if false, do not attempt to repair the file if it is damaged.
    PDPerms restrictPerms;
    The permissions to remove from the document.
    } PDDocOpenParamsRec;

    Used In

    _t_PDDocPreSaveInfo

    Header: PDExpT.h:1640

    Description

    A structure used to flag Cos objects you wish to access while a PDDoc is being saved. It contains a pointer to a CosObjSetCallbackFlagProc(). In your pre-save callback, you can use this exposed proc to set a flag in the CosObj objects that you care about, so that your callback will be called back during the save and given their offset and length.

    Syntax

    struct _t_PDDocPreSaveInfo {
    ASSize_t size;
    The size of structure. Set it to sizeof(PDDocPreSaveInfoRec).
    } PDDocPreSaveInfoRec, *PDDocPreSaveInfo;

    Used By

    _t_PDDocSaveParams

    Header: PDExpT.h:1680

    Description

    Parameters used when saving a file with PDDocSaveWithParams() and returned by the PDDocWillSaveEx() notification. Most of these parameters are the same as the parameters for PDDocSave().

    Related Methods

    Syntax

    struct _t_PDDocSaveParams {
    ASSize_t size;
    Set this to be the size of this struct.
    PDSaveFlags saveFlags;
    It must be one of the PDSaveFlags values.
    ASPathName 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.

    ASFileSys fileSys;
    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 pointer to user-supplied data to pass to mon each time it is called. It must be NULL if mon is NULL.
    ASCancelProc cancelProc;
    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 pointer to user-specified data to pass to cancelProc each time it is called. It must be NULL if cancelProc is NULL.
    PDDocPreSaveProc preSaveProc;
    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.
    CosObjOffsetProc offsetProc;
    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.
    PDDocVersion major;
    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.
    PDDocVersion minor;
    The minor PDF version number of the document.
    ASBool XMPPacketReadOnly;
    If true, it makes the XML packet containing the XMP metadata for the document read-only and suppresses the generation of padding. If false, the XML packet is made writable and the number of padding bytes specified by the value of the XMPPacketPaddingBytes field is included in the XML packet.
    ASInt32 XMPPacketPaddingBytes;
    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.
    PDDocPreWriteProc preWriteProc;
    A callback that is called just before the document is written to disk.
    void *preWriteProcClientData;
    Client data to pass to the pre-write proc.
    PDSaveFlags2 saveFlags2;
    More flags for PDDocSave().
    ASUns32 numSubFilesToCompact;

    The number of incremental saves to compact. It will eliminate the last numSubFilesToCompact subFiles (as opposed to the update section, which does not always correspond to a valid subFile), and merge the changes in them into the current append save.

    This parameter is taken into account only if:

    • The current save operation is an incremental save AND
    • The current save operation is a saveAs.

    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.

    CosObjOffsetProc64 offsetProc64;
    A 64-bit callback to get information about Cos objects while the PDDoc is being saved.
    } PDDocSaveParamsRec;

    Used In

    _t_PDDocWatermarkTextParams

    Header: PDExpT.h:6557

    Description

    Parameters used for describing text-based watermarks.

    Syntax

    struct _t_PDDocWatermarkTextParams {
    ASSize_t size;
    The size of the data structure.
    ASText srcText;
    The text to be used when generating a text-based watermark.
    PDHorizAlign textAlign;
    The alignment to be used when justifying a text-based watermark.
    PDEFont pdeFont;
    The PDEFont to be used when generating a text-based watermark. If it is NULL, the font specified by sysFontName will be used.
    ASAtom sysFontName;
    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.
    } PDDocWatermarkTextParamsRec, *PDDocWatermarkTextParams;

    Used By

    _t_StdSecurityData

    Header: PDExpT.h:4297

    Description

    A structure describing the data for the standard security handler provided in the Acrobat viewer.

    Syntax

    struct _t_StdSecurityData {
    ASSize_t size;
    The size of this stucture.
    ASBool newUserPW;
    true if the user password should be changed.
    ASBool hasUserPW;
    true if there is a user password.
    StdPassword userPW;
    The user password.
    ASBool newOwnerPW;
    true if the owner password should be changed, false otherwise.
    ASBool hasOwnerPW;
    true if an owner password is provided, false otherwise.
    StdPassword ownerPW;
    The owner password.
    PDPerms perms;
    The permissions to allow.
    Int32 keyLength;
    The encryption key length in bytes.
    Int32 revision;
    Indicates a /R value.
    ASBool encryptMetadata;
    A flag that indicates whether document metadata will be encrypted.
    Int32 encryptMethod;

    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:

    Value

    Description
    CF_METHOD_RC4_V2
    Use the RC4 algorithm for encryption.
    CF_METHOD_AES_V1
    Use the AES algorithm for encryption with a zero initialization vector.
    CF_METHOD_AES_V2
    Use the AES algorithm for encryption with a 16 byte random initialization vector.
    CF_METHOD_AES_V3
    Use the AES algorithm for encryption with a 4 byte random initialization vector.
    ASBool encryptAttachmentsOnly;
    A flag to indicate that only attachments are encrypted. encryptMetadata and encryptAttachmentsOnly cannot both be true.
    Int32 version;
    Indicates a /V value. New for Acrobat 9.0.
    } StdSecurityDataRec, *StdSecurityData;

    PDDoc Functions

    PDDocAcquire

    Header: PDProcs.h:1395

    Description

    Increments a document's reference count. The document will not be closed until the reference count is zero, or the application terminates.

    Related Methods

    Syntax

    void PDDocAcquire(PDDoc doc);

    Parameters

    doc
    IN/OUT The document whose reference count is incremented.

    PDDocAcquirePage

    Header: PDProcs.h:1566

    Description

    Gets a PDPage from a document. It increments the page's reference count. After you are done using the page, release it using PDPageRelease(). If PDPageRelease() is not called, it could block the document containing the page from being closed. To avoid such problems, use the CSmartPDPage class, as it ensures that the page is released as it goes out of scope.

    Related Methods

    Syntax

    PDPage PDDocAcquirePage(PDDoc doc, ASInt32 pageNum);

    Parameters

    doc
    The document containing the page to acquire.
    pageNum
    The page number of the page to acquire. The first page is 0.

    Returns

    The acquired page.

    Exceptions

    PDDocAddJobID

    Header: PDProcs.h:12894

    Description

    Adds a print job identifier, or JobId, from the print job to the PDDoc's list of associated jobIds.

    Syntax

    void PDDocAddJobID(PDDoc doc, ASInt32 jobId);

    Parameters

    doc
    The document whose jobId is being set.
    jobId
    The job Id being added to the document's list of job ids.

    PDDocAddThread

    Header: PDProcs.h:1869

    Description

    Adds an article thread to a document after the specified thread index.

    Syntax

    void PDDocAddThread(PDDoc doc, ASInt32 addAfterIndex, PDThread thread);

    Parameters

    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.

    PDDocAddWatermarkFromPDPage

    Header: PDProcs.h:11358

    Description

    Adds a PDPage as a watermark to a page range in the given document.

    Syntax

    void PDDocAddWatermarkFromPDPage(PDDoc pdDoc, PDPage pdPage, PDDocAddWatermarkParamsRec *pParams);

    Parameters

    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.

    PDDocAddWatermarkFromText

    Header: PDProcs.h:11366

    Description

    Adds a text-based watermark to a page range in the given document.

    Syntax

    void PDDocAddWatermarkFromText(PDDoc pdDoc, PDDocWatermarkTextParamsRec *pTextParams, PDDocAddWatermarkParamsRec *pParams);

    Parameters

    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.

    PDDocApplyRedactions

    Header: PDProcs.h:11985

    Description

    Applies a set of redaction marks to the document, permanently removing the affected document content and the marks themselves.

    Syntax

    ASBool PDDocApplyRedactions(PDDoc pdDoc, PDApplyRedactionParams applyParams);

    Parameters

    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.

    Returns

    true if the document's content was changed, false otherwise.

    Exceptions

    is raised if any specified redaction marks are invalid

    PDDocAuthorize

    Header: PDProcs.h:2441

    Description

    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.

    Syntax

    PDPerms PDDocAuthorize(PDDoc pdDoc, PDPerms permsWanted, void *authData);

    Parameters

    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.

    Returns

    The 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.

    Exceptions

    is raised if no security handler is associated with pdDoc. It also raises whatever exceptions are raised by the security handler's PDCryptAuthorizeProc() callback.

    PDDocCalculateImplicitMetadata

    Header: PDMetadataProcs.h:278

    Description

    Notifies all registered implicit metadata calculators to run. It issues the notification PDDocCalculateMetadata(), passing pdDoc to all registered handlers.

    Related Methods

    Syntax

    void PDDocCalculateImplicitMetadata(IN PDDoc pdDoc);

    Parameters

    pdDoc
    The document for which implicit metadata is calculated.

    PDDocClearErrors

    Header: PDProcs.h:12786

    Description

    Clears all the non-fatal errors encountered since the document was opened, or PDDocClearErrors was called.

    Syntax

    void PDDocClearErrors(PDDoc doc);

    Parameters

    doc
    The document in which the non-fatal errors have occurred.

    PDDocClearFlags

    Header: PDProcs.h:5452

    Description

    Clears flags associated with a document. This method is most frequently used to mark a modified document as clean (by clearing the PDDocNeedsSave flag) to avoid bringing up the Save dialog box when the file is closed.

    Syntax

    void PDDocClearFlags(PDDoc doc, ASInt32 flags);

    Parameters

    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.

    PDDocClose

    Header: PDProcs.h:1384

    Description

    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().

    Syntax

    void PDDocClose(PDDoc doc);

    Parameters

    doc
    The document to close.

    Exceptions

    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.

    PDDocCopyToFile

    Header: PDProcs.h:7854

    Description

    This method copies bytes from a document's ASFile to a specified location. This also happens if the saveChanges field is set to "false." If saveChanges is set to "true," and the user has opened the file in Adobe Acrobat, a full save is completed for the file. That way, if the version of the document in system memory is more current than the original version on the disk drive (the original version of the file is stale, or 'dirty'), the save process assembles all of the recent changes to the document and applies them to the final saved copy. The resulting file is linearized, or optimized for display in a web browser. If the file already exists, it is overwritten.

    Syntax

    void PDDocCopyToFile(PDDoc pdDoc, PDDocCopyParams params);

    Parameters

    pdDoc
    The document to copy.
    params
    A structure that defines how the PDF file is copied.

    Exceptions

    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 the save was canceled ( cancelProc in params returned true).
    is raised if a read error occurred on the source.
    is raised if a write error occurred on the destination.

    PDDocCreate

    Header: PDProcs.h:1283

    Description

    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().

    Syntax

    PDDoc PDDocCreate(void);

    Returns

    The newly created document.

    PDDocCreateNameTree

    Header: PDProcs.h:7109

    Description

    Retrieves the name tree inside the Names dictionary with the specified key name, or creates it if it does not exist.

    Syntax

    PDNameTree PDDocCreateNameTree(PDDoc thePDDoc, ASAtom theTree);

    Parameters

    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().

    Returns

    The newly created PDNameTree for the PDDoc. It returns a NULL PDNameTree if pdDoc has no root dictionary. The return value should be tested with PDNameTreeIsValid().

    PDDocCreatePDCollection

    Header: PDProcs.h:12378

    Description

    Creates a collection in a document. It replaces any existing collection.

    Syntax

    PDCollection PDDocCreatePDCollection(PDDoc pdDoc);

    Parameters

    pdDoc
    The document that will host the new collection.

    Returns

    The new collection object.

    PDDocCreatePage

    Header: PDProcs.h:1591

    Description

    Creates and acquires a new page. The page is inserted into the document at the specified location. Call PDPageRelease() when you are done using the page.

    Syntax

    PDPage PDDocCreatePage(PDDoc doc, ASInt32 afterPageNum, ASFixedRect mediaBox);

    Parameters

    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.

    Returns

    The newly created page.

    PDDocCreateRedaction

    Header: PDProcs.h:12000

    Description

    Creates a redaction mark on a given page. The resulting annotation will be added to the page, but the affected content will not be removed until PDDocApplyRedactions is called with this mark.

    Syntax

    PDAnnot PDDocCreateRedaction(PDDoc pdDoc, PDRedactParams redactionProps);

    Parameters

    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.

    Returns

    The new annotation representing the redaction mark.

    Exceptions

    is raised if redactionProps is NULL or if contains an invalid page number or an empty list of quads.

    PDDocCreateTextSelect

    Header: PDProcs.h:2285

    Description

    Creates a text selection that includes all words totally or partially enclosed by a rectangle. The text selection can then be set as the current selection using AVDocSetSelection().

    Note: When this method is used to create a text selection on a rotated page, you must pass in a rotated boundingRect.

    Syntax

    PDTextSelect PDDocCreateTextSelect(PDDoc doc, ASInt32 pageNum, ASFixedRect *boundingRect);

    Parameters

    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.

    Returns

    The newly created text selection.

    PDDocCreateTextSelectUCS

    Header: PDProcs.h:12953

    Description

    Creates a text selection that includes all words totally or partially enclosed by a rectangle. The text selection can then be set as the current selection using AVDocSetSelection().

    Note: When this method is used to create a text selection on a rotated page, you must pass in a rotated boundingRect.

    Syntax

    PDTextSelect PDDocCreateTextSelectUCS(PDDoc doc, ASInt32 pageNum, ASFixedRect *fxBoundingRectP);

    Parameters

    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.

    Returns

    The newly created text selection.

    PDDocCreateThumbs

    Header: PDProcs.h:2010

    Description

    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.

    Related Methods

    Syntax

    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);

    Parameters

    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
      IN/OUT Used only for indexed color space; pass 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):
    • sizeof(ASUns8)
    • 3, where the 3 arises because an RGB color space has three color components.
    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
    IN/OUT A user-supplied data to pass to progMon each time it is called. It should be NULL if progMon is NULL.
    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
    IN/OUT A user-supplied data to pass to cancelProc each time it is called. It should be NULL if cancelProc is NULL.

    PDDocCreateWordFinder

    Header: PDProcs.h:2206

    Description

    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:

    • fi
    • ff
    • fl
    • ffi
    • ffl
    • ch
    • cl
    • ct
    • ll
    • ss
    • fs
    • st
    • oe
    • OE

    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

    Syntax

    PDWordFinder PDDocCreateWordFinder(PDDoc doc, ASUns16 *outEncInfo, char **outEncVec, char **ligatureTbl, ASInt16 algVersion, ASUns16 rdFlags, void *clientData);

    Parameters

    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 NULL-terminated strings that are the glyph names in encoding order. See the discussion of character names in the PostScript Language Reference Manual. https://www.adobe.com/jp/print/postscript/pdfs/PLRM.pdf If outEncVec is NULL, the platform's default encoding vector is used. For non-UNIX Roman systems, it is WinAnsiEncoding on Windows and MacRomanEncoding on Mac OS. On UNIX (except HP-UX) Roman systems, it is ISO8859-1 (ISO Latin-1); for HP-UX, it is HP-ROMAN8.

    For descriptions of WinAnsiEncoding and MacRomanEncoding, and PDFDocEncoding, see Annex D, "Character Sets and Encodings, in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, page 651.

    You can find this document on the web store of the International Standards Organization (ISO).

    Use this parameter with outEncInfo. See outEncInfo for more information.

    ligatureTbl
      A 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:
    • fi
    • ff
    • fl
    • ffi
    • ffl
    • ch
    • cl
    • ct
    • ll
    • ss
    • fs
    • st
    • oe
    • OE
    algVersion
    The version of the word-finding algorithm to use (see PDExpT.h), as follows (pass 0 if your client does not care):
    Version
    Description
    To obtain the latest available version.
    Version used for Acrobat 3.x, 4.x.
    Available in Acrobat 5.0 without accessibility enabled. Includes some improved word-piecing algorithms.
    For Acrobat 5.0 with accessibility enabled. Includes advanced word-ordering algorithms in addition to improved word-piecing algorithms.
    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.

    Returns

    The newly created word finder.

    PDDocCreateWordFinderEx

    Header: PDProcs.h:8450

    Description

    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().

    Syntax

    PDWordFinder PDDocCreateWordFinderEx(PDDoc doc, ASInt16 algVersion, ASBool outUnicode, PDWordFinderConfig wbConfig);

    Parameters

    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):
    Annotation
    Use
    To obtain latest available version.
    Version used for Acrobat 3.x, 4.x.
    Available in Acrobat 5.0 and 6.0 without Tagged PDF support.
    For Acrobat 5.0 and 6.0 with Tagged PDF support.
    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.

    Returns

    The newly created word finder object.

    PDDocCreateWordFinderUCS

    Header: PDProcs.h:6646

    Description

    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.

    Syntax

    PDWordFinder PDDocCreateWordFinderUCS(PDDoc doc, ASInt16 algVersion, ASUns16 rdFlags, void *clientData);

    Parameters

    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.

    Returns

    The newly created word finder.

    PDDocDeleteCollection

    Header: PDProcs.h:12383

    Description

    Removes a collection dictionary from a document.

    Syntax

    void PDDocDeleteCollection(PDDoc pdDoc);

    Parameters

    pdDoc
    The document whose collection dictionary is to be removed.

    PDDocDeletePages

    Header: PDProcs.h:1616

    Description

    Deletes the specified pages.

    Syntax

    void PDDocDeletePages(PDDoc doc, ASInt32 firstPage, ASInt32 lastPage, ProgressMonitor progMon, void *progMonClientData);

    Parameters

    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
    A pointer to user-supplied data passed to progMon each time it is called. It should be NULL if progMon is NULL.

    PDDocDeleteThumbs

    Header: PDProcs.h:2034

    Description

    Deletes thumbnail images for a range of pages in a document.

    Related Methods

    Syntax

    void PDDocDeleteThumbs(PDDoc doc, ASInt32 firstPage, ASInt32 lastPage, ProgressMonitor progMon, void *progMonClientData);

    Parameters

    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
    IN/OUT A pointer to user-supplied data to pass to progMon. It should be NULL if progMon is NULL.

    PDDocEnumFonts

    Header: PDProcs.h:1911

    Description

    Enumerates all the fonts in the specified page range. This may take a considerable amount of time for a large page range.

    Related Methods

    Syntax

    void PDDocEnumFonts(PDDoc doc, ASInt32 firstPage, ASInt32 lastPage, PDFontEnumProc eproc, void *clientData, ProgressMonitor progMon, void *progMonClientData);

    Parameters

    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
    A pointer to user-supplied data to pass to progMon each time it is called. It should be NULL if progMon is NULL.

    PDDocEnumLoadedFonts

    Header: PDProcs.h:1931

    Description

    Enumerates all the fonts that have been encountered so far. A font is loaded when a page that uses it is processed. This typically happens when a page is drawn or its thumbnail image is created.

    Related Methods

    Syntax

    void PDDocEnumLoadedFonts(PDDoc doc, PDFontEnumProc proc, void *clientData);

    Parameters

    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.

    PDDocEnumOCConfigs

    Header: PDProcs.h:10345

    Description

    Enumerates the optional-content configurations for the document, calling the supplied procedure for each one. These include the configuration for the D configuration dictionary and those for all entries in the Configs array dictionary.

    Syntax

    void PDDocEnumOCConfigs(PDDoc pdDoc, PDOCConfigEnumProc enumProc, void *clientData);

    Parameters

    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.

    PDDocEnumOCGs

    Header: PDProcs.h:9233

    Description

    Enumerates the optional-content groups for the document, calling the supplied procedure for each one. Enumeration continues until all groups have been enumerated, or until enumProc returns false. Each group is reported once, even if it is referenced multiple times in a page, or on multiple pages.

    Syntax

    void PDDocEnumOCGs(PDDoc pdDoc, PDOCGEnumProc enumProc, void *clientData);

    Parameters

    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.

    PDDocEnumResources

    Header: PDProcs.h:6808

    Description

    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.

    Syntax

    void PDDocEnumResources(PDDoc pdDoc, ASInt32 startPage, ASInt32 endPage, ASAtom resourceType, CosObjEnumProc enumProc, void *clientData);

    Parameters

    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.

    Exceptions

    PDDocExportNotes

    Header: PDProcs.h:6867

    Description

    Creates a document containing empty pages plus text annotations (notes) from sourceDoc. It does not create a new document if sourceDoc contains no notes.

    Syntax

    CosDoc PDDocExportNotes(PDDoc doc, ASFileSys unused1, ASPathName unused2, void *unused3, /* ASProgressMonitor */ void *unused4, PDDocWillExportAnnotCallback exportFilter, ASInt32 *numNotesP);

    Parameters

    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.

    Returns

    The CosDoc of the document created to hold the exported notes.

    PDDocExportSomeNotes

    Header: PDProcs.h:8170

    Description

    Like PDDocExportNotes(), but the caller provides the list of annotations to export. This is useful in scenarios when it may be inappropriate to use PDDocExportNotes() and look for annotations on every page. This is an especially important consideration when in a browser.

    Note: Make sure to explicitly include popups.

    Syntax

    CosDoc PDDocExportSomeNotes(PDDoc doc, ASFileSys unused1, ASPathName unused2, void *unused3, /* ASProgressMonitor */ void *unused4, PDDocWillExportAnnotCallback exportFilter, PDAnnotArray pdanArray, ASInt32 *numNotesP);

    Parameters

    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.

    Returns

    The CosDoc of the document created to hold the exported notes.

    PDDocFindPageNumForLabel

    Header: PDProcs.h:7416

    Description

    Superseded by PDDocFindPageNumForLabelEx() in Acrobat 6.0.

    Finds the first page in the document with a specified label.

    Syntax

    ASInt32 PDDocFindPageNumForLabel(PDDoc pdDoc, const char *labelStr, ASInt32 labelLen);

    Parameters

    pdDoc
    The document to search for the page named in labelStr.
    labelStr
    The label of the page to find.
    labelLen
    The length of labelStr.

    Returns

    The page number of the first page with the specified label, or-1 if no such page exists.

    PDDocFindPageNumForLabelEx

    Header: PDProcs.h:11142

    Description

    Supersedes PDDocFindPageNumForLabel in Acrobat 6.0.

    Finds the first page in the document with a specified label.

    Syntax

    ASInt32 PDDocFindPageNumForLabelEx(PDDoc pdDoc, ASConstText labelText);

    Parameters

    pdDoc
    The document to search for the page named in labelStr.
    labelText
    The label of the page to find.

    Returns

    The page number of the first page with the specified label, or-1 if no such page exists.

    PDDocFlattenOC

    Header: PDProcs.h:10531

    Description

    Replaces the contents of every page in the document with a version that has no optional content, containing only what was visible on the page when the call was made, and removes all other optional-content information.

    Syntax

    ASBool PDDocFlattenOC(PDDoc pdDoc, PDOCContext context);

    Parameters

    pdDoc
    The document to be modified.
    context
    The optional-content context in which content is checked for visibility.

    Returns

    true if the operation is successful, false otherwise.

    PDDocFromCosDoc

    Header: PDProcs.h:6768

    Description

    Gets the PDDoc associated with a CosDoc.

    Syntax

    PDDoc PDDocFromCosDoc(CosDoc cosDoc);

    Parameters

    cosDoc
    The Cos-level document object for which a PDDoc is obtained. This object represents the PDF.

    Returns

    The PDDoc associated with cosDoc.

    Exceptions

    is raised if the CosDoc is not valid.
    is raised if there is no PDDoc associated with this CosDoc.

    PDDocGetAdobePDFVersion

    Header: PDProcs.h:12860

    Description

    PDDocGetAdobePDFVersion() returns the current version of the document in the AdobePDFVersion define in CosExp.T

    Syntax

    AdobePDFVersion PDDocGetAdobePDFVersion(PDDoc doc);

    Parameters

    doc
    IN/OUT The document whose version is obtained.

    Returns

    current version of document.

    PDDocGetBookmarkRoot

    Header: PDProcs.h:1536

    Description

    Gets the root of the document's bookmark tree. The return value is valid even if the document's bookmark tree is empty (meaning that there is no Outlines key in the underlying PDF file).

    Syntax

    PDBookmark PDDocGetBookmarkRoot(PDDoc pdDoc);

    Parameters

    pdDoc
    IN/OUT Document whose root bookmark is obtained.

    Returns

    The document's root bookmark.

    PDDocGetCosDoc

    Header: PDProcs.h:1468

    Description

    Gets a document's Cos-level document object.

    Related Methods

    Syntax

    CosDoc PDDocGetCosDoc(PDDoc doc);

    Parameters

    doc
    The document whose CosDoc is obtained.

    Returns

    The document's CosDoc.

    PDDocGetCryptHandler

    Header: PDProcs.h:11406

    Description

    Gets the specified document's current security handler (that is, the security handler that was used to open the document).

    Syntax

    ASAtom PDDocGetCryptHandler(PDDoc doc);

    Parameters

    doc
    The document whose new security handler is obtained.

    Returns

    The ASAtom corresponding to the name of the document's security handler. It returns ASAtomNull if the document does not have a current security handler.

    PDDocGetCryptHandlerClientData

    Header: PDProcs.h:6141

    Description

    Gets the client data for the encryption handler associated with the PDDoc. This is the client data provided as a parameter in PDRegisterCryptHandlerEx().

    Related Methods

    Syntax

    void *PDDocGetCryptHandlerClientData(PDDoc pdDoc);

    Parameters

    pdDoc
    The document whose encryption handler client data is obtained.

    Returns

    Client data for the encryption handler associated with the PDDoc. It returns NULL if there is no encryption handler or no client data was provided.

    PDDocGetCryptRevision

    Header: PDProcs.h:12779

    Description

    Sets the 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.

    Syntax

    ASInt32 PDDocGetCryptRevision(PDDoc pdDoc);

    Parameters

    pdDoc
    The document.

    Returns

    The Crypt Revision retreived from the Security handler or encrypt dict or 0 if not found or not encrypted

    PDDocGetCryptVersion

    Header: PDProcs.h:12771

    Description

    Sets the 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.

    Syntax

    ASInt32 PDDocGetCryptVersion(PDDoc pdDoc);

    Parameters

    pdDoc
    The document.

    Returns

    The Crypt Version retreived from the Security handler or encrypt dict or 0 if not found or not encrypted

    PDDocGetFile

    Header: PDProcs.h:1476

    Description

    Gets the file object for a document.

    Syntax

    ASFile PDDocGetFile(PDDoc doc);

    Parameters

    doc
    The document whose ASFile is obtained.

    Returns

    The document's ASFile.

    PDDocGetFlags

    Header: PDProcs.h:1419

    Description

    Gets information about the document's file and its state.

    Syntax

    ASInt32 PDDocGetFlags(PDDoc doc);

    Parameters

    doc
    IN/OUT The document whose flags are obtained.

    Returns

    Flags field, containing an OR of the PDDocFlags values.

    PDDocGetFullScreen

    Header: PDProcs.h:6153

    Description

    Tests whether the document will open in full-screen mode. This provides an alternative to calling PDDocGetPageMode() to test for PDFullScreen.

    Related Methods

    Syntax

    ASBool PDDocGetFullScreen(PDDoc pdDoc);

    Parameters

    pdDoc
    The document to test.

    Returns

    true if the PDDoc is in full-screen mode, false otherwise.

    PDDocGetID

    Header: PDProcs.h:1502

    Description

    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).

    Syntax

    ASInt32 PDDocGetID(PDDoc doc, ASInt32 nElemNum, ASUns8 *buffer, ASInt32 bufferSize);

    Parameters

    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:
    Value
    Description
    0
    The permanent ID.
    1
    The permanent ID.
    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.

    Returns

    The number of bytes in the ID element.

    PDDocGetLabelForPageNum

    Header: PDProcs.h:7396

    Description

    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.

    Syntax

    ASInt32 PDDocGetLabelForPageNum(PDDoc pdDoc, ASInt32 pageNum, char *buffer, ASInt32 bufferLen);

    Parameters

    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).

    Returns

    The length of the resulting label. If no such page number exists, the resulting string will be the ASCII representation of pageNum + 1.

    PDDocGetLabelForPageNumEx

    Header: PDProcs.h:11123

    Description

    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.

    Syntax

    void PDDocGetLabelForPageNumEx(PDDoc pdDoc, ASInt32 pageNum, ASText text);

    Parameters

    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.

    PDDocGetLayoutMode

    Header: PDProcs.h:11387

    Description

    Gets the value of the PageLayout key in the Catalog dictionary.

    Related Methods

    Syntax

    PDLayoutMode PDDocGetLayoutMode(PDDoc doc);

    Parameters

    doc
    IN The document whose layout mode is obtained.

    Returns

    Layout mode value from the PDF Catalog dictionary.

    PDDocGetNameTree

    Header: PDProcs.h:7091

    Description

    Retrieves a name tree, with the key name specified in theTree, from the Names dictionary of thePDDoc.

    Syntax

    PDNameTree PDDocGetNameTree(PDDoc thePDDoc, ASAtom theTree);

    Parameters

    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.

    Returns

    The PDNameTree requested.

    PDDocGetNewCryptHandler

    Header: PDProcs.h:2537

    Description

    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.

    Syntax

    ASAtom PDDocGetNewCryptHandler(PDDoc doc);

    Parameters

    doc
    The document whose new security handler is obtained.

    Returns

    The ASAtom corresponding to the pdfName of the document's new security handler. It returns ASAtomNull if the document does not have a new security handler.

    PDDocGetNewSecurityData

    Header: PDProcs.h:2402

    Description

    Gets the security data structure for the specified document's new security handler. Use PDDocGetSecurityData() to get the security data structure for the document's current security handler.

    Syntax

    void *PDDocGetNewSecurityData(PDDoc doc);

    Parameters

    doc
    The document whose new security data structure is obtained.

    Returns

    The security data structure for the document's new security handler.

    PDDocGetNewSecurityInfo

    Header: PDProcs.h:2558

    Description

    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.

    Related Methods

    Syntax

    void PDDocGetNewSecurityInfo(PDDoc pdDoc, ASUns32 *secInfo);

    Parameters

    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.

    PDDocGetNthError

    Header: PDProcs.h:12053

    Description

    Returns the error code and string for the nth non-fatal error encountered since the document was opened, or PDDocClearErrors was called.

    Syntax

    ASInt32 PDDocGetNthError(PDDoc doc, ASInt32 errNumber, ASInt32 *errorP, char *buffer, ASInt32 bufSize);

    Parameters

    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
    If there is a string associated with this error, the string is copied to this buffer if it is non- NULL and is NULL-terminated.
    bufSize
    The maximum number of bytes that will be written to the buffer.

    Returns

    If there is a string associated with this error, the length of that string is returned. If there is no string, the return value is zero.

    PDDocGetNumErrors

    Header: PDProcs.h:12040

    Description

    Return the number of non-fatal errors encountered since the document was opened, or PDDocClearErrors was called.

    Syntax

    ASInt32 PDDocGetNumErrors(PDDoc doc);

    Parameters

    doc
    The document in which the non-fatal errors have occurred.

    PDDocGetNumOCGs

    Header: PDProcs.h:10377

    Description

    Returns the number of optional-content groups associated with a document, which is the number of unique entries in the document's OCProperties OCGs array.

    Syntax

    ASUns32 PDDocGetNumOCGs(PDDoc pdDoc);

    Parameters

    pdDoc
    The document whose groups are counted.

    Returns

    The number of OCGs for the document.

    PDDocGetNumPages

    Header: PDProcs.h:1547

    Description

    Gets the number of pages in a document.

    Syntax

    ASInt32 PDDocGetNumPages(PDDoc doc);

    Parameters

    doc
    IN/OUT The document for which the number of pages is obtained.

    Returns

    The number of pages in the document. Remember to subtract 1 from this value if you are going to pass it to a PD- level method that takes a zero-based page number.

    PDDocGetNumThreads

    Header: PDProcs.h:1828

    Description

    Gets the number of article threads in a document.

    Syntax

    ASInt32 PDDocGetNumThreads(PDDoc doc);

    Parameters

    doc
    IN/OUT The document whose article thread count is obtained.

    Returns

    The number of article threads in the document.

    PDDocGetOCConfig

    Header: PDProcs.h:10063

    Description

    Gets the built-in default optional-content configuration for the document from the OCProperties D entry.

    Syntax

    PDOCConfig PDDocGetOCConfig(PDDoc pdDoc);

    Parameters

    pdDoc
    The document whose configuration is obtained.

    Returns

    The document's current optional-content configuration.

    PDDocGetOCContext

    Header: PDProcs.h:9534

    Description

    Gets the built-in default optional-content context for the document. This context is used by all content drawing and enumeration calls that do not take an optional-content context parameter, or for which no context is specified.

    Syntax

    PDOCContext PDDocGetOCContext(PDDoc pdDoc);

    Parameters

    pdDoc
    The document whose context is obtained.

    Returns

    The document's current optional-content context.

    PDDocGetOCGs

    Header: PDProcs.h:10397

    Description

    Gets the optional-content groups for the document. The order of the groups is not guaranteed to be the creation order, and is not the same as the display order (see PDOCConfigGetOCGOrder()).

    Syntax

    PDOCG *PDDocGetOCGs(PDDoc pdDoc);

    Parameters

    pdDoc
    The document whose OCGs are obtained.

    Returns

    A NULL-terminated array of PDOCG objects. The client is responsible for freeing the array using ASfree().

    PDDocGetOpenAction

    Header: PDProcs.h:1244

    Description

    Gets the value of the OpenAction key in the Catalog dictionary, which is the action performed when the document is opened. After you obtain the action, you can execute it with AVDocPerformAction().

    Related Methods

    Syntax

    PDAction PDDocGetOpenAction(PDDoc doc);

    Parameters

    doc
    IN/OUT The document whose open action is obtained.

    Returns

    The document's open action. It is invalid if there is no OpenAction key in the Catalog dictionary (this can be tested with PDActionIsValid()).

    PDDocGetPDCollection

    Header: PDProcs.h:12372

    Description

    Gets the collection object in a document.

    Syntax

    PDCollection PDDocGetPDCollection(PDDoc pdDoc);

    Parameters

    pdDoc
    The document.

    Returns

    The collection. If the document does not have a collection, the returned collection is invalid.

    PDDocGetPageLabel

    Header: PDProcs.h:7258

    Description

    Returns the label that is in effect for the given page.

    Syntax

    PDPageLabel PDDocGetPageLabel(PDDoc pdDoc, ASInt32 pageNum, ASInt32 *firstPage, ASInt32 *lastPage);

    Parameters

    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
    (Filled by the method) If non- NULL, it is the number of the last page that the page label is attached to. Setting lastPage to non- NULL forces the implementation to perform another traverse of the page label tree, with some slight performance impact.

    Returns

    The label that is in effect for the given page. If there is no label object in effect, this method returns an invalid page label object, and firstPage and lastPage will be set to-1.

    PDDocGetPageMode

    Header: PDProcs.h:1448

    Description

    Gets the value of the PageMode key in the Catalog dictionary.

    Note: PDDocGetFullScreen should be used when the page mode is set to full screen.

    Related Methods

    Syntax

    PDPageMode PDDocGetPageMode(PDDoc doc);

    Parameters

    doc
    IN/OUT The document whose page mode is obtained.

    Returns

    Page mode value from PDF Catalog dictionary.

    PDDocGetPageObjByNum

    Header: PDProcs.h:8013

    Description

    Returns the page Cos object corresponding to the given page number.

    Syntax

    CosObj PDDocGetPageObjByNum(PDDoc pdd, ASInt32 nPage);

    Parameters

    pdd
    The PDDoc containing the given page.
    nPage
    The page number.

    Returns

    A Cos object representing the page, or an object of type CosNull if the page does not exist.

    Exceptions

    PDDocGetPermissions

    Header: PDProcs.h:2574

    Description

    Deprecated in Acrobat 5.0. Use PDDocPermRequest() instead.

    Gets the permissions for the specified document. You can set permissions with PDDocAuthorize().

    Syntax

    PDPerms PDDocGetPermissions(PDDoc doc);

    Parameters

    doc
    The document whose permissions are obtained.

    Returns

    A bit field indicating the document's permissions. It is an OR of the PDPerms values.

    PDDocGetSecurityData

    Header: PDProcs.h:2383

    Description

    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.

    Syntax

    void *PDDocGetSecurityData(PDDoc doc);

    Parameters

    doc
    The document whose security data structure is obtained.

    Returns

    A pointer to the document's current security data structure.

    PDDocGetThread

    Header: PDProcs.h:1842

    Description

    Gets an article thread having the specified index.

    Syntax

    PDThread PDDocGetThread(PDDoc doc, ASInt32 index);

    Parameters

    doc
    IN/OUT The document containing the article thread.
    index
    IN/OUT The index of the article thread to obtain.

    Returns

    The specified article thread.

    PDDocGetThreadIndex

    Header: PDProcs.h:1852

    Description

    Gets the index of the specified article thread.

    Syntax

    ASInt32 PDDocGetThreadIndex(PDDoc doc, PDThread thread);

    Parameters

    doc
    IN/OUT The document containing the thread.
    thread
    IN/OUT The thread whose index is obtained.

    Returns

    The index of thread in doc. It returns-1 if thread is not in doc.

    PDDocGetTrapped

    Header: PDProcs.h:11082

    Description

    Gets the value of the Trapped key in the Info dictionary.

    Related Methods

    Syntax

    ASAtom PDDocGetTrapped(PDDoc pdDoc);

    Parameters

    pdDoc
    The document whose Trapped key value is obtained.

    Returns

    The value of the Trapped key in the Info dictionary if the entry exists and is a name, or ASAtomNull if the entry does not exist or is not a name.

    PDDocGetVersion

    Header: PDProcs.h:1524

    Description

    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).

    Syntax

    void PDDocGetVersion(PDDoc doc, ASInt16 *majorP, ASInt16 *minorP);

    Parameters

    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.

    PDDocGetVersionEx

    Header: PDProcs.h:12085

    Description

    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

    Syntax

    void PDDocGetVersionEx(PDDoc doc, ASUns32 *majorP, ASUns32 *minorP, CosObj *adbeExtensionBaseP, ASUns32 *adbeExtensionLevelP);

    Parameters

    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.

    PDDocGetWordFinder

    Header: PDProcs.h:2053

    Description

    Gets the word finder associated with a document. It is not necessary to destroy the word finder returned by this method.

    Syntax

    PDWordFinder PDDocGetWordFinder(PDDoc docP, ASInt16 WXEVersion);

    Parameters

    docP
    The document whose word finder is obtained.
    WXEVersion
    The version of the word finder to get.

    Returns

    The document's word finder. It returns NULL if the document does not have a word finder or its version does not match the version requested.

    Exceptions

    is thrown if an invalid version number is passed.

    PDDocHasISOExtensions

    Header: PDProcs.h:12105

    Description

    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

    Syntax

    ASBool PDDocHasISOExtensions(PDDoc doc);

    Parameters

    doc
    IN/OUT The document tested for ISO extensions.

    PDDocHasOC

    Header: PDProcs.h:10361

    Description

    Determines whether the optional content feature is associated with the document. The document is considered to have optional content if there is an OCProperties dictionary in the document's catalog, and that dictionary has one or more entries in the OCGs array.

    Syntax

    ASBool PDDocHasOC(PDDoc pdDoc);

    Parameters

    pdDoc
    The document whose OC status is obtained.

    Returns

    true if the document has optional content, false otherwise.

    PDDocImportCosDocNotes

    Header: PDProcs.h:6841

    Description

    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.

    Syntax

    ASInt32 PDDocImportCosDocNotes(PDDoc doc, CosDoc src, const char *noteTitle, ASInt32 noteTitleLen, PDColorValue color, void *progMon, /* ASProgressMonitor */ void *monClientData, PDDocWillImportAnnotCallback importFilter);

    Parameters

    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.

    Returns

    The number of notes imported.

    PDDocImportNotes

    Header: PDProcs.h:7440

    Description

    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.

    Syntax

    ASInt32 PDDocImportNotes(PDDoc doc, PDDoc sourceDoc, void *progMon, /* ASProgressMonitor */ void *monClientData, PDDocWillImportAnnotCallback importFilter);

    Parameters

    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.

    Returns

    The number of notes imported.

    PDDocInsertPages

    Header: PDProcs.h:1755

    Description

    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:

  • The parameters indicating which pages to insert are ignored: all the pages of doc2 are inserted.

  • In addition to inserting the pages themselves, it also merges other document data from doc2 into doc:

    • Named destinations from 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.
    • If it is also the case that 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.

  • Syntax

    void PDDocInsertPages(PDDoc doc, ASInt32 mergeAfterThisPage, PDDoc doc2, ASInt32 startPage, ASInt32 numPages, ASUns16 insertFlags, ProgressMonitor progMon, void *progMonClientData, CancelProc cancelProc, void *cancelProcClientData);

    Parameters

    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):
    Constant
    Description
    Inserts bookmarks as well as pages. The bookmark tree of doc2 is merged into the bookmark tree of doc by copying it as a new first-level subtree of the doc parameter's bookmark tree root, of which it becomes the last child. If doc has no bookmark tree, it acquires one identical to the bookmark tree from doc2.
    Inserts threads as well as pages.
    Inserts document data from pages.
    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
    A pointer to user-supplied data to pass to progMon each time it is called. It should be NULL if progMon is NULL.
    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
    A pointer to user-supplied data to pass to cancelProc each time it is called. It should be NULL if cancelProc is NULL.

    Exceptions

    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.

    PDDocMovePage

    Header: PDProcs.h:1637

    Description

    Moves one page in a document.

    Syntax

    void PDDocMovePage(PDDoc doc, ASInt32 moveToAfterThisPage, ASInt32 pageToMove);

    Parameters

    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.

    Exceptions

    is raised if moveAfterThisPage or pageToMove is invalid. Other exceptions may be raised as well.

    PDDocNewSecurityData

    Header: PDProcs.h:2464

    Description

    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().

    Syntax

    void *PDDocNewSecurityData(PDDoc doc);

    Parameters

    doc
    The document for which a security data structure is created.

    Returns

    The newly created security data structure.

    Exceptions

    is raised if pdPermSecure (see PDPerms) has not been granted for doc.
    is raised if the document does not have a new security handler.

    PDDocOpen

    Header: PDProcs.h:1228

    Description

    Opens the specified document. If the document is already open, it returns a reference to the already opened PDDoc. You must call PDDocClose() once for every successful open. If the call fails and the exception is pdErrNeedRebuild, then call again with doRepair set to true. This allows the application to decide whether to perform the time-consuming repair operation.

    Syntax

    PDDoc PDDocOpen(ASPathName fileName, ASFileSys fileSys, PDAuthProc authProc, ASBool doRepair);

    Parameters

    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
    If true, attempt to repair the file if it is damaged. If false, do not attempt to repair the file if it is damaged.

    Returns

    The newly-opened document.

    Exceptions

    or other errors are raised if the file is encrypted and authProc is NULL or returns false.
    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.

    PDDocOpenEx

    Header: PDProcs.h:6054

    Description

    Opens the specified document. If the document is already open, it returns a reference to the already opened PDDoc. You must call PDDocClose() once for every successful open. If the call fails and the exception is pdErrNeedRebuild, then call again with doRepair equal to true. This allows the application to decide whether to perform the time-consuming repair operation.

    Syntax

    PDDoc PDDocOpenEx(ASPathName fileName, ASFileSys fileSys, PDAuthProcEx authProcEx, void *authProcClientData, ASBool doRepair);

    Parameters

    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
    If true, attempt to repair the file if it is damaged. If false, do not attempt to repair the file if it is damaged.

    Returns

    The newly-opened document.

    Exceptions

    is raised if the file is encrypted and authProc Ex() is NULL or returns false.
    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.

    PDDocOpenFromASFile

    Header: PDProcs.h:5566

    Description

    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.

    Syntax

    PDDoc PDDocOpenFromASFile(ASFile aFile, PDAuthProc authProc, ASBool doRepair);

    Parameters

    aFile
    The ASFile to open. The ASFile should be released after the PDDoc is closed.
    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
    If true, attempt to repair the file if it is damaged. If false, do not attempt to repair the file if it is damaged.

    Returns

    A valid PDDoc if successfully opened.

    Exceptions

    is raised if the file is encrypted and authProc is NULL or returns false.
    is raised if the bytes required to open a PDDoc are not yet available.

    PDDocOpenFromASFileEx

    Header: PDProcs.h:6096

    Description

    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.

    Syntax

    PDDoc PDDocOpenFromASFileEx(ASFile aFile, PDAuthProcEx authProcEx, void *authProcClientData, ASBool doRepair);

    Parameters

    aFile
    The ASFile to open. The ASFile should be released after the PDDoc is closed.
    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
    If true, attempt to repair the file if it is damaged. If false, do not attempt to repair the file if it is damaged.

    Returns

    A valid PDDoc if successfully opened.

    Exceptions

    is raised if the file is encrypted and authProc is NULL or returns false.
    is raised if the bytes required to open a PDDoc are not yet available.

    PDDocOpenWithParams

    Header: PDProcs.h:7351

    Description

    Opens the document specified by the ASFile or ASFileSys/ASPathName. If both are set, the ASFile is used and the fileSys and pathName are ignored.

    Syntax

    PDDoc PDDocOpenWithParams(PDDocOpenParams openParams);

    Parameters

    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.

    Returns

    The PDDoc for the PDF document described by the structure passed in openParams.

    PDDocPermRequest

    Header: PDProcs.h:7893

    Description

    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.

    Syntax

    PDPermReqStatus PDDocPermRequest(PDDoc pdDoc, PDPermReqObj reqObj, PDPermReqOpr reqOpr, void *authData);

    Parameters

    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.

    Returns

    The request status constant, 0 if the requested operation is allowed, a non-zero status code otherwise.

    PDDocPermRequestNoUB

    Header: PDProcs.h:11308

    Description

    PDDocPermRequestNoUB() indicates whether the permission would have been granted had the document not been Rights Enabled.

    This may throw numerous exceptions.

    Related Methods

    Syntax

    PDPermReqStatus PDDocPermRequestNoUB(PDDoc pdDoc, PDPermReqObj reqObj, PDPermReqOpr reqOpr, void *authData);

    Parameters

    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.

    Returns

    The request status constant: 0 if the requested operation is allowed, a non-zero status code otherwise.

    PDDocReadAhead

    Header: PDProcs.h:5995

    Description

    Used for page-at-a-time downloading and byte-serving Acrobat data. If a document is being viewed over a slow file system, PDDocReadAhead() issues a byte range request for all the data associated with the flags in flags.

    Syntax

    void PDDocReadAhead(PDDoc doc, ASUns32 flags, void *clientData);

    Parameters

    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.

    PDDocReadAheadEmbeddedFile

    Header: PDProcs.h:11029

    Description

    Used for page-at-a-time downloading and byte-serving Acrobat data. If a document is being viewed over a slow file system, the method issues a byte range request for all the data associated with an embedded file.

    Syntax

    void PDDocReadAheadEmbeddedFile(PDDoc doc, CosObj embeddedFileObj);

    Parameters

    doc
    The document being read.
    embeddedFileObj
    The Cos object of the embedded file stream (the stream referenced by entries in the EF dictionary).

    PDDocReadAheadPages

    Header: PDProcs.h:7366

    Description

    Reads ahead nPages starting at startPage (if the file is linearized).

    Syntax

    void PDDocReadAheadPages(PDDoc doc, ASInt32 startPage, ASInt32 nPages);

    Parameters

    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.

    PDDocRelease

    Header: PDProcs.h:1407

    Description

    Decrements a document's reference count. The document will not be closed until the reference count is zero, or the application terminates.

    Related Methods

    Syntax

    void PDDocRelease(PDDoc doc);

    Parameters

    doc
    IN/OUT The document whose reference count is decremented.

    Exceptions

    PDDocRemoveNameTree

    Header: PDProcs.h:7123

    Description

    Removes the name tree inside the Names dictionary with the specified key name. It does nothing if no object with that name exists.

    Syntax

    void PDDocRemoveNameTree(PDDoc thePDDoc, ASAtom theTree);

    Parameters

    thePDDoc
    IN/OUT The document from which a name tree is removed.
    theTree
    IN/OUT The name tree to remove.

    PDDocRemoveOpenAction

    Header: PDProcs.h:7975

    Description

    Removes the value of the OpenAction key in the Catalog dictionary. The value is the action performed when the document is opened.

    Syntax

    void PDDocRemoveOpenAction(PDDoc doc);

    Parameters

    doc
    IN/OUT The document whose open action is removed.

    Exceptions

    PDDocRemovePageLabel

    Header: PDProcs.h:7331

    Description

    Removes the page label that is attached to the specified page, effectively merging the specified range with the previous page label sequence.

    Syntax

    void PDDocRemovePageLabel(PDDoc pdDoc, ASInt32 pageNum);

    Parameters

    pdDoc
    The document from which a page label is removed.
    pageNum
    The page from which the page label is removed.

    PDDocRemoveThread

    Header: PDProcs.h:1885

    Description

    Removes an article thread from a document. If you also wish to destroy the thread, use PDThreadDestroy() after calling PDDocRemoveThread().

    Syntax

    void PDDocRemoveThread(PDDoc doc, ASInt32 index);

    Parameters

    doc
    IN/OUT The document from which the thread is removed.
    index
    IN/OUT The index of the thread to remove.

    PDDocReplaceOCG

    Header: PDProcs.h:10412

    Description

    In the document associated with a specified optional-content group, replaces that group with another group.

    Syntax

    void PDDocReplaceOCG(PDOCG replaceOCG, PDOCG keepOCG);

    Parameters

    replaceOCG
    The OCG to replace.
    keepOCG
    The replacement OCG.

    PDDocReplacePages

    Header: PDProcs.h:1817

    Description

    Replaces the specified range of pages in one document with pages from another. The contents, resources, size and rotation of the pages are replaced. The bookmarks are not copied, because they are attached to the document, not to individual pages.

    Note: Annotations in the replaced pages are not replaced and remain with the page. Use PDDocDeletePages() to remove annotations.

    Syntax

    void PDDocReplacePages(PDDoc doc, ASInt32 startPage, PDDoc doc2, ASInt32 startPageDoc2, ASInt32 numPages, ASBool mergeTextAnnots, ProgressMonitor progMon, void *progMonClientData, CancelProc cancelProc, void *cancelProcClientData);

    Parameters

    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
    A pointer to user-supplied data to pass to progMon each time it is called. It should be NULL if progMon is NULL.
    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
    A pointer to user-supplied data to pass to cancelProc each time it is called. It should be NULL if cancelProc is NULL.

    Exceptions

    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 one of the following conditions is true:
    • numPages < 1
    • startPage < 0
    • startPage + numPages is greater than the number of pages in doc
    • startPageDoc2 < 0
    • startPageDoc2 + numPages is greater than the number of pages in doc2
    is raised if there is insufficient memory to perform the insertion.

    PDDocRequestEntireFile

    Header: PDProcs.h:10915

    Description

    Requests the document file and performs the specified procedure on it.

    Syntax

    void PDDocRequestEntireFile(PDDoc doc, PDDocRequestEntireFileProc requestProc, void *clientData);

    Parameters

    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.

    PDDocRequestPages

    Header: PDProcs.h:10902

    Description

    Requests nPages starting at startPage, and performs a specified procedure on them.

    Syntax

    void PDDocRequestPages(PDDoc doc, ASInt32 startPage, ASInt32 nPages, PDDocRequestPagesProc requestProc, void *clientData);

    Parameters

    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.

    PDDocResetInkUsage

    Header: PDProcs.h:12032

    Description

    Resets the cached ink (spot color) usage information in a document. This should be called when the set of non-process colorants for a document have been changed. Calling this will force the cached information to be recomputed.

    Syntax

    void PDDocResetInkUsage(PDDoc doc);

    Parameters

    doc
    IN The document on which to reset set the ink usage.

    PDDocSave

    Header: PDProcs.h:1360

    Description

    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.

    Syntax

    void PDDocSave(PDDoc doc, PDSaveFlags saveFlags, ASPathName newPath, ASFileSys fileSys, ProgressMonitor progMon, void *progMonClientData);

    Parameters

    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
    A pointer to user-supplied data to pass to progMon each time it is called. It should be NULL if progMon is NULL.

    Exceptions

    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.

    PDDocSaveWithParams

    Header: PDProcs.h:6189

    Description

    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.

    Related Methods

    Syntax

    void PDDocSaveWithParams(PDDoc doc, PDDocSaveParams inParams);

    Parameters

    doc
    The document to save.
    inParams
    A PDDocSaveParams structure specifying how the document should be saved.

    PDDocSetAdobePDFVersion

    Header: PDProcs.h:12870

    Description

    PDDocSetAdobePDFVersion() sets the current version of the document in the AdobePDFVersion define in CosExp.T

    Syntax

    void PDDocSetAdobePDFVersion(PDDoc doc, const AdobePDFVersion version);

    Parameters

    doc
    IN/OUT The document whose version is to be updated.
    version
    IN/OUT version to which document is updated.

    PDDocSetFlags

    Header: PDProcs.h:1435

    Description

    Sets information about the document's file and its state. This method can only be used to set, not clear, flags. As a result, it is not possible, for example, to use this method to clear the flag that indicates that a document has been modified and needs to be saved. Instead, use PDDocClearFlags() to clear flags.

    Syntax

    void PDDocSetFlags(PDDoc doc, ASInt32 flags);

    Parameters

    doc
    IN/OUT The document whose flags are set.
    flags
    IN/OUT A bit field composed of an OR of the PDDocFlags values.

    PDDocSetFullScreen

    Header: PDProcs.h:6165

    Description

    Sets whether this document opens in full-screen mode. This provides an alternative to calling PDDocSetPageMode() with PDFullScreen.

    Related Methods

    Syntax

    void PDDocSetFullScreen(PDDoc pdDoc, ASBool fs);

    Parameters

    pdDoc
    The document to set.
    fs
    true if the document is set to open in full-screen mode, false otherwise.

    PDDocSetLayoutMode

    Header: PDProcs.h:11377

    Description

    Sets the value of the PageLayout key in the Catalog dictionary.

    Related Methods

    Syntax

    void PDDocSetLayoutMode(PDDoc doc, PDLayoutMode mode);

    Parameters

    doc
    IN The document whose page mode is set.
    mode
    IN The layout mode to set.

    PDDocSetMinorVersion

    Header: PDProcs.h:11894

    Description

    Sets the PDF minor version to the greater of its current value and the requested value. This function should be called when any feature requiring a PDF version of 1.7 or higher is applied to a document.

    Syntax

    void PDDocSetMinorVersion(PDDoc pdDoc, ASInt16 minor);

    Parameters

    pdDoc
    The document.
    minor
    The minimum required minor version

    PDDocSetNewCryptFilterData

    Header: PDProcs.h:10837

    Description

    Sets the encrypted data for the specified document's encryption filter to decrypt. Call this before accessing the stream to be decrypted.

    Syntax

    void PDDocSetNewCryptFilterData(PDDoc doc, ASAtom filterName, char *cryptData, ASInt32 cryptDataLen);

    Parameters

    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.

    Exceptions

    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.

    PDDocSetNewCryptFilterMethod

    Header: PDProcs.h:10813

    Description

    Sets or resets the specified document's security filter method, used for encryption and decryption of the document's data.

    Syntax

    void PDDocSetNewCryptFilterMethod(PDDoc doc, ASAtom filterName, ASAtom method);

    Parameters

    doc
    The document whose new security filter method is set.
    filterName
    The ASAtom corresponding to the name of the security filter to use.
    method
      One of five supported security methods:
    • None (default)
    • V2 (RC4)
    • V3 (RC4)
    • AESV1
    • AESV2 (128 bit)
    • AESV3 (256 bit)

    Exceptions

    is raised if there is no security handler registered for the document.

    PDDocSetNewCryptHandler

    Header: PDProcs.h:2516

    Description

    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.

    Syntax

    void PDDocSetNewCryptHandler(PDDoc pdDoc, ASAtom newCryptHandler);

    Parameters

    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.

    Exceptions

    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.

    PDDocSetNewCryptHandlerEx

    Header: PDProcs.h:11069

    Description

    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.

    Syntax

    void PDDocSetNewCryptHandlerEx(PDDoc pdDoc, ASAtom newCryptHandler, void *currentAuthData);

    Parameters

    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.

    Exceptions

    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.

    PDDocSetNewDefaultFilters

    Header: PDProcs.h:10860

    Description

    Sets or resets the document's default security filter methods for streams and strings, used to encrypt and decrypt the document's data. This method is only valid with version 4 algorithms (/V 4 in the Encrypt dictionary).

    Syntax

    void PDDocSetNewDefaultFilters(PDDoc doc, ASAtom defaultStmFilterName, ASAtom defaultStrFilterName);

    Parameters

    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.

    Exceptions

    is raised if there is no security handler registered for the document.

    PDDocSetNewSecurityData

    Header: PDProcs.h:2485

    Description

    Sets the security data structure for the specified document's new security handler. Use PDDocSetNewCryptHandler() to set a new security handler for a document.

    Syntax

    void PDDocSetNewSecurityData(PDDoc pdDoc, void *secData);

    Parameters

    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.

    Exceptions

    is raised if the document does not have a new security handler.
    is raised if the document's permissions cannot be changed.

    PDDocSetOpenAction

    Header: PDProcs.h:1255

    Description

    Sets the value of the OpenAction key in the Catalog dictionary, which is the action performed when the document is opened.

    Related Methods

    Syntax

    void PDDocSetOpenAction(PDDoc doc, PDAction action);

    Parameters

    doc
    The document whose open action is set.
    action
    The open action you want to set.

    PDDocSetPageLabel

    Header: PDProcs.h:7317

    Description

    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.

    Syntax

    void PDDocSetPageLabel(PDDoc pdDoc, ASInt32 pageNum, PDPageLabel pgLabel);

    Parameters

    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.

    Exceptions

    is raised if pgLabel is not a valid PDPageLabel.

    PDDocSetPageMode

    Header: PDProcs.h:1459

    Description

    Sets the value of the PageMode key in the Catalog dictionary.

    Related Methods

    Syntax

    void PDDocSetPageMode(PDDoc doc, PDPageMode mode);

    Parameters

    doc
    IN/OUT The document whose page mode is set.
    mode
    IN/OUT The page mode to set.

    PDDocSetTrapped

    Header: PDProcs.h:11101

    Description

    Sets the value of the Trapped key in the Info dictionary to the specified ASAtom.

    This method causes the corresponding XMP metadata item to be set to a string reflecting the characters in the ASAtom.

    Related Methods

    Syntax

    void PDDocSetTrapped(PDDoc pdDoc, ASAtom newValue);

    Parameters

    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.

    PDEnumDocs

    Header: PDProcs.h:1171

    Description

    Enumerates the PDDoc objects that are currently open, calling a user-supplied procedure for each open document.

    Related Methods

    Syntax

    void PDEnumDocs(PDDocEnumProc proc, void *clientData);

    Parameters

    proc
    IN/OUT A user-supplied callback to call for each open PDDoc. Enumeration halts if proc returns false.
    clientData
    IN/OUT A pointer to user-supplied data to pass to proc each time it is called.