# Adobe PDF Library 21 Adobe C++ API Reference APDFL21.0.0PlusP1e > The Adobe PDF Library Adobe C++ API provides low-level access to PDF document manipulation. The API is organized into functional layers, each containing related functions, definitions, and data types. - Product: Adobe PDF Library 21 - Language: Adobe C++ - Version: APDFL21.0.0PlusP1e - HTML page: https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e - Version index: https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/llms.txt The Adobe PDF Library Adobe C++ API provides low-level access to PDF document manipulation. The API is organized into functional layers, each containing related functions, definitions, and data types. --- # Acro Support Layer Source: https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer ## ASAtom ### Functions (3) #### ASAtomExistsForString ```cpp ASBool ASAtomExistsForString(const char *nameStr, ASAtom *atom) ``` Header: `CorProcs.h:130` Tests whether an ASAtom exists for the specified string. **Parameters** - `nameStr` (`const char *`): The string to test. - `atom` ([`ASAtom *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): (Filled by the method, may be `NULL`) If the ASAtom corresponding to `nameStr` already exists, it is returned in atom. Pass `NULL` to simply check whether the ASAtom already exists. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if an ASAtom already exists for `nameStr`, `false` otherwise. **See also:** [`ASAtomFromString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtomFromString), `ASAtomGetCount (Only available with PDF Library SDK)`, [`ASAtomGetString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtomGetString) #### ASAtomFromString ```cpp ASAtom ASAtomFromString(const char *nameStr) ``` Header: `CorProcs.h:114` Gets the ASAtom for the specified string. You can also use this method to create an ASAtom, since it creates one for the string if one does not already exist. If an ASAtom already exists for `nameStr`, the existing ASAtom is returned. Thus, ASAtom objects may be compared for equality of the underlying string. Because ASAtom objects cannot be deleted, they are useful for strings that are used many times in an Acrobat viewer session, but are not recommended for strings that have a short lifetime. For the same reason, it is not a good idea to create large numbers of ASAtom objects. **Parameters** - `nameStr` (`const char *`): The string for which an ASAtom is created. **Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom) The ASAtom corresponding to `nameStr`. **See also:** [`ASAtomExistsForString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtomExistsForString), `ASAtomGetCount (Only available with the PDF Library SDK)`, [`ASAtomGetString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtomGetString) #### ASAtomGetString ```cpp const char * ASAtomGetString(ASAtom atm) ``` Header: `CorProcs.h:142` Gets the string associated with the specified ASAtom. **Parameters** - `atm` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The ASAtom whose string is obtained. **Returns:** `const char *` The string corresponding to `atom`. It returns an empty string if `atom == ASAtomNull`, or `NULL` if the atom has not been defined. **See also:** [`ASAtomExistsForString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtomExistsForString), [`ASAtomFromString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtomFromString) ### Typedefs (1) #### ASAtom ```cpp typedef ASUns16 ASAtom ``` Header: `CoreExpT.h:146` ### Definitions (1) #### ASAtomNull Header: `CoreExpT.h:147` Value: `ASMAXUns16` ## ASCab ### Functions (56) #### ASCabCopy ```cpp void ASCabCopy(ASConstCab srcCab, ASCab dstCab) ``` Header: `ASExtraProcs.h:1360` For each key/value pair in `srcCab` a copy of the key/value pair will be placed into `dstCab`, possibly overwriting any identically named key/value pair in `dstCab`. If the value being copied is a pointer with an associated `destroyProc`, the pointer and its type string, but not the data it points to, will be copied and an internal reference count will be incremented. **Parameters** - `srcCab` ([`ASConstCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstCab)): The source cabinet. - `dstCab` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)): The destination cabinet. **Returns:** `void` **Exceptions** - `genErrBadParm` - `genErrNoMemory` **See also:** [`ASCabDup`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabDup) #### ASCabDestroy ```cpp void ASCabDestroy(ASCab theCab) ``` Header: `ASExtraProcs.h:686` Destroys the cabinet and all its key/value pairs. This method raises an exception if the cabinet is the value for some key in another cabinet. **Parameters** - `theCab` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)): The cabinet. **Returns:** `void` **Exceptions** - `genErrBadParm` #### ASCabDestroyEmpties ```cpp void ASCabDestroyEmpties(ASCab theCab, ASBool recurse) ``` Header: `ASExtraProcs.h:1343` Finds any empty cabinets in `theCab`, removes their corresponding keys, and destroys them. **Parameters** - `theCab` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)): The cabinet. - `recurse` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): `true` to recurse through all sub-cabinets inside `theCab`; `false` to limit enumeration to key/value pairs directly inside `theCab`. **Returns:** `void` **Exceptions** - `genErrBadParm` #### ASCabDetachBinary ```cpp void * ASCabDetachBinary(ASCab theCab, const char *theKey, ASTArraySize *numBytes) ``` Header: `ASExtraProcs.h:1291` Retrieves the binary object stored under `theKey` in `theCab` and removes the key from `theCab`. The client assumes ownership of the object and is responsible for deallocating any resources associated with it. **Parameters** - `theCab` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)): IN/OUT The cabinet. - `theKey` (`const char *`): IN/OUT The key name. - `numBytes` ([`ASTArraySize *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize)): IN/OUT (Filled by the method, may be `NULL`) If it is not `NULL`, it contains the size (in bytes) of the object retrieved. **Returns:** `void *` A pointer to the binary object. It will be `NULL` if `theKey` is not present in `theCab` or if the value stored under `theKey` is not of type kASTypeBinary. **Exceptions** - `genErrBadParm` **See also:** [`ASCabGetBinary`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabGetBinary), [`ASCabGetBinaryCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabGetBinaryCopy), [`ASCabPutBinary`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabPutBinary) #### ASCabDetachCab ```cpp ASCab ASCabDetachCab(ASCab theCab, const char *theKey) ``` Header: `ASExtraProcs.h:1100` Retrieves the ASCab stored under `theKey` in `theCab` and removes the key from `theCab`. The client assumes ownership of the ASCab returned and is responsible for destroying it. **Parameters** - `theCab` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)): IN/OUT The cabinet. - `theKey` (`const char *`): IN/OUT The key name. **Returns:** [`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab) The cabinet. Will be `NULL` if `theKey` is not present in `theCab`, or if the value stored under `theKey` is not of type kASValueCabinet. **Exceptions** - `genErrBadParm` **See also:** [`ASCabPutCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabPutCab), [`ASCabGetCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabGetCab) #### ASCabDetachPathName ```cpp void ASCabDetachPathName(ASCab theCab, const char *keyName, ASFileSys *fileSys, ASPathName *pathName) ``` Header: `ASExtraProcs.h:1484` Retrieves the ASPathName stored under `theKey` in `theCab` and removes the key from `theCab`. Both `fileSys` and `pathName` will be `NULL` if `theKey` was not found, there was no valid ASPathName stored under the key, or if the ASPathName does not point to an existing file. It is the client's responsibility to release the memory associated with the ASPathName using ASFileSysReleasePath(). @since **Parameters** - `theCab` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)): IN/OUT The cabinet. - `keyName` (`const char *`): IN/OUT The key name. - `fileSys` ([`ASFileSys *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): IN/OUT (Filled by the method) The ASFileSys that pathName was opened through. - `pathName` ([`ASPathName *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): IN/OUT (Filled by the method) The path name. **Returns:** `void` **Exceptions** - `genErrNoMemory` - `Any`: exceptions raised by ASFileSysPathFromDIPath. **See also:** [`ASCabPutPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabPutPathName), [`ASCabGetPathNameCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabGetPathNameCopy) #### ASCabDetachPointerRaw ```cpp void * ASCabDetachPointerRaw(ASCab theCab, const char *theKey, const char *expectedType, ASBool *noRefs) ``` Header: `ASExtraProcs.h:997` Retrieves the pointer stored under `theKey` in `theCab` and removes the key from `theCab`. If `noRefs` is set to `true`, the client assumes ownership of the data referenced by the pointer and is responsible for deallocating any resources associated with it. **Parameters** - `theCab` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)): The cabinet. - `theKey` (`const char *`): The key name. - `expectedType` (`const char *`): The data type referenced by the pointer. Since ASCabGetPointer() is actually a macro, you should pass the type as a literal name, not a string. For example, use `PDDoc` instead of `"PDDoc"`. Pointers are always *typed*, in that they always have associated with them a string indicating the type to which they point. - `noRefs` ([`ASBool *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): (Filled by the method, may be `NULL`) If non-`NULL`, a value of `true` indicates that there are no other ASCab objects that reference this pointer, and a value of `false` indicates that some ASCab object still contains a copy of the pointer. **Returns:** `void *` The pointer value stored under `theKey`. It will be `NULL` if `theKey` is not present in `theCab`, the value stored under `theKey` is not of type kASValuePointer, or the type of the pointer does not match `expectedType`. **Exceptions** - `genErrBadParm` **See also:** [`ASCabGetPointer`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabGetPointer), [`ASCabPutPointer`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabPutPointer) #### ASCabDetachString ```cpp char * ASCabDetachString(ASCab theCab, const char *theKey) ``` Header: `ASExtraProcs.h:1156` Retrieves the string stored under `theKey` in `theCab` and removes the key from `theCab`. The client assumes ownership of the string and is responsible for deallocating any resources associated with it. **Parameters** - `theCab` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)): IN/OUT The cabinet. - `theKey` (`const char *`): IN/OUT The key name.`theKey`. Will be `NULL` if `theKey` is not present in `theCab`, or if the value stored under `theKey` is not of type kASValueString. **Returns:** `char *` **Exceptions** - `genErrBadParm` **See also:** [`ASCabGetString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabGetString), [`ASCabGetStringCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabGetStringCopy), [`ASCabPutString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabPutString) #### ASCabDetachText ```cpp ASText ASCabDetachText(ASCab theCab, const char *theKey) ``` Header: `ASExtraProcs.h:1210` Retrieves the ASText object stored under `theKey` in `theCab` and removes the key from `theCab`. The client assumes ownership of the ASText object and is responsible for deallocating it using ASTextDestroy(). **Parameters** - `theCab` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)): The cabinet. - `theKey` (`const char *`): The key name.`theKey`. It will be `NULL` if `theKey` is not present in `theCab`, or if the value stored under `theKey` is not of type kASValueText. **Returns:** [`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText) **Exceptions** - `genErrBadParm` **See also:** [`ASCabGetText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabGetText), [`ASCabPutText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabPutText) #### ASCabDup ```cpp ASCab ASCabDup(ASConstCab srcCab) ``` Header: `ASExtraProcs.h:1372` Creates a new ASCab and populates it with copies of the key/value pairs in `srcCab`. It is equivalent to `ASCabCopy( srcCab, ASCabNew () )`. **Parameters** - `srcCab` ([`ASConstCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstCab)): The source cabinet. **Returns:** [`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab) The newly created ASCab. **Exceptions** - `genErrBadParm` - `genErrNoMemory` **See also:** [`ASCabCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabCopy) #### ASCabEnum ```cpp void ASCabEnum(ASCab theCab, ASCabEnumProc enumProc, void *clientData) ``` Header: `ASExtraProcs.h:744` Enumerates all the keys in the cabinet. Keys consisting solely of digits are enumerated first, in numeric order (assuming they are not padded with zeros at the front, which will confuse matters). Non-numeric keys are then enumerated in `strcmp` order. It is safe to add, delete, and modify items in `theCab` during the enumeration. Items that are added during the enumeration will not be enumerated. Modified items that have been enumerated already will not be enumerated again. Deleted items that have not yet been enumerated will not be enumerated. **Note:** This will `RERAISE` any exceptions thrown by `enumProc`. **Parameters** - `theCab` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)): The cabinet. - `enumProc` ([`ASCabEnumProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabEnumProc)): A user-supplied callback that is called for each entry found in `theCab`. - `clientData` (`void *`): A pointer to user-supplied data to pass to `enumProc` each time it is called. **Returns:** `void` **Exceptions** - `genErrBadParm` **See also:** [`ASConstCabEnum`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstCabEnum) #### ASCabEqual ```cpp ASBool ASCabEqual(ASConstCab cab1, ASConstCab cab2) ``` Header: `ASExtraProcs.h:1406` Compares two cabinets and verifies that they have a matching set of keys and that all key values are equal as reported by ASCabValueEqual(). **Parameters** - `cab1` ([`ASConstCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstCab)): The first cabinet. - `cab2` ([`ASConstCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstCab)): The second cabinet. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the cabinets are equal, `false` otherwise. **Exceptions** - `genErrBadParm` **See also:** [`ASCabValueEqual`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabValueEqual) #### ASCabFromEntryList ```cpp ASCab ASCabFromEntryList(const ASCabEntryRec *entryList) ``` Header: `ASExtraProcs.h:676` Builds a cabinet based on a constant array of ASCabDescriptor records (see `ASCabEntryRec`). The first entry in each descriptor specifies the name of the key; subsequent fields contain the value. The entry list must end with a descriptor containing `NULL` for the key name. See `ASExtraExpT.h` for more info. **Parameters** - `entryList` (`const ASCabEntryRec *`): A constant array of ASCabDescriptor records (see `ASCabEntryRec`). Passing `NULL` generates an empty ASCab. **Returns:** [`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab) The newly created ASCab. **Exceptions** - `genErrBadParm` #### ASCabGetAtom ```cpp ASAtom ASCabGetAtom(ASConstCab theCab, const char *theKey, ASAtom defValue) ``` Header: `ASExtraProcs.h:874` Returns the ASAtom value stored under `theKey` in `theCab`. **Parameters** - `theCab` ([`ASConstCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstCab)): IN/OUT The cabinet. - `theKey` (`const char *`): IN/OUT The key name. - `defValue` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): IN/OUT The default value. **Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom) The ASAtom value stored under `theKey` if the key is found and the value stored under it is of type kASValueAtom; otherwise `defValue` is returned. **Exceptions** - `genErrBadParm` **See also:** [`ASCabPutAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabPutAtom) #### ASCabGetBinary ```cpp const void * ASCabGetBinary(ASConstCab theCab, const char *theKey, ASTArraySize *numBytes) ``` Header: `ASExtraProcs.h:1247` Returns the binary object stored under `theKey` in `theCab`. **Parameters** - `theCab` ([`ASConstCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstCab)): IN/OUT The cabinet. - `theKey` (`const char *`): IN/OUT The key name. - `numBytes` ([`ASTArraySize *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize)): IN/OUT (Filled by the method, may be `NULL`) If it is not `NULL`, it contains the size (in bytes) of the object returned. **Returns:** `const void *` The binary object stored under `theKey` if the key is found and the value stored under it is of type kASValueBinary; otherwise `NULL` is returned. This object is owned by the ASCab and should not be destroyed by the caller. **Exceptions** - `genErrBadParm` **See also:** [`ASCabGetBinaryCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabGetBinaryCopy), [`ASCabDetachBinary`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabDetachBinary), [`ASCabPutBinary`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabPutBinary) #### ASCabGetBinaryCopy ```cpp void * ASCabGetBinaryCopy(ASConstCab theCab, const char *theKey, ASTArraySize *numBytes) ``` Header: `ASExtraProcs.h:1269` Returns a copy of the binary object stored under `theKey` in `theCab`. It is the client's responsibility to release the memory associated with the object using ASfree(). **Parameters** - `theCab` ([`ASConstCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstCab)): IN/OUT The cabinet. - `theKey` (`const char *`): IN/OUT The key name. - `numBytes` ([`ASTArraySize *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize)): IN/OUT (Filled by the method, may be `NULL`) If it is not `NULL`, it contains the size of the object returned. **Returns:** `void *` The binary object stored under `theKey` if the key is found and the value stored under it is of type kASValueBinary; otherwise `NULL` is returned. **Exceptions** - `genErrBadParm` - `genErrNoMemory` **See also:** [`ASCabGetBinary`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabGetBinary), [`ASCabDetachBinary`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabDetachBinary), [`ASCabPutBinary`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabPutBinary) #### ASCabGetBool ```cpp ASBool ASCabGetBool(ASConstCab theCab, const char *theKey, ASBool defValue) ``` Header: `ASExtraProcs.h:822` Returns the ASBool value stored under `theKey` in `theCab`. **Parameters** - `theCab` ([`ASConstCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstCab)): IN/OUT The cabinet. - `theKey` (`const char *`): IN/OUT The key name. - `defValue` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): IN/OUT The default value. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) The ASBool value stored under `theKey` if the key is found and the value stored under it is of type kASValueBool; otherwise `defValue` is returned. **Exceptions** - `genErrBadParm` **See also:** [`ASCabPutBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabPutBool) #### ASCabGetCab ```cpp ASCab ASCabGetCab(ASConstCab theCab, const char *theKey) ``` Header: `ASExtraProcs.h:1082` Returns the ASCab stored under `theKey` in `theCab`. **Parameters** - `theCab` ([`ASConstCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstCab)): IN/OUT The cabinet. - `theKey` (`const char *`): IN/OUT The key name. **Returns:** [`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab) The ASCab stored under `theKey` if the key is found and the value stored under it is of type kASValueCabinet; otherwise `NULL` is returned. This object is owned by `theCab` and should not be destroyed by the client. **Exceptions** - `genErrBadParm` **See also:** [`ASCabPutCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabPutCab), [`ASCabDetachCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabDetachCab) #### ASCabGetDouble ```cpp double ASCabGetDouble(ASConstCab theCab, const char *theKey, double defValue) ``` Header: `ASExtraProcs.h:901` Returns the `double` value stored under `theKey` in `theCab`. If the value stored under `theKey` is of type kASValueInteger, this value will be cast to a `double` and returned to the client. **Parameters** - `theCab` ([`ASConstCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstCab)): IN/OUT The cabinet. - `theKey` (`const char *`): IN/OUT The key name. - `defValue` (`double`): IN/OUT The default value. **Returns:** `double` The `double` value stored under `theKey` if the key is found and the value stored under it is of type kASValueDouble or kASValueInteger; otherwise `defValue` is returned. **Exceptions** - `genErrBadParm` **See also:** [`ASCabPutDouble`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabPutDouble) #### ASCabGetInt ```cpp ASInt32 ASCabGetInt(ASConstCab theCab, const char *theKey, ASInt32 defValue) ``` Header: `ASExtraProcs.h:848` Returns the ASInt32 value stored under `theKey` in `theCab`. **Parameters** - `theCab` ([`ASConstCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstCab)): IN/OUT The cabinet. - `theKey` (`const char *`): IN/OUT The key name. - `defValue` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN/OUT The default value. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The ASInt32 value stored under `theKey` if the key is found and the value stored under it is of type kASValueInteger; otherwise `defValue` is returned. **Exceptions** - `genErrBadParm` **See also:** [`ASCabPutInt`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabPutInt) #### ASCabGetInt64 ```cpp ASInt64 ASCabGetInt64(ASConstCab theCab, const char *theKey, ASInt64 defValue) ``` Header: `ASExtraProcs.h:2377` Returns the ASInt64 value stored under `theKey` in `theCab`. **Parameters** - `theCab` ([`ASConstCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstCab)): IN/OUT The cabinet. - `theKey` (`const char *`): IN/OUT The key name. - `defValue` ([`ASInt64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt64)): IN/OUT The default value. **Returns:** [`ASInt64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt64) The ASInt64 value stored under `theKey` if the key is found and the value stored under it is of type kASValueInt64; otherwise `defValue` is returned. **Exceptions** - `genErrBadParm` **See also:** [`ASCabPutInt64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabPutInt64) #### ASCabGetPathNameCopy ```cpp void ASCabGetPathNameCopy(ASConstCab theCab, const char *keyName, ASFileSys *fileSys, ASPathName *pathName) ``` Header: `ASExtraProcs.h:1460` Returns a copy of ASPathName stored under `theKey` in `theCab`. It is the client's responsibility to release the ASPathName using ASFileSysReleasePath(). Both `fileSys` and `pathName` will be `NULL` if `theKey` was not found, there was no valid ASPathName stored under the key, or if `pathName` does not point to an existing file. **Parameters** - `theCab` ([`ASConstCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstCab)): IN/OUT The cabinet. - `keyName` (`const char *`): IN/OUT The key name. - `fileSys` ([`ASFileSys *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): IN/OUT (Filled by the method) The ASFileSys that `pathName` was opened through. - `pathName` ([`ASPathName *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): IN/OUT (Filled by the method) The path name. **Returns:** `void` **Exceptions** - `genErrNoMemory` - `Any`: exception raised by ASFileSysPathFromDIPath. **See also:** [`ASCabPutPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabPutPathName), [`ASCabDetachPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabDetachPathName) #### ASCabGetPointerDestroyProc ```cpp ASCabPointerDestroyProc ASCabGetPointerDestroyProc(ASConstCab theCab, const char *theKey) ``` Header: `ASExtraProcs.h:1034` Obtains the resource deallocation callback associated with the pointer stored under `theKey` in `theCab`. When the reference count of the pointer falls to zero, the callback is called to free the resources associated with the object it references. **Parameters** - `theCab` ([`ASConstCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstCab)): IN/OUT The cabinet. - `theKey` (`const char *`): IN/OUT The key name. **Returns:** [`ASCabPointerDestroyProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabPointerDestroyProc) The callback (if any) associated with the pointer if the key is found and the value stored under it is of type kASValuePointer; otherwise `NULL` is returned. **Exceptions** - `genErrBadParm` **See also:** [`ASCabDetachPointer`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabDetachPointer) #### ASCabGetPointerRaw ```cpp void * ASCabGetPointerRaw(ASConstCab theCab, const char *theKey, const char *expectedType) ``` Header: `ASExtraProcs.h:970` Returns the pointer value stored under `theKey` in `theCab`. **Parameters** - `theCab` ([`ASConstCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstCab)): The cabinet. - `theKey` (`const char *`): The key name. - `expectedType` (`const char *`): The data type referenced by the pointer. Since ASCabGetPointer() is actually a macro, you should pass the type as a literal name, not a string. For example, use `PDDoc` instead of `"PDDoc"`. Pointers are always *typed*, in that they always have associated with them a string indicating the type to which they point. **Returns:** `void *` The pointer value stored under `theKey` if the key is found, the value stored under `theKey` is of type kASValuePointer, and the type of the pointer matches `expectedType`; otherwise `NULL` is returned. The object referenced by this pointer is owned by `theCab` and should not be destroyed by the client. **Exceptions** - `genErrBadParm` **See also:** [`ASCabDetachPointer`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabDetachPointer), [`ASCabPutPointer`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabPutPointer) #### ASCabGetPointerType ```cpp const char * ASCabGetPointerType(ASConstCab theCab, const char *theKey) ``` Header: `ASExtraProcs.h:1047` Returns a string representation of the data type referenced by the pointer stored under `theKey` in `theCab`. **Parameters** - `theCab` ([`ASConstCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstCab)): IN/OUT The cabinet. - `theKey` (`const char *`): IN/OUT The key name. **Returns:** `const char *` The string if the key is found and the value stored under it is of type kASValuePointer; otherwise `NULL` is returned. **Exceptions** - `genErrBadParm` #### ASCabGetString ```cpp const char * ASCabGetString(ASConstCab theCab, const char *theKey) ``` Header: `ASExtraProcs.h:1118` Returns the string stored under `theKey` in `theCab`. **Parameters** - `theCab` ([`ASConstCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstCab)): IN/OUT The cabinet. - `theKey` (`const char *`): IN/OUT The key name. **Returns:** `const char *` The string stored under `theKey` if the key is found and the value stored under it is of type kASValueString; otherwise `NULL` is returned. The object referenced by this pointer is owned by `theCab` and should not be destroyed by the client. **Exceptions** - `genErrBadParm` - `genErrNoMemory` **See also:** [`ASCabGetStringCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabGetStringCopy), [`ASCabDetachString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabDetachString), [`ASCabPutString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabPutString) #### ASCabGetStringCopy ```cpp char * ASCabGetStringCopy(ASConstCab theCab, const char *theKey) ``` Header: `ASExtraProcs.h:1137` Returns a copy of the string stored under `theKey` in `theCab`. It is the client's responsibility to release the memory allocated for the string using ASfree(). **Parameters** - `theCab` ([`ASConstCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstCab)): IN/OUT The cabinet. - `theKey` (`const char *`): IN/OUT The key name. **Returns:** `char *` A copy of the string stored under `theKey` if the key is found and the value stored under it is of type kASValueString; otherwise `NULL` is returned. **Exceptions** - `genErrBadParm` - `genErrNoMemory` **See also:** [`ASCabGetString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabGetString), [`ASCabDetachString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabDetachString), [`ASCabPutString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabPutString) #### ASCabGetText ```cpp ASText ASCabGetText(ASConstCab theCab, const char *theKey) ``` Header: `ASExtraProcs.h:1192` Returns the ASText object stored under `theKey` in `theCab`. **Parameters** - `theCab` ([`ASConstCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstCab)): IN/OUT The cabinet. - `theKey` (`const char *`): IN/OUT The key name. **Returns:** [`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText) The ASText object stored under `theKey` if the key is found and the value stored under it is of type kASValueText; otherwise `NULL` is returned. This object is owned by `theCab` and should not be destroyed by the client. **Exceptions** - `genErrBadParm` **See also:** [`ASCabDetachText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabDetachText), [`ASCabPutText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabPutText) #### ASCabGetType ```cpp ASCabValueType ASCabGetType(ASConstCab theCab, const char *theKey) ``` Header: `ASExtraProcs.h:717` Returns the type of value stored under `theKey` in `theCab`. **Parameters** - `theCab` ([`ASConstCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstCab)): IN/OUT The cabinet. - `theKey` (`const char *`): IN/OUT The key name. **Returns:** [`ASCabValueType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabValueType) The type of value stored under `theKey`, or kASValueUnknown if the key is not found. **Exceptions** - `genErrBadParm` #### ASCabGetUns ```cpp ASUns32 ASCabGetUns(ASConstCab theCab, const char *theKey, ASUns32 defValue) ``` Header: `ASExtraProcs.h:1608` Returns the ASUns32 value stored under `theKey` in `theCab`. **Parameters** - `theCab` ([`ASConstCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstCab)): The cabinet. - `theKey` (`const char *`): The key name. - `defValue` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The default value.`theKey` if the key is found and the value stored under it is of type kASValueUns; otherwise `defValue` is returned. **Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32) **Exceptions** - `genErrBadParm` **See also:** [`ASCabPutUns`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabPutUns) #### ASCabGetUns64 ```cpp ASUns64 ASCabGetUns64(ASConstCab theCab, const char *theKey, ASUns64 defValue) ``` Header: `ASExtraProcs.h:2403` Returns the ASUns64 value stored under `theKey` in `theCab`. **Parameters** - `theCab` ([`ASConstCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstCab)): IN/OUT The cabinet. - `theKey` (`const char *`): IN/OUT The key name. - `defValue` ([`ASUns64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns64)): IN/OUT The default value. **Returns:** [`ASUns64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns64) The ASUns64 value stored under `theKey` if the key is found and the value stored under it is of type kASValueUns64; otherwise `defValue` is returned. **Exceptions** - `genErrBadParm` **See also:** [`ASCabPutUns64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabPutUns64) #### ASCabKnown ```cpp ASBool ASCabKnown(ASConstCab theCab, const char *theKey) ``` Header: `ASExtraProcs.h:705` Returns `true` if `theKey` is present in `theCab`. **Parameters** - `theCab` ([`ASConstCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstCab)): IN/OUT The cabinet. - `theKey` (`const char *`): IN/OUT The key name. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) See above. **Exceptions** - `genErrBadParm` #### ASCabMakeEmpty ```cpp void ASCabMakeEmpty(ASCab theCab) ``` Header: `ASExtraProcs.h:1331` Removes all keys from `theCab` and destroys all values they point to. **Parameters** - `theCab` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)): IN/OUT The cabinet. **Returns:** `void` **Exceptions** - `genErrBadParm` #### ASCabMunge ```cpp void ASCabMunge(ASCab theCab, ASConstCab keyCab, ASCabMungeAction action) ``` Header: `ASExtraProcs.h:1418` Munges the keys and the corresponding values in `theCab` based on the keys in `keyCab` and the munge action. Note that `keyCab` is never altered, but `theCab` is. **Parameters** - `theCab` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)): IN/OUT The cabinet to be modified. - `keyCab` ([`ASConstCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstCab)): IN/OUT The cabinet used to modify `theCab`. - `action` ([`ASCabMungeAction`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabMungeAction)): IN/OUT The type of action to be taken. **Returns:** `void` **Exceptions** - `genErrBadParm` #### ASCabNew ```cpp ASCab ASCabNew(void) ``` Header: `ASExtraProcs.h:661` Creates a new, empty cabinet. **Parameters** - (unnamed) (`void`) **Returns:** [`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab) The newly created cabinet. **Exceptions** - `genErrNoMemory` #### ASCabNumEntries ```cpp ASTArraySize ASCabNumEntries(ASConstCab theCab) ``` Header: `ASExtraProcs.h:695` Returns the number of key/value pairs in `theCab`. **Parameters** - `theCab` ([`ASConstCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstCab)): The cabinet. **Returns:** [`ASTArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize) See above. **Exceptions** - `genErrBadParm` #### ASCabPutAtom ```cpp void ASCabPutAtom(ASCab theCab, const char *theKey, ASAtom atomValue) ``` Header: `ASExtraProcs.h:885` Stores an ASAtom value in `theCab` under `theKey`. **Parameters** - `theCab` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)): IN/OUT The cabinet. - `theKey` (`const char *`): IN/OUT (May be `NULL`) The key name. - `atomValue` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): IN/OUT The value to be stored. **Returns:** `void` **Exceptions** - `genErrBadParm` **See also:** [`ASCabGetAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabGetAtom) #### ASCabPutBinary ```cpp void ASCabPutBinary(ASCab theCab, const char *theKey, void *theBlob, ASTArraySize blobSize) ``` Header: `ASExtraProcs.h:1310` Stores a binary object in `theCab` under `theKey`. The ASCab assumes ownership of the binary object, so the client should not attempt to free the memory associated with it. The binary object must have been allocated using ASmalloc(). **Parameters** - `theCab` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)): IN/OUT The cabinet. - `theKey` (`const char *`): IN/OUT (May be `NULL`) The key name. - `theBlob` (`void *`): IN/OUT (May be `NULL`) A pointer to the binary object to be stored. If it is `NULL`, the value (if any) stored under `theKey` in `theCab` is destroyed and `theKey` removed from `theCab`. - `blobSize` ([`ASTArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize)): IN/OUT The size of the binary object. **Returns:** `void` **Exceptions** - `genErrBadParm` **See also:** [`ASCabGetBinary`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabGetBinary), [`ASCabGetBinaryCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabGetBinaryCopy), [`ASCabDetachBinary`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabDetachBinary) #### ASCabPutBool ```cpp void ASCabPutBool(ASCab theCab, const char *theKey, ASBool theBool) ``` Header: `ASExtraProcs.h:833` Stores an ASBool value in theCab under theKey. **Parameters** - `theCab` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)): IN/OUT The cabinet. - `theKey` (`const char *`): IN (May be `NULL`) The key name. - `theBool` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): IN The value to be stored. Non-zero values are stored as `true`. **Returns:** `void` **Exceptions** - `genErrBadParm` **See also:** [`ASCabGetBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabGetBool) #### ASCabPutCab ```cpp void ASCabPutCab(ASCab theCab, const char *keyName, ASCab putCab) ``` Header: `ASExtraProcs.h:1067` Stores an ASCab in `theCab` under `theKey`. If the cabinet is already a value for some other ASCab, ASCabPutCab() will raise an exception, since any cabinet can be contained by at most one other cabinet. `theCab` assumes ownership of the cabinet, so the client must not destroy it. **Parameters** - `theCab` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)): IN/OUT The cabinet.`NULL`) The key name.`NULL`) The ASCab to be stored in `theCab`. If `cabVal` is `NULL`, then any value under `theKey` is destroyed and `theKey` is removed from `theCab`. - `keyName` (`const char *`) - `putCab` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)) **Returns:** `void` **Exceptions** - `genErrBadParm` **See also:** [`ASCabGetCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabGetCab), [`ASCabDetachCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabDetachCab) #### ASCabPutDouble ```cpp void ASCabPutDouble(ASCab theCab, const char *theKey, double floatValue) ``` Header: `ASExtraProcs.h:912` Stores a `double` value in `theCab` under `theKey`. **Parameters** - `theCab` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)): IN/OUT The cabinet. - `theKey` (`const char *`): IN/OUT (May be `NULL`) The key name. - `floatValue` (`double`): IN/OUT The value to be stored. **Returns:** `void` **Exceptions** - `genErrBadParm` **See also:** [`ASCabGetDouble`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabGetDouble) #### ASCabPutInt ```cpp void ASCabPutInt(ASCab theCab, const char *theKey, ASInt32 theInt) ``` Header: `ASExtraProcs.h:859` Stores an ASInt32 value in `theCab` under `theKey`. **Parameters** - `theCab` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)): IN/OUT The cabinet. - `theKey` (`const char *`): IN/OUT (May be `NULL`) The key name. - `theInt` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN/OUT The value to be stored. **Returns:** `void` **Exceptions** - `genErrBadParm` **See also:** [`ASCabGetInt`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabGetInt) #### ASCabPutInt64 ```cpp void ASCabPutInt64(ASCab theCab, const char *theKey, ASInt64 theInt) ``` Header: `ASExtraProcs.h:2388` Stores an ASInt64 value in `theCab` under `theKey`. **Parameters** - `theCab` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)): IN/OUT The cabinet. - `theKey` (`const char *`): IN/OUT (May be `NULL`) The key name. - `theInt` ([`ASInt64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt64)): IN/OUT The value to be stored. **Returns:** `void` **Exceptions** - `genErrBadParm` **See also:** [`ASCabGetInt64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabGetInt64) #### ASCabPutNull ```cpp void ASCabPutNull(ASCab theCab, const char *theKey) ``` Header: `ASExtraProcs.h:1322` Stores a value with a type of kASValueNull in `theCab` under `theKey`. `NULL` cabinet entries are used as placeholders or to removed other cabinet entries during an ASCabMunge operation. **Parameters** - `theCab` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)): IN/OUT The cabinet. - `theKey` (`const char *`): IN/OUT The key name. **Returns:** `void` **Exceptions** - `genErrBadParm` #### ASCabPutPathName ```cpp void ASCabPutPathName(ASCab theCab, const char *keyName, ASFileSys fileSys, ASPathName pathName) ``` Header: `ASExtraProcs.h:1437` Stores an ASPathName in `theCab` under `theKey`. `theCab` assumes ownership of the ASPathName, so the client need not call ASFileSysReleasePath(). **Parameters** - `theCab` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)): IN/OUT The cabinet.`NULL`) The key name. - `keyName` (`const char *`) - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): IN/OUT The ASFileSys from which the path was obtained.`NULL`) The ASPathName to be stored. If `NULL`, the value (if any) stored under `theKey` in `theCab` is destroyed and `theKey` is removed from `theCab`. - `pathName` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)) **Returns:** `void` **Exceptions** - `genErrBadParm` **See also:** [`ASCabGetPathNameCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabGetPathNameCopy), [`ASCabDetachPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabDetachPathName) #### ASCabPutPointerRaw ```cpp void ASCabPutPointerRaw(ASCab theCab, const char *theKey, const char *theType, void *thePtr, ASCabPointerDestroyProc destroy) ``` Header: `ASExtraProcs.h:1017` Stores a pointer in `theCab` under `theKey`. See the ASCab description for more information. **Parameters** - `theCab` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)): The cabinet. - `theKey` (`const char *`): (May be `NULL`) The key name. - `theType` (`const char *`): The data type referenced by the pointer. Since ASCabGetPointer() is actually a macro, you should pass the type as a literal name, not a string. For example, use `PDDoc` instead of `"PDDoc"`. Pointers are always *typed*, in that they always have associated with them a string indicating the type to which they point. - `thePtr` (`void *`): The value to be stored. - `destroy` ([`ASCabPointerDestroyProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabPointerDestroyProc)): (May be `NULL`) A user-supplied callback which is called when the reference count associated with `thePtr` is zero. **Returns:** `void` **Exceptions** - `genErrBadParm` - `genErrNoMemory` **See also:** [`ASCabGetPointer`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabGetPointer), [`ASCabDetachPointer`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabDetachPointer) #### ASCabPutString ```cpp void ASCabPutString(ASCab theCab, const char *theKey, const char *theStr) ``` Header: `ASExtraProcs.h:1176` Stores a string in `theCab` under `theKey`. A string consists of some number of bytes followed by a single `NULL` (zero) byte. The string must have been allocated using ASmalloc(). `theCab` assumes ownership of the string, so the client should not attempt to free the memory associated with it. **Parameters** - `theCab` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)): IN/OUT The cabinet.`NULL`) The key name.`NULL`) The string to be stored. If `NULL`, the value (if any) stored under `theKey` in `theCab` is destroyed and `theKey` is removed from `theCab`. - `theKey` (`const char *`) - `theStr` (`const char *`) **Returns:** `void` **Exceptions** - `genErrBadParm` **See also:** [`ASCabGetString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabGetString), [`ASCabGetStringCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabGetStringCopy), [`ASCabDetachString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabDetachString) #### ASCabPutText ```cpp void ASCabPutText(ASCab theCab, const char *theKey, ASText theText) ``` Header: `ASExtraProcs.h:1227` Stores an ASText object in `theCab` under `theKey`. `theCab` assumes ownership of the object, so the client should not attempt to free the memory associated with it. **Parameters** - `theCab` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)): IN/OUT The cabinet.`NULL`) The key name.`NULL`) The object to be stored. If its value is `NULL`, the value (if any) stored under `theKey` in `theCab` is destroyed and `theKey` is removed from `theCab`. - `theKey` (`const char *`) - `theText` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)) **Returns:** `void` **Exceptions** - `genErrBadParm` **See also:** [`ASCabGetText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabGetText), [`ASCabDetachText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabDetachText) #### ASCabPutUns ```cpp void ASCabPutUns(ASCab theCab, const char *theKey, ASUns32 theUns) ``` Header: `ASExtraProcs.h:1619` Stores the ASUns32 value under `theKey` in `theCab`. **Parameters** - `theCab` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)): The cabinet. - `theKey` (`const char *`): The key name. - `theUns` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The value to be stored. **Returns:** `void` **Exceptions** - `genErrBadParm` **See also:** [`ASCabGetUns`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabGetUns) #### ASCabPutUns64 ```cpp void ASCabPutUns64(ASCab theCab, const char *theKey, ASUns64 theInt) ``` Header: `ASExtraProcs.h:2414` Stores an ASUns64 value in `theCab` under `theKey`. **Parameters** - `theCab` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)): IN/OUT The cabinet. - `theKey` (`const char *`): IN/OUT (May be `NULL`) The key name. - `theInt` ([`ASUns64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns64)): IN/OUT The value to be stored. **Returns:** `void` **Exceptions** - `genErrBadParm` **See also:** [`ASCabGetUns64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabGetUns64) #### ASCabReadFromStream ```cpp ASCab ASCabReadFromStream(ASStm stm) ``` Header: `ASExtraProcs.h:1508` Reads a previously written cabinet from a stream. **Parameters** - `stm` ([`ASStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStm)): Must be a stream opened through ASFileStmRdOpen(), ASMemStmRdOpen(), or ASProcStmRdOpenEx(). **Returns:** [`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab) The ASCab, or `NULL` if it could not be constructed. **See also:** [`ASCabWriteToStream`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabWriteToStream) #### ASCabRemove ```cpp void ASCabRemove(ASCab theCab, const char *theKey) ``` Header: `ASExtraProcs.h:807` Removes `theKey` entry from `theCab`, destroying the associated value. **Parameters** - `theCab` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)): IN/OUT The cabinet. - `theKey` (`const char *`): IN/OUT The key name. **Returns:** `void` **Exceptions** - `genErrBadParm` #### ASCabRename ```cpp void ASCabRename(ASCab theCab, const char *oldKeyName, const char *newKeyName) ``` Header: `ASExtraProcs.h:1527` Renames a key within `theCab` while preserving the value associated with it. If there is already a key equal to `newKeyName` in `theCab`, its value will be destroyed and replaced with the value of oldKeyName. Any attempt to move the item from one sub-cabinet to another will cause ASCabRename() to raise an exception. For example, `ASCabRename(theCab, "SubCab1:Key1", "SubCab2:Key1")` will raise an exception. If this routine raises an exception, `theCab` will be untouched. **Parameters** - `theCab` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)): The cabinet. - `oldKeyName` (`const char *`): The key name to be changed. - `newKeyName` (`const char *`): The new name. **Returns:** `void` **Exceptions** - `genErrBadParm` #### ASCabValueEqual ```cpp ASBool ASCabValueEqual(ASConstCab cab1, const char *keyName1, ASConstCab cab2, const char *keyName2) ``` Header: `ASExtraProcs.h:1393` Compares two cabinet values and returns `true` only if they are equal (meaning that they have the same type and value). Cabinets are compared using ASCabEqual(). ASText values are compared by using ASTextCmp() and testing for a return value of `0` (zero). Strings and binary values must have the same lengths and byte-for-byte contents. Booleans, atoms, doubles, and integers must have equal values. Pointer values must point to the same location in memory but may have different *destroyProcs* and type strings. **Parameters** - `cab1` ([`ASConstCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstCab)): IN/OUT The first cabinet. - `keyName1` (`const char *`): IN/OUT The key name. - `cab2` ([`ASConstCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstCab)): IN/OUT The second cabinet. - `keyName2` (`const char *`): IN/OUT The key name. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) See above. **Exceptions** - `genErrBadParm` **See also:** [`ASCabEqual`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabEqual) #### ASCabWriteToStream ```cpp void ASCabWriteToStream(ASConstCab theCab, ASStm theStm) ``` Header: `ASExtraProcs.h:1498` Writes `theCab` out to a stream. The caller retains ownership of the cabinet. The stream will not be closed or flushed. **Parameters** - `theCab` ([`ASConstCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstCab)): IN/OUT The cabinet. - `theStm` ([`ASStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStm)): IN/OUT Must be a stream opened through ASFileStmWrOpen() or ASProcStmWrOpen(). **Returns:** `void` **Exceptions** - `genErrBadParm` - `fileErrWrite` **See also:** [`ASCabReadFromStream`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabReadFromStream) #### ASConstCabEnum ```cpp void ASConstCabEnum(ASConstCab theCab, ASConstCabEnumProc enumProc, void *clientData) ``` Header: `ASExtraProcs.h:2335` Enumerates all the keys in the constant cabinet. Keys consisting solely of digits are enumerated first, in numeric order (assuming they are not padded with zeros at the front, which will confuse matters). Non-numeric keys are then enumerated in `strcmp` order. The callback procedure must not add, delete, or modify items in `theCab` during the enumeration. It will `RERAISE` any exceptions thrown by `enumProc`. **Parameters** - `theCab` ([`ASConstCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstCab)): The cabinet. - `enumProc` ([`ASConstCabEnumProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstCabEnumProc)): User-supplied callback that is called for each entry found in `theCab`. This callback cannot modify the ASConstCab object. - `clientData` (`void *`): A pointer to user-supplied data to pass to `enumProc` each time it is called. **Returns:** `void` **Exceptions** - `genErrBadParm` **See also:** [`ASCabEnum`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabEnum) ### Typedefs (5) #### ASCabMungeAction ```cpp typedef ASEnum16 ASCabMungeAction ``` Header: `ASExtraExpT.h:303` #### ASCabValueType ```cpp typedef ASEnum16 ASCabValueType ``` Header: `ASExtraExpT.h:161` A constant that specifies the various types of values in ASCab objects. ASCab objects can be used to store arbitrary key/value pairs. The keys are always `NULL`-terminated strings containing only low ASCII alphanumeric characters. **See also:** [`ASCabFromEntryList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabFromEntryList), [`ASCabGetType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabGetType) #### ASCabEnumProc ```cpp typedef ASBool(*) ASCabEnumProc(ASCab theCab, const char *theKey, ASCabValueType itsType, void *clientData)(ASCab theCab, const char *theKey, ASCabValueType itsType, void *clientData) ``` Header: `ASExtraExpT.h:254` Used when enumerating the values inside a cabinet. **See also:** [`ASCabEnum`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabEnum) #### ASCabPointerDestroyProc ```cpp typedef void(*) ASCabPointerDestroyProc(void *ptr)(void *ptr) ``` Header: `ASExtraExpT.h:314` A deallocation callback that can be associated with a pointer in an ASCab. When the reference count of the pointer falls to zero, this callback is called to free the resources associated with the object the pointer references. **See also:** [`ASCabPutPointer`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabPutPointer), [`ASCabGetPointerDestroyProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabGetPointerDestroyProc) #### ASConstCabEnumProc ```cpp typedef ASBool(*) ASConstCabEnumProc(ASConstCab theCab, const char *theKey, ASCabValueType itsType, void *clientData)(ASConstCab theCab, const char *theKey, ASCabValueType itsType, void *clientData) ``` Header: `ASExtraExpT.h:270` Used when enumerating the values inside a constant cabinet. The callback procedure must not add, delete, or modify items in `theCab` during the enumeration. **See also:** [`ASConstCabEnum`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstCabEnum) ### Structures (2) #### ASCab ```cpp typedef struct _t_ASCabinet* ASCab ``` Header: `ASExpT.h:1388` ASCab objects (*cabinets*) can be used to store arbitrary key/value pairs. The keys are always `NULL`-terminated strings containing only low ASCII alphanumeric characters and spaces (ASCII character `32`). Key names cannot begin or end with a space. Every time you place a non-scalar value inside a cabinet, you are handing that value to the ASCab implementation to manage. Putting a value in a cabinet is always a handoff operation. For example, if you create an ASText object and add it as a value in an ASCab, the ASText object is no longer managed by you; it is managed by the ASCab. The ASCab will destroy the ASText object when its associated key is removed or the key's value is overwritten. Pointer values are a special case discussed in more detail below. The routine naming convention is as follows: Name Description Get `Get` routines return a value. These objects are owned by the ASCab and should not be destroyed by the caller of `Get`. GetCopy `GetCopy` routines make a copy of the data; the `GetCopy` client owns the resulting information and can modify it at will; it is also responsible for destroying it. Detach `Detach` routines work the same way as `Get` routines, but the key is removed from the ASCab without destroying the associated value that is passed back to the client of `Detach`. The client is responsible for destroying the returned object. Normally, pointers are treated the same way as scalars; the ASCab passes the pointer value back and forth but does not manage the data to which it points. This all changes if the pointer has an associated `destroyProc`. If the `destroyProc` is set, the ASCab will reference count the pointer to track how many times the pointer is referenced from any ASCab. For example, the reference count will be bumped up whenever the pointer is copied via ASCabCopy() or added to another ASCab via ASCabPutPointer(), and will destroy the data associated with the pointer when the reference count goes to `0`. The data is destroyed by calling the `destroyProc`. Detaching a pointer removes one reference to the pointer without ever destroying the information to which it points. ASCabDetachPointer() returns a separate value indicating whether the pointer can safely be destroyed by the client or is still referred to by other key/value pairs inside any ASCab objects (for example, whether the reference count went to zero when the pointer was detached from the ASCab). Any of the ASCab API's can take a compound name: a string consisting of multiple keys separated by the colon (:) character. For example, `"Grandparent:Parent:Child:Key"` can be such a compound name. The implementation will burrow down through such a compound string until it reaches the most deeply nested cabinet. Also, any of the `Put` routines can take a `NULL` key name. If the key name is `NULL`, the routine creates a new numeric key name. If the cabinet is empty, the first generated key name will be `"0"` and subsequent names will increase in ascending order. This is useful when treating an ASCab as a bag of unnamed items, or when adding an ordered list of items to an empty ASCab. **See also:** [`ASCabNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabNew), [`ASCabDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCabDestroy) #### ASConstCab ```cpp typedef const struct _t_ASCabinet* ASConstCab ``` Header: `ASExpT.h:1389` ### Definitions (4) #### ASCabDetachPointer Header: `ASExtraCalls.h:399` Value: `((theType)ASCabDetachPointerRaw((theCab), (theKey), #theType, (noRefs)))` #### ASCabGetPointer Header: `ASExtraCalls.h:395` Value: `((theType)ASCabGetPointerRaw((theCab), (theKey), #theType))` #### ASCabPutPointer Header: `ASExtraCalls.h:397` Value: `ASCabPutPointerRaw((theCab), (theKey), #theType, (thePtr), (destroyProc))` #### MAX_ASCAB_KEY Header: `ASExtraExpT.h:181` Value: `1024` Cabinet keys are `NULL`-terminated C strings. This constant declares the maximum length of one component of that string. The characters in the key string must all be low ASCII alphanumeric characters, such as `'0' - '9'`, `'a' - 'z'`, `'A' - 'Z'`. You can burrow through multiple levels of a cabinet heirarchy by passing in a string of individual key names separated by colons. For example, `ASCabGetInt(cab, "Hello:World", -1);` is equivalent to `ASCabGetInt(ASCabGetCab(cab, "Hello"), "World", -1);`. Similarly, `ASCabPutInt(theCab, "Hello:World", 33);` will create an integer key named `"World"` inside the `"Hello"` cabinet inside theCab, creating the `"Hello"` key and cabinet if necessary. ## ASCalendarTimeSpan ### Functions (3) #### ASCalendarTimeSpanAddWithBase ```cpp void ASCalendarTimeSpanAddWithBase(const ASCalendarTimeSpan timeSpan1, const ASCalendarTimeSpan timeSpan2, const ASDate baseDate, ASCalendarTimeSpan result) ``` Header: `ASExtraProcs.h:1993` Adds two calendar time spans, storing the result in another calendar time span object. Because the values in a calendar time span are not absolute (for example, a leap year has a different number of days), they are resolved with respect to the base date before the addition is done. The result is broken down into years, months, and so on, in the highest denomination possible. For example, a difference of 13 months is reported as 1 year and 1 month. **Parameters** - `timeSpan1` (`const ASCalendarTimeSpan`): The first calendar time span to add. - `timeSpan2` (`const ASCalendarTimeSpan`): The calendar time span to add. - `baseDate` ([`const ASDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDate)): The base date, or `NULL` to use Jan 1 1970 00:00:00, the epoch time. - `result` (`ASCalendarTimeSpan`): The calendar time span structure in which to store the result. **Returns:** `void` **See also:** [`ASCalendarTimeSpanCompare`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCalendarTimeSpanCompare), [`ASTimeSpanAdd`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpanAdd), [`ASDateAddCalendarTimeSpan`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateAddCalendarTimeSpan) #### ASCalendarTimeSpanCompare ```cpp ASInt32 ASCalendarTimeSpanCompare(const ASCalendarTimeSpan timeSpan1, const ASCalendarTimeSpan timeSpan2, const ASDate baseDate) ``` Header: `ASExtraProcs.h:1957` Compares two calendar time spans with respect to a base date. Because the values in a calendar time span are not absolute (for example, a leap year has a different number of days), they are resolved with respect to the base date before the comparison is made. **Parameters** - `timeSpan1` (`const ASCalendarTimeSpan`): The first calendar time span. - `timeSpan2` (`const ASCalendarTimeSpan`): The second calendar time span. - `baseDate` ([`const ASDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDate)): The base date, or `NULL` to use Jan 1 1970 00:00:00, the epoch time. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) `1` if `timeSpan1 > timeSpan2`, `0` if they are equal, and `-1` if `timeSpan1 < timeSpan2`. **See also:** [`ASDateCompare`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateCompare), [`ASTimeSpanCompare`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpanCompare) #### ASCalendarTimeSpanDiff ```cpp void ASCalendarTimeSpanDiff(const ASCalendarTimeSpan timeSpan1, const ASCalendarTimeSpan timeSpan2, const ASDate baseDate, ASCalendarTimeSpan result) ``` Header: `ASExtraProcs.h:2030` Calculates the difference between calendar time span objects and stores the result in the provided ASCalendarTimeSpan object. If `timeSpan2` is less than `timeSpan1`, the result is negative. Because the values in a calendar time span are not absolute (for example, a leap year has a different number of days), they are resolved with respect to the base date before the addition is done. The result is broken down into years, months, and so on, in the highest denomination possible. For example, a difference of 13 months is reported as 1 year and 1 month. **Parameters** - `timeSpan1` (`const ASCalendarTimeSpan`): The first calendar time span. - `timeSpan2` (`const ASCalendarTimeSpan`): The second calendar time span. - `baseDate` ([`const ASDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDate)): The base date, or `NULL` to use Jan 1 1970 00:00:00, the epoch time. - `result` (`ASCalendarTimeSpan`): The calendar time span object in which to store the difference. **Returns:** `void` **See also:** [`ASDateCalendarDiff`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateCalendarDiff), [`ASTimeSpanDiff`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpanDiff) ## ASCallback ### Functions (2) #### ASCallbackCreate ```cpp ASCallback ASCallbackCreate(ASExtension extensionID, void *proc) ``` Header: `CorProcs.h:191` Deprecated as of Acrobat 8.0. Creates a callback that allows the Acrobat viewer to call a function in a plug-in. All plug-in functions that are called by the Acrobat viewer must be converted to callbacks before being passed to the viewer. Whenever possible, plug-ins should not call ASCallbackCreate() directly, but should use the macros ASCallbackCreateProto(), ASCallbackCreateNotification(), and ASCallbackCreateReplacement(). These macros (which eventually call ASCallbackCreate()) have two advantages: • They allow compilers to perform type checking, eliminating one extremely common source of plug-in bugs. • They handle `extensionID` automatically. Plug-ins must use ASCallbackCreate() directly, for example, when calling a Mac toolbox routine that expects a `ProcPtr`. **Note:** If you call ASCallbackCreate() directly, you are actually invoking the ASCallbackCreate() macro, not this HFT routine. The ASCallbackCreate() macro takes only one parameter, the `proc`, and passes that information into this underlying HFT routine as the second argument. The first argument is always set to `gExtensionID`, which should be the extension identifier of your plug-in. **Parameters** - `extensionID` ([`ASExtension`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASExtension)): IN/OUT The `gExtensionID` extension that calls `proc`. - `proc` (`void *`): IN/OUT The user-supplied procedure for which a callback is created. **Returns:** [`ASCallback`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCallback) The newly-created callback. **See also:** [`ASCallbackDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCallbackDestroy), `AVAppRegisterNotification`, `AVAppUnregisterNotification`, `ASCallbackCreateReplacement`, [`ASCallbackCreateProto`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCallbackCreateProto), `ACCB1`, `ACCB2`, `DEBUG`, [`ASCallbackCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCallbackCreate) #### ASCallbackDestroy ```cpp void ASCallbackDestroy(ASCallback callback) ``` Header: `CorProcs.h:201` Deprecated as of Acrobat 8.0. Destroys a callback. **Parameters** - `callback` ([`ASCallback`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCallback)): IN/OUT The callback to destroy. **Returns:** `void` **See also:** [`ASCallbackCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCallbackCreate) ### Definitions (3) #### ASCallbackCreate Header: `CorCalls.h:544` Value: `(proc)` #### ASCallbackCreateProto Header: `CorCalls.h:543` Value: `(proc)` #### ASCallbackDestroy Header: `CorCalls.h:545` ## ASCryptStm ### Typedefs (7) #### ASCryptStmFCloseProc ```cpp typedef ASInt32(*) ASCryptStmFCloseProc(ASCryptStm stm)(ASCryptStm stm) ``` Header: `ASExpT.h:401` A callback for ASCryptStm. This closes a security stream. **See also:** [`ASCryptStmFFlushProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmFFlushProc), [`ASCryptStmFilBufProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmFilBufProc), [`ASCryptStmFlsBufProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmFlsBufProc), [`ASCryptStmFPutEOFProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmFPutEOFProc), [`ASCryptStmFResetProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmFResetProc), [`ASCryptStmUnGetcProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmUnGetcProc) #### ASCryptStmFFlushProc ```cpp typedef ASInt32(*) ASCryptStmFFlushProc(ASCryptStm stm)(ASCryptStm stm) ``` Header: `ASExpT.h:388` A callback for ASCryptStm. This flushes a dirty buffer if necessary. **See also:** [`ASCryptStmFCloseProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmFCloseProc), [`ASCryptStmFilBufProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmFilBufProc), [`ASCryptStmFlsBufProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmFlsBufProc), [`ASCryptStmFPutEOFProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmFPutEOFProc), [`ASCryptStmFResetProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmFResetProc), [`ASCryptStmUnGetcProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmUnGetcProc) #### ASCryptStmFPutEOFProc ```cpp typedef ASInt32(*) ASCryptStmFPutEOFProc(ASCryptStm stm)(ASCryptStm stm) ``` Header: `ASExpT.h:429` A callback for ASCryptStm. This puts an end-of-file (EOF) marker to a security stream. **See also:** [`ASCryptStmFCloseProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmFCloseProc), [`ASCryptStmFFlushProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmFFlushProc), [`ASCryptStmFilBufProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmFilBufProc), [`ASCryptStmFlsBufProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmFlsBufProc), [`ASCryptStmFResetProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmFResetProc), [`ASCryptStmUnGetcProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmUnGetcProc) #### ASCryptStmFResetProc ```cpp typedef ASInt32(*) ASCryptStmFResetProc(ASCryptStm stm)(ASCryptStm stm) ``` Header: `ASExpT.h:415` A callback for ASCryptStm. This resets a security stream, discarding any buffered data. It is called only during encryption (when writing to the stream, not when reading). **See also:** [`ASCryptStmFCloseProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmFCloseProc), [`ASCryptStmFFlushProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmFFlushProc), [`ASCryptStmFilBufProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmFilBufProc), [`ASCryptStmFlsBufProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmFlsBufProc), [`ASCryptStmFPutEOFProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmFPutEOFProc), [`ASCryptStmUnGetcProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmUnGetcProc) #### ASCryptStmFilBufProc ```cpp typedef ASInt32(*) ASCryptStmFilBufProc(ASCryptStm pistm)(ASCryptStm pistm) ``` Header: `ASExpT.h:341` A callback for ASCryptStm. This is called by `getc` when the buffer is empty. It is called only during decryption (when reading from the stream, not when writing). **See also:** [`ASCryptStmFCloseProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmFCloseProc), [`ASCryptStmFFlushProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmFFlushProc), [`ASCryptStmFlsBufProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmFlsBufProc), [`ASCryptStmFPutEOFProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmFPutEOFProc), [`ASCryptStmFResetProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmFResetProc), [`ASCryptStmUnGetcProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmUnGetcProc) #### ASCryptStmFlsBufProc ```cpp typedef ASInt32(*) ASCryptStmFlsBufProc(ASInt32 ch, ASCryptStm stm)(ASInt32 ch, ASCryptStm stm) ``` Header: `ASExpT.h:357` A callback for ASCryptStm. This is called by `putc` when the buffer is full. It is called only during encryption (when writing to the stream, not when reading). **See also:** [`ASCryptStmFCloseProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmFCloseProc), [`ASCryptStmFFlushProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmFFlushProc), [`ASCryptStmFilBufProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmFilBufProc), [`ASCryptStmFPutEOFProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmFPutEOFProc), [`ASCryptStmFResetProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmFResetProc), [`ASCryptStmUnGetcProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmUnGetcProc) #### ASCryptStmUnGetcProc ```cpp typedef ASInt32(*) ASCryptStmUnGetcProc(ASInt32 ch, ASCryptStm stm)(ASInt32 ch, ASCryptStm stm) ``` Header: `ASExpT.h:374` A callback for ASCryptStm. It goes back one character in the input stream, undoing a character `get` operation. It is called only during decryption (when reading from the stream, not when writing). **See also:** [`ASCryptStmFCloseProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmFCloseProc), [`ASCryptStmFFlushProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmFFlushProc), [`ASCryptStmFilBufProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmFilBufProc), [`ASCryptStmFlsBufProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmFlsBufProc), [`ASCryptStmFPutEOFProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmFPutEOFProc), [`ASCryptStmFResetProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCryptStmFResetProc) ### Structures (1) #### ASCryptStm ```cpp typedef struct _t_ASCryptStmRec* ASCryptStm ``` Header: `ASExpT.h:325` An ASStm object cover used for a cryptographic filter's stream callbacks. **See also:** [`PDCryptFilterStreamProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCryptFilterStreamProc) ### Definitions (4) #### ASCRYPTSTM_EOF Header: `ASExpT.h:306` Value: `(-1)` #### ASCryptStmModeEOF Header: `ASExpT.h:317` Value: `0x0004` #### ASCryptStmModeRead Header: `ASExpT.h:315` Value: `0x0001` #### ASCryptStmModeWrite Header: `ASExpT.h:316` Value: `0x0002` ## ASDate ### Functions (20) #### ASDateAddCalendarTimeSpan ```cpp void ASDateAddCalendarTimeSpan(ASDate date, const ASCalendarTimeSpan timeSpan) ``` Header: `ASExtraProcs.h:1834` Adds a calendar time span to a date. It modifies the date by the length of time provided in the ASCalendarTimeSpan object. **Note:** There is some ambiguity in a calendar time span; to add an exact time span (for example, 2592000 seconds rather than one month), use ASDateAddTimeSpan(). **Parameters** - `date` ([`ASDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDate)): The date. - `timeSpan` (`const ASCalendarTimeSpan`): The calendar time span to add. **Returns:** `void` **See also:** [`ASDateAddTimeSpan`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateAddTimeSpan), [`ASDateSubtractCalendarTimeSpan`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateSubtractCalendarTimeSpan) #### ASDateAddTimeSpan ```cpp void ASDateAddTimeSpan(ASDate date, const ASTimeSpan timeSpan) ``` Header: `ASExtraProcs.h:1859` Adds a time span (an exact number of seconds) to a date. It modifies the date by the length of time provided in the ASTimeSpan object. **Parameters** - `date` ([`ASDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDate)): The date. - `timeSpan` ([`const ASTimeSpan`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpan)): The time span to add. **Returns:** `void` **See also:** [`ASDateAddCalendarTimeSpan`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateAddCalendarTimeSpan), [`ASDateSubtractTimeSpan`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateSubtractTimeSpan), [`ASTimeSpanAdd`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpanAdd) #### ASDateCalendarDiff ```cpp void ASDateCalendarDiff(const ASDate date1, const ASDate date2, ASCalendarTimeSpan result) ``` Header: `ASExtraProcs.h:1875` Calculates the difference between two ASDate objects and stores the result in the provided ASCalendarTimeSpan object. The result is broken down into years, months, and so on, in the highest denomination possible. For example, a difference of 13 months is reported as 1 year and 1 month. **Parameters** - `date1` ([`const ASDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDate)): The first date. - `date2` ([`const ASDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDate)): The second date. - `result` (`ASCalendarTimeSpan`): The calendar time span structure in which to store the difference. **Returns:** `void` **See also:** [`ASDateExactDiff`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateExactDiff), [`ASDateCompare`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateCompare) #### ASDateClear ```cpp void ASDateClear(ASDate retVal) ``` Header: `ASExtraProcs.h:1664` Reinitializes a date object to the newly-allocated state, as returned by ASDateNew(). **Parameters** - `retVal` ([`ASDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDate)): The date object. **Returns:** `void` **See also:** [`ASDateDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateDestroy), [`ASDateNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateNew) #### ASDateCompare ```cpp ASInt32 ASDateCompare(const ASDate date1, const ASDate date2) ``` Header: `ASExtraProcs.h:2060` Tests whether one date is earlier or later than another. **Parameters** - `date1` ([`const ASDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDate)): The first date. - `date2` ([`const ASDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDate)): The second date. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) `1` if `date1 > date2`, `0` if they are equal, `-1` if `date1 < date2`. **See also:** [`ASDateExactDiff`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateExactDiff), [`ASTimeSpanCompare`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpanCompare), [`ASCalendarTimeSpanCompare`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCalendarTimeSpanCompare) #### ASDateCopy ```cpp void ASDateCopy(const ASDate original, ASDate copy) ``` Header: `ASExtraProcs.h:1675` Copies date and time data from one date object to another. **Parameters** - `original` ([`const ASDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDate)): The date to be copied. - `copy` ([`ASDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDate)): The date into which the data is copied. **Returns:** `void` **See also:** [`ASDateClear`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateClear), [`ASDateDup`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateDup) #### ASDateDestroy ```cpp void ASDateDestroy(ASDate date) ``` Header: `ASExtraProcs.h:1685` Releases and destroys a date object. **Parameters** - `date` ([`ASDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDate)): The date. **Returns:** `void` **See also:** [`ASDateClear`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateClear), [`ASDateDup`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateDup), [`ASDateNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateNew) #### ASDateDup ```cpp ASDate ASDateDup(const ASDate date) ``` Header: `ASExtraProcs.h:1654` Creates a new date object containing the same data as an existing date object. **Parameters** - `date` ([`const ASDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDate)): The date to duplicate. **Returns:** [`ASDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDate) The new date object. **See also:** [`ASDateCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateCopy), [`ASDateDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateDestroy), [`ASDateNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateNew) #### ASDateExactDiff ```cpp void ASDateExactDiff(const ASDate date1, const ASDate date2, ASTimeSpan result) ``` Header: `ASExtraProcs.h:1891` Calculates the exact difference in seconds between two date objects and stores the result in the provided ASTimeSpan object. If `date1` is earlier than `date2`, the result is negative. **Parameters** - `date1` ([`const ASDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDate)): The first date. - `date2` ([`const ASDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDate)): The second date. - `result` ([`ASTimeSpan`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpan)): The time span structure in which to store the difference. **Returns:** `void` **See also:** [`ASDateCalendarDiff`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateCalendarDiff), [`ASDateCompare`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateCompare), [`ASTimeSpanDiff`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpanDiff) #### ASDateGetLocalTime ```cpp ASTimeRec ASDateGetLocalTime(const ASDate date) ``` Header: `ASExtraProcs.h:1939` Creates a time record that represents the local time represented by the date object. The resulting local time might not account for daylight savings time correctly if the date object has been modified by adding or substracting a time span or calendar time span. It raises an exception if there is not enough memory. **Parameters** - `date` ([`const ASDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDate)): The date. **Returns:** `ASTimeRec` The newly created time record. **See also:** [`ASDateGetTimeString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateGetTimeString), [`ASDateGetUTCTime`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateGetUTCTime), [`ASDateSetTimeFromRec`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateSetTimeFromRec) #### ASDateGetTimeString ```cpp char * ASDateGetTimeString(const ASDate date, ASDateTimeFormat format) ``` Header: `ASExtraProcs.h:1910` Creates a time string from a date object according to a specified format. If time zone information is available in the date object, the string contains the local time along with the time zone adjustment, if that is supported by the requested format. It raises an exception if there is not enough memory. It is the client's responsibility to release the memory associated with the returned string using ASfree(). **Parameters** - `date` ([`const ASDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDate)): The date object. - `format` ([`ASDateTimeFormat`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateTimeFormat)): The format of the time string. **Returns:** `char *` The time string in the specified format. **See also:** [`ASDateClear`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateClear), [`ASDateGetLocalTime`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateGetLocalTime), [`ASDateGetUTCTime`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateGetUTCTime), [`ASDateSetTimeFromString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateSetTimeFromString) #### ASDateGetUTCTime ```cpp ASTimeRec ASDateGetUTCTime(const ASDate date) ``` Header: `ASExtraProcs.h:1924` Creates a time record that represents the UTC time represented by the date object. It raises an exception if there is not enough memory. **Parameters** - `date` ([`const ASDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDate)): The date object. **Returns:** `ASTimeRec` The newly created time record. **See also:** [`ASDateClear`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateClear), [`ASDateGetLocalTime`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateGetLocalTime), [`ASDateGetUTCTime`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateGetUTCTime), [`ASDateSetTimeFromString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateSetTimeFromString) #### ASDateNew ```cpp ASDate ASDateNew(void) ``` Header: `ASExtraProcs.h:1643` Creates a date object. The newly allocated object reflects the epoch time: Jan 1 1970 00:00:00 UTC. Raises an exception if there is not enough memory for the operation. **Parameters** - (unnamed) (`void`) **Returns:** [`ASDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDate) The newly created date object. **See also:** [`ASDateClear`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateClear), [`ASDateCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateCopy), [`ASDateDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateDestroy), [`ASDateDup`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateDup) #### ASDateSetLocalTimeOffset ```cpp void ASDateSetLocalTimeOffset(ASDate date) ``` Header: `ASExtraProcs.h:1765` Sets a date object's local time offset according to the operating system's current time zone information. Different operating systems handle daylight savings differently. This method causes the date object to always use the same daylight savings time offset that the operating system is currently using, even if the date object is modified. **Parameters** - `date` ([`ASDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDate)): The date. **Returns:** `void` **See also:** [`ASDateSetToCurrentLocalTime`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateSetToCurrentLocalTime), [`ASDateSetToCurrentUTCTime`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateSetToCurrentUTCTime) #### ASDateSetTimeFromRec ```cpp void ASDateSetTimeFromRec(ASDate date, const ASTimeRec *timeRec) ``` Header: `ASExtraProcs.h:1798` Initializes a date object from a time record. It raises an exception if the time structure represents an invalid time, such as January 32nd 1999 or Feb 29th 2001. It assumes that the parameters for the day and month in the time record are `1`-based. **Parameters** - `date` ([`ASDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDate)): The date object. - `timeRec` (`const ASTimeRec *`): The time record. **Returns:** `void` **See also:** [`ASDateClear`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateClear), [`ASDateSetToCurrentLocalTime`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateSetToCurrentLocalTime), [`ASDateSetToCurrentUTCTime`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateSetToCurrentUTCTime), [`ASDateSetTimeFromString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateSetTimeFromString) #### ASDateSetTimeFromString ```cpp void ASDateSetTimeFromString(ASDate date, const char *timeString, ASDateTimeFormat format) ``` Header: `ASExtraProcs.h:1782` Initializes a date object from a time string. It raises an exception if there is not enough memory, if the format is unrecognized, or if the time string is not formatted according to the supplied format. **Parameters** - `date` ([`ASDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDate)): The date object. - `timeString` (`const char *`): The time string, in the specified format. - `format` ([`ASDateTimeFormat`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateTimeFormat)): The format of the time string. kASTimeNone and kASTimeUniversalH are not supported. **Returns:** `void` **See also:** [`ASDateClear`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateClear), [`ASDateSetToCurrentLocalTime`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateSetToCurrentLocalTime), [`ASDateSetToCurrentUTCTime`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateSetToCurrentUTCTime), [`ASDateSetTimeFromString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateSetTimeFromString) #### ASDateSetToCurrentLocalTime ```cpp void ASDateSetToCurrentLocalTime(ASDate date) ``` Header: `ASExtraProcs.h:1751` Sets a date object to the current local time, using the time zone information from the operating system. **Parameters** - `date` ([`ASDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDate)): The date. **Returns:** `void` **See also:** [`ASDateClear`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateClear), [`ASDateGetLocalTime`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateGetLocalTime), [`ASDateSetToCurrentUTCTime`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateSetToCurrentUTCTime), [`ASDateSetLocalTimeOffset`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateSetLocalTimeOffset) #### ASDateSetToCurrentUTCTime ```cpp void ASDateSetToCurrentUTCTime(ASDate retVal) ``` Header: `ASExtraProcs.h:1739` Sets a date object to the current UTC time with no time zone information. **Parameters** - `retVal` ([`ASDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDate)): The date. **Returns:** `void` **See also:** [`ASDateClear`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateClear), [`ASDateGetUTCTime`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateGetUTCTime), [`ASDateSetToCurrentLocalTime`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateSetToCurrentLocalTime), [`ASDateSetLocalTimeOffset`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateSetLocalTimeOffset) #### ASDateSubtractCalendarTimeSpan ```cpp void ASDateSubtractCalendarTimeSpan(ASDate date, const ASCalendarTimeSpan timeSpan) ``` Header: `ASExtraProcs.h:1819` Subtracts a calendar time span from a date. It modifies the date by the length of time provided in the ASCalendarTimeSpan object. **Note:** There is some ambiguity in a calendar time span; to subtract an exact time span (for example, 2592000 seconds rather than one month), use ASDateSubtractTimeSpan(). **Parameters** - `date` ([`ASDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDate)): The date. - `timeSpan` (`const ASCalendarTimeSpan`): The calendar time span to subtract. **Returns:** `void` **See also:** [`ASDateAddCalendarTimeSpan`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateAddCalendarTimeSpan), [`ASDateSubtractTimeSpan`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateSubtractTimeSpan) #### ASDateSubtractTimeSpan ```cpp void ASDateSubtractTimeSpan(ASDate date, const ASTimeSpan timeSpan) ``` Header: `ASExtraProcs.h:1846` Subtracts a time span (an exact number of seconds) from a date. It modifies the date by the length of time provided in the ASTimeSpan object. **Parameters** - `date` ([`ASDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDate)): The date. - `timeSpan` ([`const ASTimeSpan`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpan)): The time span to subtract. **Returns:** `void` **See also:** [`ASDateAddTimeSpan`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateAddTimeSpan), [`ASDateSubtractCalendarTimeSpan`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateSubtractCalendarTimeSpan) ### Typedefs (1) #### ASDateTimeFormat ```cpp typedef ASEnum8 ASDateTimeFormat ``` Header: `ASExpT.h:4038` ### Structures (1) #### ASDate ```cpp typedef struct _t_ASDateRec* ASDate ``` Header: `ASExpT.h:4050` An opaque object holding information for a particular date and time. All ASDate objects are guaranteed to give accurate representation of UTC time, unadjusted for leap seconds. This is due to the fact that the introduction of leap seconds to the international calendar does not happen according to a well-defined rule. **Note:** ASDate objects are not guaranteed to represent local time accurately. To be exact, in Mac OS and UNIX, ASDate cannot always determine the prevailing daylight saving rule for the operating system's time zone. See ASDateGetCurrentLocalTime() for further explanation. **See also:** `ASDateGetCurrentLocalTime` ## ASDouble ### Functions (4) #### ASDoubleMatrixConcat ```cpp void ASDoubleMatrixConcat(ASDoubleMatrix *result, const ASDoubleMatrix *m1, const ASDoubleMatrix *m2) ``` Header: `ASProcs.h:2953` Multiplies two matrices. **Parameters** - `result` (`ASDoubleMatrix *`): (Filled by the method) A pointer to matrix `m2 x m1`. It is allowed for the result to point to the same location as either `m1` or `m2`. - `m1` (`const ASDoubleMatrix *`): A pointer to the `ASDoubleMatrix` value for the first matrix to multiply. - `m2` (`const ASDoubleMatrix *`): A pointer to the `ASDoubleMatrix` value for the second matrix to multiply. **Returns:** `void` **See also:** [`ASDoubleMatrixInvert`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDoubleMatrixInvert), [`ASDoubleMatrixTransform`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDoubleMatrixTransform), [`ASDoubleMatrixTransformRect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDoubleMatrixTransformRect) #### ASDoubleMatrixInvert ```cpp void ASDoubleMatrixInvert(ASDoubleMatrix *result, const ASDoubleMatrix *m) ``` Header: `ASProcs.h:2969` Inverts a matrix. If a matrix is nearly singular (which means that it has a determinant that is nearly zero), inverting and re-inverting the matrix may not yield the original matrix. **Parameters** - `result` (`ASDoubleMatrix *`): (Filled by the method) A pointer to `m-1`. It is allowed for the result to point to the same location as `m`. - `m` (`const ASDoubleMatrix *`): A pointer to the `ASDoubleMatrix` to invert. **Returns:** `void` **See also:** [`ASDoubleMatrixConcat`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDoubleMatrixConcat), [`ASDoubleMatrixTransform`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDoubleMatrixTransform), [`ASDoubleMatrixTransformRect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDoubleMatrixTransformRect) #### ASDoubleMatrixTransform ```cpp void ASDoubleMatrixTransform(ASDoublePoint *result, const ASDoubleMatrix *m, const ASDoublePoint *p) ``` Header: `ASProcs.h:2986` Transforms the point `p` through the matrix `m`, and puts the result in `result`. `p` and `result` can point to the same location. **Parameters** - `result` (`ASDoublePoint *`): (Filled by the method) A pointer to the `ASDoublePoint` containing the result of transforming `p` through `m`. It is allowed for the result to point to the same location as `m`. - `m` (`const ASDoubleMatrix *`): A pointer to the `ASDoubleMatrix` through which `p` is transformed. - `p` (`const ASDoublePoint *`): A pointer to the `ASDoublePoint` representing the point to transform through `m`. **Returns:** `void` **See also:** [`ASDoubleMatrixConcat`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDoubleMatrixConcat), [`ASDoubleMatrixInvert`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDoubleMatrixInvert), [`ASDoubleMatrixTransformRect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDoubleMatrixTransformRect) #### ASDoubleMatrixTransformRect ```cpp void ASDoubleMatrixTransformRect(ASDoubleRect *result, const ASDoubleMatrix *m, const ASDoubleRect *rectIn) ``` Header: `ASProcs.h:3004` Transforms a rectangle through a matrix. **Parameters** - `result` (`ASDoubleRect *`): (Filled by the method) A pointer to the `ASDoubleRect` containing the smallest bounding box for the transformed rectangle. It is allowed for the result to point to the same location as `m`. result will always have `bottom < top` and `left < right`. - `m` (`const ASDoubleMatrix *`): A pointer to the `ASDoubleMatrix` containing the matrix through which `r` is transformed. - `rectIn` (`const ASDoubleRect *`) **Returns:** `void` **See also:** [`ASDoubleMatrixTransform`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDoubleMatrixTransform), [`ASDoubleMatrixConcat`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDoubleMatrixConcat), [`ASDoubleMatrixInvert`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDoubleMatrixInvert) ### Typedefs (3) #### ASDouble ```cpp typedef double ASDouble ``` Header: `ASExpT.h:1221` The ASDouble type is a 64-bit type representing a floating number ASDoubleP is a pointer to an ASDouble object. **See also:** [`ASDoubleMatrixConcat`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDoubleMatrixConcat), [`ASDoubleMatrixInvert`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDoubleMatrixInvert), [`ASDoubleMatrixTransform`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDoubleMatrixTransform), [`ASDoubleMatrixTransformRect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDoubleMatrixTransformRect) #### ASDoubleP ```cpp typedef double * ASDoubleP ``` Header: `ASExpT.h:1221` #### ASReal ```cpp typedef float ASReal ``` Header: `ASExpT.h:1189` Definition of ASReal. ## ASException ### Functions (8) #### ASGetErrorString ```cpp const char * ASGetErrorString(ASErrorCode errorCode, char *buffer, ASTArraySize lenBuffer) ``` Header: `ASProcs.h:137` Gets a string describing the specified error/exception. **Parameters** - `errorCode` ([`ASErrorCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASErrorCode)): The exception whose error string is obtained. This must be a full error code, built with the ErrBuildCode() macro or a user-defined exception returned from ASRegisterErrorString(). See Errors for a list of predefined exceptions. - `buffer` (`char *`): (Filled by the method) A buffer into which the string is written. Make sure to `memset` the buffer to `0` before calling ASGetErrorString(). - `lenBuffer` ([`ASTArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize)): The number of characters that buffer can hold. **Returns:** `const char *` A useful pointer to `buffer`. This does not mean that the function worked. You must call `strlen` on the returned buffer (as long as you `memset` the buffer to `0`) to determine whether the error code was valid. **See also:** [`ASGetExceptionErrorCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASGetExceptionErrorCode), [`ASRegisterErrorString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASRegisterErrorString), [`ASRaise`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASRaise) #### ASGetErrorStringASText ```cpp void ASGetErrorStringASText(ASErrorCode errorCode, ASText errorString) ``` Header: `ASProcs.h:2810` Gets an ASText object containing a string describing the specified exception. **Parameters** - `errorCode` ([`ASErrorCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASErrorCode)): The exception whose error string is obtained. This must be a full error code, built with the ErrBuildCode macro or a user-defined exception returned from ASRegisterErrorString(). See Error Systems for a list of predefined exceptions. - `errorString` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): (Filled by the method) The text object containing the error string. The client must pass a valid ASText object. The routine does not allocate it. **Returns:** `void` **See also:** [`ASGetErrorString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASGetErrorString), [`ASRegisterErrorStringASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASRegisterErrorStringASText), [`ASRegisterErrorString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASRegisterErrorString), [`ASGetExceptionErrorCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASGetExceptionErrorCode), `ASRaise ErrorSystems` #### ASGetExceptionErrorCode ```cpp ASErrorCode ASGetExceptionErrorCode(void) ``` Header: `CorProcs.h:90` Gets the error code for the most recently raised exception. See Error Systems for a list of predefined exceptions. **Parameters** - (unnamed) (`void`) **Returns:** [`ASErrorCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASErrorCode) Exception error code. **See also:** [`ASRaise`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASRaise), [`ASGetErrorString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASGetErrorString), `ASRegisterErrorString ErrorSystems` #### ASPopExceptionFrame ```cpp void ASPopExceptionFrame(void) ``` Header: `CorProcs.h:78` Pops an exception frame off the stack. **Note:** You will probably never call ASPopExceptionFrame() directly; it is called for you as appropriate from within the `HANDLER`, `E_RETURN` and `E_RTRN_VOID` macros. **Parameters** - (unnamed) (`void`) **Returns:** `void` #### ASPushExceptionFrame ```cpp void ASPushExceptionFrame(void *asEnviron, ACRestoreEnvironProc restoreFunc) ``` Header: `CorProcs.h:68` Pushes an exception frame buffer and a frame-restoration callback onto the stack. The `restoreFunc` should be a function matching the following prototype. **Note:** You will probably never call ASPushExceptionFrame() directly; use the `DURING` macro instead. **Parameters** - `asEnviron` (`void *`): IN/OUT Represents a stack environment that is restored if an exception occurs. On Windows and Mac OS, this is a `jmp_buf`, which is an array of integers. - `restoreFunc` ([`ACRestoreEnvironProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ACRestoreEnvironProc)): IN/OUT Should be a function matching the following prototype: `ACCB1 void ACCB2 RestorePlugInFrame( void* asEnviron)` **Returns:** `void` #### ASRaise ```cpp void ASRaise(ASErrorCode error) ``` Header: `CorProcs.h:50` Raises an exception. Plug-ins can raise any exception defined in the `AcroErr.h` header file using the `ErrBuildCode` macro, or can define their own exceptions using ASRegisterErrorString(). See Errors for a list of predefined exceptions. If the code that calls ASRaise() gets control as a result of a non-Acrobat event (such as a drag and drop event on some platforms), this method fails since there is no Acrobat viewer code in the stack to handle the exception. **Parameters** - `error` ([`ASErrorCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASErrorCode)): An error code for the exception to raise. Error codes have three parts: severity, system, and error number. Use `ErrBuildCode` to build an error code for an existing error. **Returns:** `void` **See also:** [`ASGetErrorString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASGetErrorString), [`ASRegisterErrorString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASRegisterErrorString), `RERAISE` #### ASRegisterErrorString ```cpp ASErrorCode ASRegisterErrorString(ASErrSeverity severity, const char *errorString) ``` Header: `ASProcs.h:171` Registers a new error and string. The error can be used to raise a plug-in-specific exception using ASRaise(). When the exception is raised, its error string can be retrieved using ASGetErrorString() and reported to the user using AVAlertNote(). The error system is automatically forced to be ErrSysXtn. (See the list of Error Systems). The error is automatically assigned an error code that is not used by any other plug-in (in the current implementation, the Acrobat viewer increments a counter each time any plug-in requests an error code, and returns the value of the counter). As a result, plug-ins cannot rely on being assigned the same error code each time the Acrobat viewer is launched. ErrorSystems **Parameters** - `severity` ([`ASErrSeverity`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASErrSeverity)): The severity of the error being defined. It must be one of the Severities. - `errorString` (`const char *`): The string describing the exception. This string is used by ASGetErrorString(), and is copied by ASRegisterErrorString(); it may be freed by the plug-in after registering the error. **Returns:** [`ASErrorCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASErrorCode) The newly created error code. Plug-ins should assign the error code returned by this method to a variable if they will use the error code later in the current session. **See also:** [`ASGetErrorString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASGetErrorString), [`ASRaise`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASRaise) #### ASRegisterErrorStringASText ```cpp ASErrorCode ASRegisterErrorStringASText(ASErrSeverity severity, const ASText errorString) ``` Header: `ASProcs.h:2829` Registers a new error and string. **Parameters** - `severity` ([`ASErrSeverity`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASErrSeverity)): The severity of the error being defined. It must be one of the Error Severities. - `errorString` ([`const ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): The text object containing the error string to be set. **Returns:** [`ASErrorCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASErrorCode) **See also:** [`ASRegisterErrorString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASRegisterErrorString), [`ASGetErrorStringASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASGetErrorStringASText), [`ASGetErrorString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASGetErrorString), `ASRaise ErrorSeverities` ### Typedefs (3) #### ASErrSeverity ```cpp typedef ASEnum8 ASErrSeverity ``` Header: `ASExpT.h:292` #### ASErrorCode ```cpp typedef ASInt32 ASErrorCode ``` Header: `ASExpT.h:111` An error code value for use in `ASFile` and `ASFileSys` methods and callbacks. #### restoreEnvironProc ```cpp typedef void(*) restoreEnvironProc(void *asEnviron)(void *asEnviron) ``` Header: `CoreExpT.h:210` Environment-restoration functions are called when an exception is raised. ### Definitions (1) #### ASGetExceptionErrorCode Header: `CorCalls.h:548` Value: `ACGetExceptionErrorCode` ## ASExtension ### Functions (4) #### ASEnumExtensions ```cpp ASExtension ASEnumExtensions(ASExtensionEnumProc proc, void *clientData, ASBool onlyLivingExtensions) ``` Header: `CorProcs.h:276` Enumerates all ASExtension objects (valid plug-ins). **Parameters** - `proc` ([`ASExtensionEnumProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASExtensionEnumProc)): A user-supplied callback to call for each plug-in. Enumeration halts if `proc` returns `false`. - `clientData` (`void *`): A pointer to user-supplied data to pass to `proc` each time it is called. - `onlyLivingExtensions` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): If `true`, ASExtension objects that have been unloaded or otherwise deactivated are not enumerated. If `false`, all ASExtension objects are enumerated. **Returns:** [`ASExtension`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASExtension) If `proc` returned `false`, the last ASExtension that was enumerated is returned, `NULL` otherwise. **See also:** [`ASExtensionGetFileName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASExtensionGetFileName), [`ASExtensionGetRegisteredName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASExtensionGetRegisteredName) #### ASExtensionGetFileName ```cpp ASTArraySize ASExtensionGetFileName(ASExtension extension, char *buffer, ASTArraySize bufSize) ``` Header: `CorProcs.h:293` Gets the file name of an ASExtension. **Parameters** - `extension` ([`ASExtension`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASExtension)): IN/OUT The ASExtension whose file name is obtained. - `buffer` (`char *`): IN/OUT (Filled by the method, may be `NULL`) A pointer to a buffer for the file name. Pass `NULL` to have this method return the length of the file name (excluding a terminating `NULL` character).`buffer`. It is ignored if `buffer` is `NULL`. - `bufSize` ([`ASTArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize)) **Returns:** [`ASTArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize) The number of characters written into `buffer`, excluding the `NULL` character. **See also:** [`ASExtensionGetRegisteredName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASExtensionGetRegisteredName) #### ASExtensionGetRegisteredName ```cpp ASAtom ASExtensionGetRegisteredName(ASExtension extension) ``` Header: `CorProcs.h:304` Gets the registered name associated with a plug-in. **Parameters** - `extension` ([`ASExtension`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASExtension)): IN/OUT The ASExtension whose name is obtained. **Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom) An ASAtom representing the plug-in name, or `NULL` if the name could not be identified. **See also:** [`ASExtensionGetFileName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASExtensionGetFileName) #### ASExtensionMgrGetHFT ```cpp HFT ASExtensionMgrGetHFT(ASAtom name, ASVersion version) ``` Header: `CorProcs.h:215` Gets the specified version of the Host Function Table (HFT) that has the specified name. If you want to get one of the Acrobat viewer's built-in HFTs, use the predefined global variables for the HFT Values instead of this method. **Parameters** - `name` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The name of the HFT to obtain. - `version` ([`ASVersion`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASVersion)): The version number of the HFT to obtain. **Returns:** [`HFT`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFT) The specified HFT, or `NULL` if the HFT does not exist. **See also:** [`HFTReplaceEntry`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTReplaceEntry), [`HFTReplaceEntryEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTReplaceEntryEx) ### Typedefs (2) #### ExtensionID ```cpp typedef ASExtension ExtensionID ``` Header: `CoreExpT.h:197` #### ASExtensionEnumProc ```cpp typedef ASBool(*) ASExtensionEnumProc(ASExtension extension, void *clientData)(ASExtension extension, void *clientData) ``` Header: `CoreExpT.h:267` Enumeration function for ASEnumExtensions(). **See also:** [`ASEnumExtensions`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASEnumExtensions) ### Structures (1) #### ASExtension ```cpp typedef struct _t_ASExtension* ASExtension ``` Header: `CoreExpT.h:195` An opaque pointer to an object that identifies a specific loaded plug-in. A unique ASExtension object is created for each plug-in when it is loaded. If the plug-in fails to initialize, the ASExtension remains but is marked as inactive. **See also:** [`ASEnumExtensions`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASEnumExtensions) ### Definitions (1) #### ASExtensionMgrGetHFT Header: `CorCalls.h:549` Value: `ASGetHFTByNameAndVersion` ## ASFile ### Functions (33) #### ASFileAcquirePathName ```cpp ASPathName ASFileAcquirePathName(ASFile aFile) ``` Header: `ASProcs.h:1024` Gets the path name for a file and increments an internal reference count. It is the caller's responsibility to release the ASPathName when it is no longer needed by using ASFileSysReleasePath(). **Parameters** - `aFile` ([`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): IN/OUT The file whose path name is acquired. **Returns:** [`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName) **See also:** [`ASFileSysReleasePath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysReleasePath) #### ASFileCanSetEOF ```cpp ASBool ASFileCanSetEOF(ASFile file, ASInt32 newFileSize) ``` Header: `ASProcs.h:2473` Checks if ASFileSetEOF() can be done for this file with a specified new file size. **Parameters** - `file` ([`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): The file in question. - `newFileSize` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The proposed new file size. This parameter will be treated as unsigned. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) **See also:** [`ASFileSetEOF`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSetEOF), [`ASFileGetEOF`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileGetEOF), [`ASFileGetPos`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileGetPos) #### ASFileClearOutstandingMReads ```cpp void ASFileClearOutstandingMReads(ASFile fN) ``` Header: `ASProcs.h:1845` Clears all outstanding `mreads` for the given file. **Parameters** - `fN` ([`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): The file to clear `mreads` for. **Returns:** `void` **See also:** [`ASFileHasOutstandingMReads`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileHasOutstandingMReads) #### ASFileClose ```cpp ASErrorCode ASFileClose(ASFile aFile) ``` Header: `ASProcs.h:898` Closes the specified file. After a call to ASFileClose(), the file handle is no longer valid but may be reused as the result of a subsequent call to ASFileSysOpenFile(). **Parameters** - `aFile` ([`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): IN/OUT The file to close. The file must have been opened previously using ASFileSysOpenFile(). **Returns:** [`ASErrorCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASErrorCode) `0` if the operation was successful; some file system or platform-dependent error code is returned otherwise. **See also:** [`ASFileFlush`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileFlush), [`ASFileReopen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileReopen), [`ASFileStmRdOpen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileStmRdOpen), [`ASFileStmWrOpen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileStmWrOpen), [`ASFileSysOpenFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysOpenFile) #### ASFileFlush ```cpp void ASFileFlush(ASFile aFile) ``` Header: `ASProcs.h:1011` Flushes any buffered data to a file. This method may raise file system or platform-specific exceptions. **Parameters** - `aFile` ([`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): The file whose data is flushed. **Returns:** `void` **Exceptions** - `fileErrIO` **See also:** [`ASFileHardFlush`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileHardFlush) #### ASFileFromMDFile ```cpp ASBool ASFileFromMDFile(ASMDFile mdFile, ASFileSys fileSys, ASFile *pfN) ``` Header: `ASProcs.h:1267` Gets the ASFile associated with the specified ASMDFile and ASFileSys. **Parameters** - `mdFile` ([`ASMDFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASMDFile)): IN/OUT The ASMDFile for which the information is desired. - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): IN/OUT The ASFileSys through which `fileID` was opened.`NULL`) The ASFile representing `fileID` within `fileSys`.`true` if `fileID` is determined to be a valid file opened through `fileSys`, `false` otherwise. - `pfN` ([`ASFile *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)) **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) **See also:** [`ASFileGetFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileGetFileSys), [`ASFileGetMDFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileGetMDFile) #### ASFileGetEOF ```cpp ASTFilePos ASFileGetEOF(ASFile aFile) ``` Header: `ASProcs.h:963` Gets the current size of a file. It calls ASFileSysGetEofProc(). This call returns an error if the file size is greater than 2 GB. **Parameters** - `aFile` ([`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): The ASFile whose size is obtained. **Returns:** [`ASTFilePos`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTFilePos) The size of the file. **Exceptions** - `fileErrIO` **See also:** [`ASFileGetEOF64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileGetEOF64), [`ASFileSetEOF`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSetEOF), [`ASFileSetPos`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSetPos) #### ASFileGetEOF64 ```cpp ASFilePos64 ASFileGetEOF64(ASFile aFile) ``` Header: `ASProcs.h:2749` Gets the current size of a file. **Parameters** - `aFile` ([`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): IN/OUT The ASFile whose size is obtained. This call will work with files over 2 GB in length. **Returns:** [`ASFilePos64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFilePos64) The size of the file. **Exceptions** - `fileErrIO` **See also:** [`ASFileSetEOF64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSetEOF64), [`ASFileSetPos`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSetPos) #### ASFileGetFileSys ```cpp ASFileSys ASFileGetFileSys(ASFile aFile) ``` Header: `ASProcs.h:1035` Gets the file system through which a file was opened. **Parameters** - `aFile` ([`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): IN/OUT The open file whose file system is obtained. **Returns:** [`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys) The file's ASFileSys. **See also:** [`ASFileGetFileSysByName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileGetFileSysByName) #### ASFileGetFileSysByName ```cpp ASFileSys ASFileGetFileSysByName(ASAtom name) ``` Header: `ASProcs.h:1249` Gets the file system that was registered with the specified name. **Parameters** - `name` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): IN/OUT The ASAtom corresponding to the name of the file system to obtain. It may be one of the following: | String | Description | | --- | --- | | `"Mac_K"` | Mac OS file system | `"DOS_K"` — Classic Windows file system (it only supports host-encoded paths) `"Win_K"` Unicode Windows file system `"Unix_K"` UNIX file system `"CHTTP"` HTTP file system `"CDocumentum"` Documentum file system `"CODMA"` Open Document Management file system **Returns:** [`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys) The file system, otherwise `NULL` if no matching file system was found. **See also:** [`ASFileGetFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileGetFileSys) #### ASFileGetMDFile ```cpp ASBool ASFileGetMDFile(ASFile fN, ASMDFile *pFileID, ASFileSys *pFileSys) ``` Header: `ASProcs.h:1286` Given an ASFile, returns the `fileSys` and the ASMDFile identification in that `fileSys`. This call is needed for a file system in a plug-in to be able to call the inner routines in another file system. **Parameters** - `fN` ([`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): IN/OUT The ASFile for which the information is desired. - `pFileID` ([`ASMDFile *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASMDFile)): IN/OUT (Filled by the method, may be `NULL`) The ASMDFile identifier associated with file. - `pFileSys` ([`ASFileSys *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): IN/OUT (Filled by the method, may be `NULL`) The file system through which this file was opened. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the file is an open file, `false` otherwise. **See also:** [`ASFileFromMDFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileFromMDFile), [`ASFileGetFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileGetFileSys) #### ASFileGetOpenMode ```cpp ASFileMode ASFileGetOpenMode(ASFile fN) ``` Header: `ASProcs.h:1926` Gets the file access mode(s) specified for the file when it was opened. Return value from ASFileGetOpenMode(): Return value Meaning `0` created `1` readable `2` readable and writable `8` sequential access `16` local **Parameters** - `fN` ([`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): The file in question. **Returns:** [`ASFileMode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileMode) A value corresponding to one or more ASFileMode objects used to access or create the file, as shown in the table below. The values that can be returned include combinations of the following, OR'd with each other: #### ASFileGetPos ```cpp ASTFilePos ASFileGetPos(ASFile aFile) ``` Header: `ASProcs.h:931` Gets the current seek position in a file. This is the position at which the next read or write will begin. This call returns an error if the file position is greater than 2 GB. **Parameters** - `aFile` ([`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): IN/OUT The file in which to get the seek position. **Returns:** [`ASTFilePos`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTFilePos) The current seek position. **Exceptions** - `fileErrIO` **See also:** [`ASFileGetPos64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileGetPos64), [`ASFileSetPos`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSetPos), [`ASFileRead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileRead), [`ASFileWrite`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileWrite) #### ASFileGetPos64 ```cpp ASFilePos64 ASFileGetPos64(ASFile aFile) ``` Header: `ASProcs.h:2721` Gets the current seek position in a file. This is the position at which the next read or write will begin. This call will work with files over 2 GB in length. **Parameters** - `aFile` ([`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): IN/OUT The file in which to get the seek position. **Returns:** [`ASFilePos64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFilePos64) The current seek position. **Exceptions** - `fileErrIO` **See also:** [`ASFileSetPos64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSetPos64), [`ASFileRead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileRead), [`ASFileWrite`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileWrite) #### ASFileGetURL ```cpp char * ASFileGetURL(ASFile asf) ``` Header: `ASProcs.h:1873` Returns the URL associated with file. It is the caller's responsibility to release the memory associated with the returned string using ASfree(). @since **Parameters** - `asf` ([`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): IN/OUT The file in question. **Returns:** `char *` #### ASFileHardFlush ```cpp ASErrorCode ASFileHardFlush(ASFile aFile) ``` Header: `ASProcs.h:2054` Causes a hard flush on a file, which means that the file is flushed to the physical destination. For example, if a WebDAV-based file is opened, ASFileFlush() only flushes changes to the local cached version of the file. This method would flush changes all the way to the WebDAV server. **Parameters** - `aFile` ([`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): The file that is flushed. **Returns:** [`ASErrorCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASErrorCode) `0` if the operation succeeded, `-1` if there was an error. **See also:** [`ASFileFlush`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileFlush) #### ASFileHasOutstandingMReads ```cpp ASBool ASFileHasOutstandingMReads(ASFile fN) ``` Header: `ASProcs.h:2462` Determines whether there are any outstanding multi-byte range requests for a file. A document can have outstanding `mreads` if it was opened in a browser, Acrobat requested some byte ranges, and the byte ranges have not yet arrived. **Parameters** - `fN` ([`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): The file in question. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the file has outstanding `mreads`, `false` otherwise. #### ASFileIsSame ```cpp ASBool ASFileIsSame(ASFile fN, ASPathName pathName, ASFileSys fileSys) ``` Header: `ASProcs.h:1742` Performs a comparison between the file and path to determine if they represent the same file. This method will return `false` if the file was not opened through the `fileSys` file system. **Note:** This method is not guaranteed to work on all file systems. **Parameters** - `fN` ([`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): IN/OUT The file in question. - `pathName` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): IN/OUT The ASPathName in question. - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): IN/OUT The file system from which the path was obtained. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `false` if the comparison fails, `true` otherwise. #### ASFileMReadRequest ```cpp void ASFileMReadRequest(ASFile fN, ASInt32 *blockPairs, ASTCount nBlockPairs) ``` Header: `ASProcs.h:1837` Initiates a byte range request for a given file, if the file is in the browser. **Parameters** - `fN` ([`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): The file for which you wish to make read requests. - `blockPairs` ([`ASInt32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The array of `ASInt32` pairs. The first `ASInt32` in the pair is the offset into the file to read, and the second `ASInt32` is the length of the range to request. - `nBlockPairs` ([`ASTCount`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTCount)): The number of block pairs to request. **Returns:** `void` **See also:** [`ASFileHasOutstandingMReads`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileHasOutstandingMReads) #### ASFileOpenWithVirtualEOF ```cpp ASInt32 ASFileOpenWithVirtualEOF(ASFile fN, ASFilePos64 virtualEOF, ASFile *newFile) ``` Header: `ASProcs.h:3025` ASFileOpenWithVirtualEOF attempts to create a second ASFile instance to a file that is already open. Both the current instance fN and the new instance must be read only. The new instance shall set a virtual end of file. This virtual EOF and no effect on the first instance or on the physical file. It only effect the ASFile calls where newFile is passed in has the file. Each instance maintains it's own file position marker. The original instance of the file should be close after all other instances have been closed. This routine does not raise, but returns an error code. **Parameters** - `fN` ([`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): IN The ASFile to base the new file on - `virtualEOF` ([`ASFilePos64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFilePos64)): IN The new EOF. - `newFile` ([`ASFile *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): OUT the new ASFile. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) Error code if the newFile could not be created. #### ASFilePushData ```cpp void ASFilePushData(ASFile aFile, const char *p, ASTFilePos offset, ASTArraySize length) ``` Header: `ASProcs.h:1206` Sends data from a file system implementation to an ASFile. The data may be for a multi-read request call, or may be unsolicited. This method can only be called from within a file system implementation. It must not be called by clients of the ASFile, such as a caller that acquired the file with ASFileSysOpenFile(). **Parameters** - `aFile` ([`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): IN/OUT The file to which data is sent. - `p` (`const char *`): IN/OUT The data being pushed. - `offset` ([`ASTFilePos`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTFilePos)): IN/OUT A byte offset into the file at which the data should be written. - `length` ([`ASTArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize)): IN/OUT The number of bytes held in the buffer. **Returns:** `void` **Exceptions** - `fileErrGeneral` **See also:** [`ASFileRead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileRead), [`ASFileWrite`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileWrite) #### ASFileRead ```cpp ASTArraySize ASFileRead(ASFile aFile, char *p, ASTArraySize count) ``` Header: `ASProcs.h:984` Reads data from a file, beginning at the current seek position. **Parameters** - `aFile` ([`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): IN/OUT The file from which data is read. - `p` (`char *`): IN/OUT (Filled by the method) A buffer into which data is written. The buffer must be able to hold at least `count` bytes. - `count` ([`ASTArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize)): IN/OUT The number of bytes to read. **Returns:** [`ASTArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize) The number of bytes actually read from the file. **Exceptions** - `fileErrIO` - `fileErrUserRequestedStop` - `fileErrBytesNotReady` - `fileErrIOTimeout` - `fileErrGeneral` **See also:** [`ASFileSetPos`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSetPos), [`ASFileWrite`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileWrite) #### ASFileRegisterFileSys ```cpp ASBool ASFileRegisterFileSys(ASExtension extension, ASFileSys fileSys) ``` Header: `ASProcs.h:1225` Allows an implementor to provide a file system for use by external clients. An external client can locate the file system using ASFileGetFileSysByName(). `fileSys` provides its name via the ASFileSysGetFileSysNameProc() callback. This method returns `false` if a file system with the same name is already registered. **Parameters** - `extension` ([`ASExtension`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASExtension)): IN/OUT The gExtensionID of the plug-in registering the `fileSys`. - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): IN/OUT The ASFileSys being registered. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if `fileSys` is successfully registered, `false` otherwise. **See also:** [`ASFileUnregisterFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileUnregisterFileSys), [`ASFileGetFileSysByName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileGetFileSysByName) #### ASFileReopen ```cpp ASErrorCode ASFileReopen(ASFile aFile, ASFileMode mode) ``` Header: `ASProcs.h:880` Attempts to reopen a file using the specified read/write mode. On some platforms, this may result in the file being closed and then reopened, and some error conditions may render the file invalid. **Note:** The file mode and return types changed in 0x00060000. **Parameters** - `aFile` ([`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): The file to reopen. - `mode` ([`ASFileMode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileMode)): An open-mode value as specified for ASFileMode. **Returns:** [`ASErrorCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASErrorCode) `0` if the operation was successful; some file system or platform-dependent error code is returned otherwise. **See also:** [`ASFileSysOpenFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysOpenFile), [`ASFileClose`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileClose) #### ASFileSetEOF ```cpp void ASFileSetEOF(ASFile aFile, ASTFilePos newFileSize) ``` Header: `ASProcs.h:950` Changes the size of a file. The new size may by larger or smaller than the original size. Since this method does not return any values, the status can be assessed by examining the error code in the HANDLER clause. This method may raise file system or platform-specific exceptions. This call only works when the desired file size is less than 2 GB. **Parameters** - `aFile` ([`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): The file whose size is changed. - `newFileSize` ([`ASTFilePos`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTFilePos)): The new size of file. **Returns:** `void` **Exceptions** - `fileErrIO` - `asGenErrMethodNotImplemented` - `asFileErrGeneral` **See also:** [`ASFileSetEOF64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSetEOF64), [`ASFileCanSetEOF`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileCanSetEOF), [`ASFileGetEOF`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileGetEOF), [`ASFileGetPos`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileGetPos) #### ASFileSetEOF64 ```cpp void ASFileSetEOF64(ASFile aFile, ASFilePos64 newFileSize) ``` Header: `ASProcs.h:2736` Changes the size of a file. The new size may by larger or smaller than the original size. This method may raise file system or platform-specific exceptions. This call will work with files over 2 GB in length. **Parameters** - `aFile` ([`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): IN/OUT The file whose size is changed. - `newFileSize` ([`ASFilePos64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFilePos64)): IN/OUT The new size of the file. **Returns:** `void` **Exceptions** - `fileErrIO` **See also:** [`ASFileGetEOF64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileGetEOF64), [`ASFileGetPos`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileGetPos) #### ASFileSetMode ```cpp ASFlagBits ASFileSetMode(ASFile fN, ASFlagBits modeValue, ASFlagBits modeMask) ``` Header: `ASProcs.h:1510` Gets or sets the mode flags for a file. Pass `0` for `modeValue` and `modeMask` to simply get the current mode flags. **Note:** This operation is primarily intended for slow file systems such as the Internet, where there can potentially be an appreciable wait between requesting and retrieving bytes. **Parameters** - `fN` ([`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): The file for which to get or set the mode. - `modeValue` ([`ASFlagBits`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFlagBits)): The mode flag values to get or set, which are described in ASFileMode Flags. - `modeMask` ([`ASFlagBits`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFlagBits)): The mask for the mode flags to get or set. **Returns:** [`ASFlagBits`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFlagBits) The previous value of the mode, or `0` if the file system does not support this operation. **See also:** [`ASFileRead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileRead), [`ASFileSysOpenFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysOpenFile) #### ASFileSetPos ```cpp void ASFileSetPos(ASFile aFile, ASTFilePos pos) ``` Header: `ASProcs.h:914` Seeks to the specified position in a file. This is the position at which the next read or write will begin. This call only works when the desired file position is less than 2 GB. **Parameters** - `aFile` ([`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): IN/OUT The file in which to seek. - `pos` ([`ASTFilePos`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTFilePos)): IN/OUT The position to seek. **Returns:** `void` **Exceptions** - `fileErrIO` **See also:** [`ASFileSetPos64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSetPos64), [`ASFileGetPos`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileGetPos), [`ASFileRead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileRead), [`ASFileWrite`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileWrite) #### ASFileSetPos64 ```cpp void ASFileSetPos64(ASFile aFile, ASFilePos64 pos) ``` Header: `ASProcs.h:2705` Seeks to the specified position in a file. This is the position at which the next read or write will begin. This call will work with files over 2 GB in length. **Parameters** - `aFile` ([`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): IN/OUT The file in which to seek. - `pos` ([`ASFilePos64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFilePos64)): IN/OUT The position to seek. **Returns:** `void` **Exceptions** - `fileErrIO` **See also:** [`ASFileGetPos64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileGetPos64), [`ASFileRead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileRead), [`ASFileWrite`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileWrite) #### ASFileStmRdOpen ```cpp ASStm ASFileStmRdOpen(ASFile afile, ASSmallBufferSize bufSize) ``` Header: `ASProcs.h:1068` Creates a read-only ASStm from a file. The stream supports seek operations. **Parameters** - `afile` ([`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): The open file to associate with the stream. The file must have been opened previously using ASFileSysOpenFile(). Each open file has a unique ASFile. The ASFile value has meaning only to the common ASFile implementation and bears no relationship to platform-specific file objects. - `bufSize` ([`ASSmallBufferSize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASSmallBufferSize)): The length in bytes of the data buffer. If `bufSize` is `0`, the default buffer size (currently 4 K) will be used. The default is generally sufficient. A larger buffer size should be used only when data in the file will be accessed in chunks larger than the default buffer. Although `bufSize` is passed as an ASUns16, it is treated internally as an ASInt16. As a result, buffer sizes above 32 K are not permitted. **Returns:** [`ASStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStm) The newly created ASStm. **See also:** [`ASFileSysOpenFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysOpenFile), [`ASFileStmWrOpen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileStmWrOpen), [`ASMemStmRdOpen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASMemStmRdOpen), [`ASProcStmRdOpenEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASProcStmRdOpenEx), [`ASStmClose`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStmClose), [`ASStmRead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStmRead), [`CosNewStream`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewStream) #### ASFileStmWrOpen ```cpp ASStm ASFileStmWrOpen(ASFile afile, ASSmallBufferSize bufSize) ``` Header: `ASProcs.h:1566` Creates a writable ASStm from a file. The stream supports seek operations. **Parameters** - `afile` ([`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): The open file to associate with the stream. The file must have been opened previously using ASFileSysOpenFile(). Each open file has a unique ASFile. The ASFile value has meaning only to the common ASFile implementation and bears no relationship to platform-specific file objects. - `bufSize` ([`ASSmallBufferSize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASSmallBufferSize)): The length in bytes of a data buffer. If `bufSize` is `0`, the default buffer size (currently 4kB) is used. The default is generally sufficient. A larger buffer size should be used only when data in the file will be accessed in chunks larger than the default buffer. Although `bufSize` is passed as an ASUns16, it is treated internally as an ASInt16. As a result, buffer sizes above 32 K are not permitted. **Returns:** [`ASStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStm) The newly created ASStm. **Exceptions** - `genErrNoMemory` **See also:** [`ASProcStmWrOpen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASProcStmWrOpen), [`ASFileStmRdOpen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileStmRdOpen), [`ASMemStmRdOpen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASMemStmRdOpen), [`ASProcStmRdOpenEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASProcStmRdOpenEx), [`ASStmWrite`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStmWrite), [`ASStmRead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStmRead), [`ASStmClose`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStmClose), [`ASFileSysOpenFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysOpenFile), [`CosNewStream`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewStream) #### ASFileUnregisterFileSys ```cpp ASBool ASFileUnregisterFileSys(ASExtension extension, ASFileSys fileSys) ``` Header: `ASProcs.h:1184` Allows a `fileSys` to be unregistered. In general, a `fileSys` is only unregistered by the extension that registered it. @since **Parameters** - `extension` ([`ASExtension`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASExtension)): IN/OUT The gExtensionID of the plug-in un-registering `fileSys`. - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): IN/OUT The ASFileSys to un-register.`true` if `fileSys` successfully unregistered, `false` if there are any open files that were opened through `fileSys`. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) **See also:** [`ASFileRegisterFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileRegisterFileSys) #### ASFileWrite ```cpp ASTArraySize ASFileWrite(ASFile aFile, const char *p, ASTArraySize count) ``` Header: `ASProcs.h:1001` Writes data to a file, beginning at the current seek position. **Parameters** - `aFile` ([`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): IN/OUT The file to which data is written. - `p` (`const char *`): IN/OUT A buffer holding the data that is to be written. The buffer must be able to hold at least `count` bytes. - `count` ([`ASTArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize)): IN/OUT The number of bytes to write. **Returns:** [`ASTArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize) The number of bytes actually written to the file. **Exceptions** - `fileErrIO` - `fileErrWrite` **See also:** [`ASFileRead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileRead), [`ASFileSetPos`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSetPos) ### Typedefs (8) #### ASFile ```cpp typedef void* ASFile ``` Header: `ASExpT.h:1863` An opaque representation of a particular open file. Each open file has a unique ASFile. The ASFile value has meaning only to the common ASFile implementation and bears no relationship to platform-specific file objects. **See also:** [`PDDocGetFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetFile), [`ASFileSysOpenFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysOpenFile), [`ASFileFromMDFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileFromMDFile) #### ASFileOffset ```cpp typedef ASInt32 ASFileOffset ``` Header: `ASExpT.h:101` A file offset value for use in callback procedures. **See also:** [`CosDocEnumEOFsProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocEnumEOFsProc) #### ASFileOffset64 ```cpp typedef ASInt64 ASFileOffset64 ``` Header: `ASExpT.h:102` #### ASFilePos ```cpp typedef ASUns32 ASFilePos ``` Header: `ASExpT.h:95` A file position value for use in callback procedures. This value cannot exceed 2 GB. **See also:** [`CosObjOffsetProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjOffsetProc) #### ASFilePos64 ```cpp typedef ASUns64 ASFilePos64 ``` Header: `ASExpT.h:105` The absolute position within a file. This value can exceed 2 GB. #### ASMDFile ```cpp typedef void* ASMDFile ``` Header: `ASExpT.h:1929` ASMDFile replaces MDFile. MDFile is an obsolete name for this data type for backward compatibility. An MDFile is an opaque representation of a file instance for a particular file system. File system implementors may choose any convenient representation for an MDFile. In particular, file systems need not worry about MDFile space conflicts; the ASFile object exported by the common implementation is guaranteed to be unique across all open files, and the common implementation maps calls of ASFile methods to calls of ASFileSystem callbacks with the corresponding MDFile. **See also:** [`ASFileFromMDFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileFromMDFile), [`ASFileGetMDFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileGetMDFile), [`ASFileSysAsyncAbortProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysAsyncAbortProc), [`ASFileSysGetFileFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysGetFileFlags), [`ASFileSysYieldProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysYieldProc), [`ASFileSysMReadRequestProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysMReadRequestProc), [`ASFileSysClearOutstandingMReadsProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysClearOutstandingMReadsProc), [`ASFileSysGetStatusProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysGetStatusProc), [`ASFileSysOpenProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysOpenProc), [`ASFileSysCloseProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysCloseProc), [`ASFileSysFlushProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysFlushProc), [`ASFileSysSetPosProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysSetPosProc), [`ASFileSysGetPosProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysGetPosProc), [`ASFileSysSetEofProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysSetEofProc), [`ASFileSysGetEofProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysGetEofProc), [`ASFileSysReadProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysReadProc), [`ASFileSysWriteProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysWriteProc), [`ASFileSysRenameProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysRenameProc), [`ASFileSysIsSameFileProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysIsSameFileProc) #### ASTFilePos ```cpp typedef ASInt32 ASTFilePos ``` Header: `ASExpT.h:204` A numeric count value for use in I/O methods and data structures. **See also:** [`ASFileGetEOF`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileGetEOF), [`ASFileGetPos`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileGetPos), [`ASFilePushData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFilePushData), [`ASFileSetPos`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSetPos), [`ASFileCompletionProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileCompletionProc), [`ASFileSysMReadRequestProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysMReadRequestProc) #### ASFileCompletionProc ```cpp typedef void(*) ASFileCompletionProc(ASFile aFile, const char *p, ASTFilePos fileOffsetRequested, ASTArraySize countRequested, ASTArraySize nBytesRead, ASErrorCode error, void *compProcClientData)(ASFile aFile, const char *p, ASTFilePos fileOffsetRequested, ASTArraySize countRequested, ASTArraySize nBytesRead, ASErrorCode error, void *compProcClientData) ``` Header: `ASExpT.h:1887` Called when an asynchronous read or write request has completed. **See also:** [`ASFileSysAsyncAbortProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysAsyncAbortProc), [`ASFileSysAsyncReadProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysAsyncReadProc), [`ASFileSysAsyncWriteProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysAsyncWriteProc), [`ASFileSysYieldProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysYieldProc) ### Enums (1) #### ASFileStatusFlags Header: `ASExpT.h:1946` Values returned by ASFileSysGetStatusProc(). **Values** - `kASFileOkay = 0x0000`: The MDFile is in a valid state. - `kASFileIsTerminating = 0x0001`: The MDFile is being closed (for example, because the file is being displayed in a web browser's window and the user cancelled downloading). **See also:** [`ASFileRead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileRead), [`ASFileSysGetStatusProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysGetStatusProc) ### Definitions (22) #### ASFILE_CREATE Header: `ASExpT.h:1501` Value: `4` Create the file if it does not exist. #### ASFILE_ENCRYPT Header: `ASExpT.h:1531` Value: `128` File is to be encrypted when written to disk Encryption is with an instance specific key, so that the file is NOT readable if it is accidentally left when Acrobat exits (say, on a crash) #### ASFILE_LOCAL Header: `ASExpT.h:1511` Value: `16` A hint indicating that a local copy of the file will be needed. #### ASFILE_RANDOMACCESS Header: `ASExpT.h:1516` Value: `32` A hint indicating that the file will be primarily accessed randomly. #### ASFILE_READ Header: `ASExpT.h:1491` Value: `1` Open the file for reading. #### ASFILE_SERIAL Header: `ASExpT.h:1506` Value: `8` A hint indicating that the file will be primarily accessed sequentially. #### ASFILE_TEMPORARY Header: `ASExpT.h:1523` Value: `64` A hint that file is for temporary usage. Disk backing store is deleted on close, writes are not flushed to disk on close. If possible the file will be kept in memory. #### ASFILE_WRITE Header: `ASExpT.h:1496` Value: `2` Open the file for writing. #### MDFile Header: `ASExpT.h:1931` Value: `ASMDFile` #### kASFileDialUp Header: `ASExpT.h:1562` Value: `0x00000010L` Set if media/access is a dial up connection. This flag is only fully implemented on Windows. On Mac OS, this flag is always conservatively set to `true`. #### kASFileDoCaching Header: `ASExpT.h:1555` Value: `0x00000008L` Set if the file is to be cached (requires kASFileUseMRead to be set as well). #### kASFileHasOutstandingMReads Header: `ASExpT.h:1572` Value: `0x00000040L` `true` if the file has outstanding MReads. #### kASFileHasVirtualEOF Header: `ASExpT.h:1577` Value: `0x00000080L` `true` if the file is built with a Virtual EOF (Acrobat 10). #### kASFileModeDisableExplicitMReadRequests Header: `ASExpT.h:1592` Value: `0x0002` If set, the file will be read all at once regardless of multiple read requests. #### kASFileModeDoNotYieldIfBytesNotReady Header: `ASExpT.h:1585` Value: `0x0001` If set, ASFileRead does not yield if bytes are not ready (which raises the fileErrBytesNotReady exception). #### kASFileNoRequestIfBytesNotReady Header: `ASExpT.h:1605` Value: `0x0008` If set, no read requests are issued if bytes are not ready (that is, the bytes are not in the cache). #### kASFileRaiseIfBytesNotReady Header: `ASExpT.h:1599` Value: `0x0004` If set, ASFileRead will raise the fileErrBytesNotReady exception when trying to read from a file with a cache for which the requested bytes are not yet present. #### kASFileSlowConnect Header: `ASExpT.h:1545` Value: `0x00000002L` Set if initiating each access to the file is slow. For example, access may be slow because the file is served by an HTTP server that spawns a new process for each request. #### kASFileSlowTransfer Header: `ASExpT.h:1537` Value: `0x00000001L` Set if the file's data transfer rate is generally slow. @ingroup ASFileFlags #### kASFileStillFetching Header: `ASExpT.h:1567` Value: `0x00000020L` Set if the file is still being loaded. #### kASFileSuspendIfBytesNotReady Header: `ASExpT.h:1614` Value: `0x0010` If set, `ASFileRead` will suspend the current thread when trying to read from a file with a cache for which the requested bytes are not yet present. Note that if `kASFileSuspendIfBytesNotReady` is set, the `kASFileRaiseIfBytesNotReady` is ignored. #### kASFileUseMRead Header: `ASExpT.h:1550` Value: `0x00000004L` Use multi-read commands to access the file. ## ASFileSys ### Functions (47) #### ASFileSysAcquireFileSysPath ```cpp ASPathName ASFileSysAcquireFileSysPath(ASFileSys oldFileSys, ASPathName oldPathName, ASFileSys newFileSys) ``` Header: `ASProcs.h:1489` Converts an ASPathName from one file system to another. It returns an ASPathName acquired through `newFileSys` that refers to an image (which may possibly be cached) of the file in `oldfileSys`. Use this call to get a local file that is an image of a remote file (in a URL file system, for example). This is needed by programs such as the QuickTime Movie Player, because they can only work from local file-system files. The returned ASPathName may be a reference to a cache, so the file should be treated as read-only. Because of the possibility of cache flushing, you must hold a copy of the remote file's ASPathName for the duration of use of the local file. Do not remove the local file copy, since the `newFileSys` system does not know about the linkage to the remote (`oldFileSys`) file! The source file does not have to be open. This call is handled by `oldFileSys` if `oldFileSys` contains the appropriate procedure. Otherwise it is handled by copying the file. The source file is closed at the end of the copy if it was not open prior to the call. It is the caller's responsibility to release the ASPathName when it is no longer needed by using ASFileSysReleasePath(). **Parameters** - `oldFileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): IN/OUT (May be `NULL`) The file system from which `oldPathName` was obtained. Pass `NULL` to use the default file system. - `oldPathName` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): IN/OUT The ASPathname in the current file system. - `newFileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): IN/OUT (May be `NULL`) The file system to which the `oldPathName` is converted. Pass `NULL` to use the default file system. **Returns:** [`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName) The ASPathName in `newFileSys` or `NULL` if one cannot be made. **Exceptions** - `ERR_NOMEMORY` - `fileErrIO` - `fileErrUserRequestedStop` - `fileErrBytesNotReady` - `fileErrIOTimeout` - `fileErrGeneral` - `fileErrWrite` **See also:** [`ASFileSysCreatePathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysCreatePathName) #### ASFileSysAcquireParent ```cpp ASPathName ASFileSysAcquireParent(ASFileSys fileSys, ASPathName pathName) ``` Header: `ASProcs.h:1726` Returns the parent folder of the file system object associated with `pathName`. The following rules apply in the default file systems: • `pathName` may be associated with either a file or a folder. • The file system object associated with `pathName` need not exist. It is the caller's responsibility to release the returned ASPathName. **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): IN/OUT (May be `NULL`) The file system from which `pathName` was obtained. Pass `NULL` to use the default file system. - `pathName` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): IN/OUT The ASPathName. **Returns:** [`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName) The ASPathName associated with the parent folder. The method will return `NULL` if the parent could not be returned. **Exceptions** - `genErrNoMemory` - `fileErrIO` - `fileErrUserRequestedStop` - `fileErrBytesNotReady` - `fileErrIOTimeout` - `fileErrGeneral` - `fileErrWrite` **See also:** [`ASFileSysCreatePathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysCreatePathName) #### ASFileSysAcquirePlatformPath ```cpp ASInt32 ASFileSysAcquirePlatformPath(ASFileSys fileSys, ASPathName path, ASAtom platformPathType, ASPlatformPath *platformPath) ``` Header: `ASProcs.h:2280` Returns a platform-specific file system representation of the specified path, according to the specified type, wrapped in an allocated ASPlatformPath object. It calls ASFileSysAcquirePlatformPathProc(). This method creates an equivalent platform-specific type (such as FSRef on Mac OS) from an ASPathName. Use ASFileSysCreatePathName() for the reverse situation to create an equivalent ASPathName from a platform-specific type. In previous releases, you could cast an ASPathName to an FSSpec, for example, but that no longer works because of changes to accommodate long, Unicode file names on Mac OS X). When developing for Mac OS, use this call to get an FSSpec from an ASPathName safely on Mac OS X, without casting. However, it is recommended that you transition to using newer types such as FSRef to be compatible with OS X filenames, or change to using all ASFileSys methods. ASAtom value Operating system FSRefWithCFStringRef Mac OS FSSpec Mac OS CFURLRef Mac OS POSIXPath Mac OS FSRef (`pathName` object must exist) Mac OS `CString` Windows/UNIX **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): (May be `NULL`) The file system from which `pathName` was obtained. Pass `NULL` to use the default file system. - `path` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): The ASPathName in the file system specified by fileSys. - `platformPathType` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The platform path type, one of the following ASAtom values: - `platformPath` ([`ASPlatformPath *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPlatformPath)): (Filled by the method) The new platform path object. Always free this object with ASFileSysReleasePlatformPath() when done. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) `0` if the operation was successful, non-zero error code otherwise. **See also:** [`ASFileSysReleasePlatformPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysReleasePlatformPath) #### ASFileSysCanPerformOpOnItem ```cpp ASInt32 ASFileSysCanPerformOpOnItem(ASFileSys fileSys, ASPathName pathName, const char *op) ``` Header: `ASExtraProcs.h:2253` Tests whether a given operation can be performed on a particular file. It calls the canPerformOpOnItem() procedure registered for the `ASFileSysRec`, which determines whether the operation is one of the file system-defined operation strings for which there is a handler. **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): (May be `NULL`) The file system from which `pathName` was obtained. Pass `NULL` to use the default file system. - `pathName` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): The ASPathName of the file. - `op` (`const char *`): The name of the operation to test. A file system-defined string handled by ASFileSysCanPerformOpOnItemProc(). **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) `asGenErrNoError` if the operation can be performed on the item, or an error indicating why the oepration would fail. **See also:** [`ASFileSysPerformOpOnItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysPerformOpOnItem) #### ASFileSysConvertCabToItemProps ```cpp ASInt32 ASFileSysConvertCabToItemProps(ASFileSysItemProps props, ASCab theCab) ``` Header: `ASExtraProcs.h:2194` Converts a set of item properties from the ASCab format to the `ASFileSysItemPropsRec` format. **Parameters** - `props` (`ASFileSysItemProps`): (Filled by the method) The item properties structure. - `theCab` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)): Properties describing the object, in cabinet format. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) `0` if no error was encountered; otherwise an error code is returned. **Exceptions** - `genErrBadParm` - `genErrMethodNotImplemented` **See also:** [`ASFileSysConvertItemPropsToCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysConvertItemPropsToCab), [`ASFileSysGetItemProps`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysGetItemProps), [`ASFileSysGetItemPropsAsCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysGetItemPropsAsCab) #### ASFileSysConvertItemPropsToCab ```cpp ASInt32 ASFileSysConvertItemPropsToCab(ASCab theCab, const ASFileSysItemPropsRec *props) ``` Header: `ASExtraProcs.h:2233` Converts a set of item properties from the ASFileSysItemPropsRec format to the ASCab format. The ASCab has the following potential entries: | Key Name | Type | | --- | --- | | `isThere` | ASBool | | `type` | ASInt32 | | `isHidden` | ASBool | | `isReadOnly` | ASBool | `creationDate` — `char*` (PDF style date string) `modDate` `char*` (PDF style date string) `fileSizeHigh` ASUns32 `fileSizeLow` ASUns32 `folderSize` ASInt32 `creatorCode` ASUns32 `typeCode` ASUns32 `versionMajor` ASUns32 `versionMinor` ASUns32 `isCheckedOut` ASBool `isPublished` ASBool **Parameters** - `theCab` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)): (Filled by the method) Properties describing the object, in cabinet format. - `props` (`const ASFileSysItemPropsRec *`): The item properties structure. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) `0` if no error was encountered; otherwise an error code is returned. **Exceptions** - `genErrBadParm` - `genErrMethodNotImplemented` **See also:** [`ASFileSysConvertCabToItemProps`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysConvertCabToItemProps), [`ASFileSysGetItemProps`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysGetItemProps), [`ASFileSysGetItemPropsAsCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysGetItemPropsAsCab) #### ASFileSysCopyPath ```cpp ASPathName ASFileSysCopyPath(ASFileSys fileSys, ASPathName pathName) ``` Header: `ASProcs.h:787` Generates and copies the specified ASPathName (but does not copy the file specified by the path name). The ASPathName must have been obtained through the specified file system. This method may be used regardless of whether the file specified by path name is open. It is the caller's responsibility to release the ASPathName when it is no longer needed by using ASFileSysReleasePath(). **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): (May be `NULL`) The file system from which `pathName` was obtained. Pass `NULL` to use the default file system. - `pathName` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): The ASPathName to copy. **Returns:** [`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName) A copy of `pathName`. **See also:** [`ASFileSysReleasePath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysReleasePath) #### ASFileSysCreateFolder ```cpp ASErrorCode ASFileSysCreateFolder(ASFileSys fileSys, ASPathName path, ASBool recurse) ``` Header: `ASProcs.h:1889` Creates an empty folder at the specified `pathName`. **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): (May be `NULL`) The file system from which `pathName` was obtained. Pass `NULL` to use the default file system. - `path` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): The path of the folder to create. - `recurse` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): Recursively create the parent folder if necessary. **Returns:** [`ASErrorCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASErrorCode) `0` if the operation was successful, a non-zero platform-dependent error code otherwise. **Exceptions** - `genErrMethodNotImplemented` - `fileErrFNF` **See also:** [`ASFileSysRemoveFolder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysRemoveFolder) #### ASFileSysCreatePathName ```cpp ASPathName ASFileSysCreatePathName(const ASFileSys fileSys, ASAtom pathSpecType, const void *pathSpec, const void *additionalData) ``` Header: `ASProcs.h:1437` Creates an ASPathName based on the input type and `pathSpec`. Each `fileSys` implementation must publish the input types that it accepts. It is the caller's responsibility to release the ASPathName when it is no longer needed by using ASFileSysReleasePath(). Developers should consider using the simpler helper macros instead of using the call directly. **Note:** This method does not work for relative POSIX paths on Mac OS; only absolute POSIX paths will work. **Note:** Two of the parameters below, DIPath and DIPathWithASText, are File Specification Strings. See ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.11.2, page 100. You can find this document on the web store of the International Standards Organization (ISO). Data type Description `"Cstring"` Accepted by the default file system on all platforms. `pathSpec` is a `NULL`- terminated `char*`. On Mac OS it must be an absolute path separated by colons, as in `"VolumeName:Folder:file.pdf"`. On Windows the path may be absolute, as in `"C:\\folder\\file.pdf"` or relative as in `"...\\folder\\file.pdf"`. On UNIX the path may be absolute as in `"/folder/file.pdf"` or relative as in `".../folder/file.pdf"`. `"FSSpec"` Accepted by the default file system on Mac OS. `pathSpec` is a pointer to a valid FSSpec. This type is deprecated in Acrobat 9.0. Use FSRef, FSRefWithCFStringRef, CFURLRef, or POSIXPath instead. `"FSRef"` Accepted by the default file system on Mac OS. `pathSpec` is a valid FSRef. `"FSRefWithCFStringRef"` Accepted by the default file system on Mac OS. `pathSpec` is a pointer to a valid `FSRefWithCFStringRefRec`. `"CFURLRef"` Accepted by the default file system on Mac OS. `pathSpec` is a valid CFURLRef. `"POSIXPath"` Accepted by the default file system on Mac OS. `pathSpec` is a `NULL`-terminated `char*` containing a POSIX-style, UTF-8 encoded path string. `"SFReply"` In the past this was accepted by the default file system on Mac OS. This type is deprecated and should not be used. `"DIPath"` Accepted by the default file system on Windows and Mac OS. `pathSpec` is a device-independent path. See "File Specification Strings," in ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.11.2, page 100. `pathSpec` can contain an absolute or relative path. If a relative path is used, the method will evaluate that path against an ASPathName passed in the `mustBeZero` parameter. `"DIPathWithASText"` Accepted by the default file system on Windows and Mac OS. `pathSpec` is a device-independent path, in the form of an ASText. See "File Specification Strings," in ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.11.2, page 100. `pathSpec` can contain an absolute or relative path. If a relative path is used, the method will evaluate that path against an ASPathName passed in the `mustBeZero` parameter. `"FolderPathName"` Accepted by the default file system on Windows and Mac OS. `pathSpec` is an ASPathName that contains the path of a folder. `mustBeZero` is a C string containing the name of the file. The returned ASPathName contains the result of appending `mustBeZero` to `pathSpec`. `"FolderPathNameWithASText"` Accepted by the default file system on Windows and Mac OS. `pathSpec` is an ASPathName that contains the path of a folder. `mustBeZero` is an ASText containing the name of the file. The returned ASPathName contains the result of appending `mustBeZero` to `pathSpec`. `"WinUnicodePath"` Accepted by the default file system on Windows. If a PDF document has a file name using Unicode characters, such as Mandarin or Korean characters, the file can be opened in Adobe PDF Library using the WinUnicodePath ASAtom. **Parameters** - `fileSys` ([`const ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): (May be `NULL`) The ASFileSys in which you are trying to create an ASPathName. Pass `NULL` to use the default file system. - `pathSpecType` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): An ASAtom specifying the data type in `pathSpec`, as follows: - `pathSpec` (`const void *`): The file specification from which to create an ASPathName. Relative paths are evaluated from the directory containing the executable (if used with the PDF Library), or the directory containing Acrobat (if used in a plug-in). - `additionalData` (`const void *`): See `pathSpecType` parameter description. **Returns:** [`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName) The newly created path name, or `NULL` on failure. **Exceptions** - `genErrBadParm`: on Windows if the `pathSpecType` is not recognized. - `genErrMethodNotImplemented` **See also:** [`ASFileSysCopyPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysCopyPath), [`ASFileSysCreatePathFromCString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysCreatePathFromCString), [`ASFileSysCreatePathFromDIPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysCreatePathFromDIPath), [`ASFileSysCreatePathFromFSSpec`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysCreatePathFromFSSpec), [`ASFileSysCreatePathWithFolderName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysCreatePathWithFolderName) #### ASFileSysDIPathFromPath ```cpp char * ASFileSysDIPathFromPath(ASFileSys fileSys, ASPathName path, ASPathName relativeToThisPath) ``` Header: `ASProcs.h:727` Converts a file name, specified as an ASPathName, to a device-independent path name. It is the caller's responsibility to free the memory associated with the returned string using ASfree(). **Note:** On Mac OS, if `pathName` and `relativeToThisPath` refer to files that are on different volumes, the method returns an absolute path. **Note:** This method can only be used to get host encoding. For any other encoding, use ASFileSysDIPathFromPathEx(). For a description of the device-independent path name format, see "File Specification Strings," in ISO 32000-1:2008, Document Management- Portable Document Format-Part 1: PDF 1.7, section 7.11.2, page 100. You can find this document on the web store of the International Standards Organization (ISO). This path name may not be understood on another platform since drive specifiers may be prepended. **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): (May be `NULL`) The file system from which `pathName` was obtained. Pass `NULL` to use the default file system. - `path` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): The ASPathName to convert. - `relativeToThisPath` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): (May be `NULL`) The path name relative to which the device-independent path name is specified. If `NULL`, the device-independent path name will be an absolute, not a relative, path name. **Returns:** `char *` A device-independent path name corresponding to the parameter values supplied, or `NULL` if the operation is not supported by the file system. **See also:** [`ASGetDefaultFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASGetDefaultFileSys), [`ASFileSysPathFromDIPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysPathFromDIPath) #### ASFileSysDIPathFromPathEx ```cpp ASErrorCode ASFileSysDIPathFromPathEx(ASFileSys fileSys, ASPathName path, ASPathName relativeToThisPath, ASText diPathText) ``` Header: `ASProcs.h:2532` Converts a file name, specified as an ASPathName, to a device-independent path name, which is returned as an ASText object. It calls ASFileSysDIPathFromPathExProc(). This method supersedes ASFileSysDIPathFromPath(). **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): (May be `NULL`) The file system from which `pathName` was obtained. Pass `NULL` to use the default file system. - `path` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): The ASPathName to convert. - `relativeToThisPath` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): (May be `NULL`) The path name relative to which the device-independent path name is specified. If it is `NULL`, the device-independent path name will be an absolute, not a relative, path name. - `diPathText` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): (Filled by the method) The ASText object to contain the device-independent path. It must be allocated and freed by the client. **Returns:** [`ASErrorCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASErrorCode) `0` if the operation was successful, a non-zero platform-dependent error code otherwise. **See also:** [`ASGetDefaultFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASGetDefaultFileSys), [`ASFileSysPathFromDIPathEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysPathFromDIPathEx) #### ASFileSysDestroyFolderIterator ```cpp void ASFileSysDestroyFolderIterator(ASFileSys fileSys, ASFolderIterator folderIter) ``` Header: `ASProcs.h:1694` Releases the resources associated with `folderIter`. **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): IN/OUT (May be `NULL`) The file system from which the iteration was started. Pass `NULL` to use the default file system. - `folderIter` ([`ASFolderIterator`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFolderIterator)): IN/OUT An ASFolderIterator object returned from a previous call to ASFileSysFirstFolderItem(). **Returns:** `void` **See also:** [`ASFileSysFirstFolderItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysFirstFolderItem), [`ASFileSysNextFolderItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysNextFolderItem) #### ASFileSysDisplayASTextFromPath ```cpp ASErrorCode ASFileSysDisplayASTextFromPath(ASFileSys fileSys, ASPathName path, ASText displayText) ``` Header: `ASProcs.h:2441` Returns a user-friendly representation of a path as a text object. It calls ASFileSysDisplayASTextFromPathProc(). This method supersedes ASFileSysDisplayStringFromPath(). **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): (May be `NULL`) The file system from which `pathName` was obtained. Pass `NULL` to use the default file system. - `path` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): The ASPathName in question. - `displayText` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): (Filled by method) The text object containing the display representation of the path. **Returns:** [`ASErrorCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASErrorCode) `0` if the operation was successful, a non-zero platform-dependent error code otherwise. **See also:** [`ASFileSysDisplayStringFromPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysDisplayStringFromPath) #### ASFileSysDisplayStringFromPath ```cpp char * ASFileSysDisplayStringFromPath(ASFileSys fileSys, ASPathName path) ``` Header: `ASProcs.h:1955` Returns a user-friendly representation of a path. It is the caller's responsibility to release the memory associated with the returned string using ASfree(). **Example** Operating system Display string Windows `"C:\\Folder\\File"` Mac OS `"Hard Disk:Folder:File"` UNIX `"/Folder/File"` **Note:** This method can only be used to get host encoding. For any other encoding, use ASFileSysDisplayASTextFromPath(). **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): (May be `NULL`) The file system from which `pathName` was obtained. Pass `NULL` to use the default file system. - `path` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): The ASPathName in question. **Returns:** `char *` A buffer containing the display string, or `NULL` if this operation is not supported by the file system or some error occurred. **See also:** [`ASFileSysDisplayASTextFromPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysDisplayASTextFromPath) #### ASFileSysFirstFolderItem ```cpp ASFolderIterator ASFileSysFirstFolderItem(ASFileSys fileSys, ASPathName folderPath, ASFileSysItemProps props, ASPathName *itemPath) ``` Header: `ASProcs.h:1652` Creates an iterator which can be used to enumerate all objects inside the specified folder, and returns the properties of the first item found in the folder. The iteration can be continued by passing the returned ASFolderIterator to ASFileSysNextFolderItem. Both `itemProps` and `itemPath` are optional, and may be `NULL` if you are not interested in that information. The client is obligated to eventually free the resources associated with ASFolderIterator by calling ASFileSysDestroyFolderIterator(). **Note:** The order in which items are enumerated is implementation-dependent. Of particular importance is the fact that items will probably not be iterated in alphabetic order. **Note:** If items are added to or removed from a folder during iteration, the results are implementation-dependent. **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): IN/OUT (May be `NULL`) The file system from which `folderPath` was obtained. Pass `NULL` to use the default file system. - `folderPath` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): IN/OUT The path associated with the target folder. - `props` (`ASFileSysItemProps`): IN/OUT (Filled by the method, may be `NULL`) A properties structure describing the first object iterated. - `itemPath` ([`ASPathName *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): (Filled by the method, may be `NULL`) An ASPathName, allocated by ASFileSysFirstFolderItem(), which is associated with the object. The caller of ASFileSysFirstFolderItem() must free the ASPathName. This parameter contains an absolute path on Windows and UNIX. **Returns:** [`ASFolderIterator`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFolderIterator) A valid ASFolderIterator object if `folderPath` contained any files. `NULL` will be returned if the folder is empty or the operation is not supported by the file system. **Exceptions** - `genErrBadParm` - `fileErrFNF`: (raised by the Windows default file system) - `asFileErrNotADir`: (raised by the Windows default file system) - `ERR_NOMEMORY` **See also:** [`ASFileSysNextFolderItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysNextFolderItem), [`ASFileSysDestroyFolderIterator`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysDestroyFolderIterator) #### ASFileSysFlushVolume ```cpp ASErrorCode ASFileSysFlushVolume(ASFileSys fileSys, ASPathName pathName) ``` Header: `ASProcs.h:1825` Flushes the volume on which the specified file resides. This ensures that any data written to the system for the volume containing `pathName` is flushed out to the physical volume (equivalent to Mac OS FlushVol or to the UNIX sync). Only the Mac OS default file system implements the callback associated with this method. This is a no-op on Windows and UNIX. **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): IN/OUT (May be `NULL`) The file system from which `pathName` was obtained. Pass `NULL` to use the default file system. - `pathName` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): IN/OUT The ASPathName from which the volume information is obtained. **Returns:** [`ASErrorCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASErrorCode) `0` if the operation was successful, a non-zero platform-dependent error code otherwise. #### ASFileSysGetFilePosLimit ```cpp ASFilePos64 ASFileSysGetFilePosLimit(ASFileSys fileSys) ``` Header: `ASProcs.h:2690` Returns the maximum file position that can be processed by this file system. This is not the maximum size file that can be created or the amount of room left in the file system, but the maximum file position that can be handled by the arithmetic in the file system implementation. This will typically be `(2 ^ 31) - 1` or `(2 ^ 63) - 1`. **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): IN/OUT (May be `NULL`) The file system from which the path name was obtained. Pass `NULL` to use the default file system. **Returns:** [`ASFilePos64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFilePos64) The maximum file position that can be processed. **See also:** [`ASFileSysOpenFile64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysOpenFile64) #### ASFileSysGetItemProps ```cpp ASErrorCode ASFileSysGetItemProps(ASFileSys fileSys, ASPathName pathName, ASFileSysItemProps props) ``` Header: `ASProcs.h:1608` Populates an ASFileSysItemProps record with a full description of the file system object associated with `pathName`. It calls ASFileSysGetItemPropsProc(). **Note:** The method clears the memory associated with `itemProps`, so the caller need not do so. However, the caller must explicitly set the `props->size` field of the ASFileSysItemProps structure before calling this method. **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): (May be `NULL`) The file system from which `pathName` was obtained. Pass `NULL` to use the default file system. - `pathName` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): The ASPathName associated with the object. - `props` (`ASFileSysItemProps`): (Filled by the method) A properties structure describing the object. The size field must be set on input. **Returns:** [`ASErrorCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASErrorCode) `0` if no error was encountered; otherwise an error code is returned. If an error code is returned, `props` will not be filled with valid values. If no file system object is present, an error will not be reported and the `props.isThere` field will be `false`. **Exceptions** - `genErrBadParm` - `genErrMethodNotImplemented` **See also:** [`ASFileSysConvertCabToItemProps`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysConvertCabToItemProps), [`ASFileSysConvertItemPropsToCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysConvertItemPropsToCab), [`ASFileSysGetItemPropsAsCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysGetItemPropsAsCab) #### ASFileSysGetItemPropsAsCab ```cpp ASInt32 ASFileSysGetItemPropsAsCab(ASFileSys fileSys, ASPathName pathName, ASCab theCab) ``` Header: `ASExtraProcs.h:2176` Gets a full description of the file system object associated with `pathName`, returning the item properties in the ASCab format. Calls ASFileSysGetItemPropsAsCabProc(). If the ASCab has no keys on entry, every property known is filled in. If it is not empty, only properties corresponding to keys in the ASCab are filled in. Keys that do not map to a property of the object are removed. The ASCab has the following potential entries: Key NameType `isThere`ASBool `type`ASInt32 `isHidden`ASBool `isReadOnly`ASBool `creationDate` — `char*` (PDF style date string) `modDate` `char*` (PDF style date string) `fileSizeHigh` ASUns32 `fileSizeLow` ASUns32 `folderSize` ASInt32 `creatorCode` ASUns32 `typeCode` ASUns32 `versionMajor` ASUns32 `versionMinor` ASUns32 `isCheckedOut` ASBool `isPublished` ASBool @since **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): (May be `NULL`) The file system from which `pathName` was obtained. Pass `NULL` to use the default file system. - `pathName` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): The ASPathName associated with the object. - `theCab` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)): (Filled by the method) Properties describing the object, in cabinet format.`0` if no error was encountered; otherwise an error code is returned. If an error code is returned, `theCab` is not filled with valid values. If the path name does not point to an object on the file system, returns `asFileErrFNF` and a valid ASCab with `isThere` set to `false`. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) **Exceptions** - `genErrBadParm` - `genErrMethodNotImplemented` **See also:** [`ASFileSysConvertCabToItemProps`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysConvertCabToItemProps), [`ASFileSysConvertItemPropsToCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysConvertItemPropsToCab), [`ASFileSysGetItemProps`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysGetItemProps) #### ASFileSysGetNameFromPath ```cpp ASErrorCode ASFileSysGetNameFromPath(ASFileSys fileSys, ASPathName pathName, char *name, ASTArraySize maxLength) ``` Header: `ASProcs.h:1763` Extracts the file name (including extension) from the path. **Note:** This method can only be used to get host encoding. For any other encoding, use ASFileSysGetNameFromPathAsASText(). **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): (May be `NULL`) The file system from which `pathName` was obtained. Pass `NULL` to use the default file system. - `pathName` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): The ASPathName associated with the file in question. - `name` (`char *`): (Filled by the method) A buffer used to store the file name. - `maxLength` ([`ASTArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize)): Maximum number of bytes that buffer can hold. **Returns:** [`ASErrorCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASErrorCode) `0` if the operation was successful, a non-zero platform-dependent error code otherwise. The buffer is returned as a host-encoded C string. **Exceptions** - `fileErrGeneral` **See also:** [`ASFileSysGetNameFromPathAsASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysGetNameFromPathAsASText) #### ASFileSysGetNameFromPathAsASText ```cpp ASErrorCode ASFileSysGetNameFromPathAsASText(ASFileSys fileSys, ASPathName pathName, ASText name) ``` Header: `ASProcs.h:2422` Extracts the file name (including the extension) from the path as an ASText object. This method supersedes ASFileSysGetNameFromPath(). **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): (May be `NULL`) The file system from which `pathName` was obtained. Pass `NULL` to use the default file system. - `pathName` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): The ASPathName associated with the file in question. - `name` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): (Filled by the method) The text object containing the file name. **Returns:** [`ASErrorCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASErrorCode) `0` if the operation was successful, a non-zero platform-dependent error code otherwise. **Exceptions** - `fileErrGeneral` **See also:** [`ASFileSysGetNameFromPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysGetNameFromPath) #### ASFileSysGetNameFromPathForDisplay ```cpp ASErrorCode ASFileSysGetNameFromPathForDisplay(ASFileSys fileSys, ASPathName pathName, ASText nameForDisplay) ``` Header: `ASProcs.h:2778` This method writes into `nameForDisplay` the representation of that item as it would be shown in Windows Explorer or Mac OS Finder. For example, it will provide the localized string for `"My Documents"` even though, on disk, `"My Documents"` is always in English. It will also strip the extension if that is what Windows Explorer or the Mac Finder would do for that file. **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): (May be `NULL`) The file system from which `pathName` was obtained. Pass `NULL` to use the default file system. - `pathName` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): The ASPathName associated with the file in question. - `nameForDisplay` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): (Filled by the method) The text object containing the name used for display. **Returns:** [`ASErrorCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASErrorCode) `0` if the operation was successful, a non-zero platform-dependent error code otherwise. **Exceptions** - `fileErrGeneral` #### ASFileSysGetPlatformThing ```cpp void * ASFileSysGetPlatformThing(ASFileSys fileSys, ASPathName path, ASAtom thing) ``` Header: `ASProcs.h:2234` Deprecated API: always returns `NULL`. **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)) - `path` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)) - `thing` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)) **Returns:** `void *` #### ASFileSysGetStorageFreeSpace ```cpp ASDiskSpace ASFileSysGetStorageFreeSpace(ASFileSys fileSys, ASPathName pathName) ``` Header: `ASProcs.h:1803` Gets the amount of free space on the volume containing `pathName`. **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): IN/OUT (May be `NULL`) The file system from which `pathName` was obtained. Pass `NULL` to use the default file system. - `pathName` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): IN/OUT The ASPathName in question. **Returns:** [`ASDiskSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDiskSpace) The amount of free space in bytes, `0` otherwise. Because the free space is returned as an ASUns32, it is limited to 4 GB. #### ASFileSysGetStorageFreeSpace64 ```cpp ASDiskSpace64 ASFileSysGetStorageFreeSpace64(ASFileSys fileSys, ASPathName pathName) ``` Header: `ASProcs.h:2868` Gets the amount of free space on the volume containing `pathName`. This is the same as ASFileSysGetStorageFreeSpace() without the 4 GB limit. **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): IN/OUT (May be `NULL`) The file system from which `pathName` was obtained. Pass `NULL` to use the default file system. - `pathName` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): IN/OUT The ASPathName. **Returns:** [`ASDiskSpace64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDiskSpace64) The amount of free space in bytes, `0` otherwise. #### ASFileSysGetTempPathName ```cpp ASPathName ASFileSysGetTempPathName(ASFileSys fileSys, ASPathName siblingPathName) ``` Header: `ASProcs.h:1789` Returns a unique path name suitable for use in creating temporary files. It is the caller's responsibility to release the returned object using ASFileSysReleasePath(). If `siblingPath` is non-`NULL`, the returned ASPathName is created at the same folder level as this path. Otherwise the standard temporary file location is used.`NULL`) The file system from which `siblingPath` was obtained. Pass `NULL` to use the default file system.`NULL`) An ASPathName indicating the desired location of the temporary path name. The returned ASPathName is created at the same folder level as this path.`NULL` otherwise. @notify ASFileSysCalledGetPathName **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)) - `siblingPathName` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)) **Returns:** [`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName) **See also:** [`ASFileSysReleasePath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysReleasePath) **Since:** `DLADD mjm 5/17/2021 SF44014 Notify that a call is made to ASFileSysGetTempPath, include fileSys.` #### ASFileSysGetTypeAndCreator ```cpp void ASFileSysGetTypeAndCreator(ASFileSys fileSys, ASPathName path, ASUns32 *type, ASUns32 *creator) ``` Header: `ASProcs.h:2001` Gets the type and creator of the file specified by the path. See Creators and Acrobat Types. Creators AcrobatTypes **Note:** This is only meaningful for the Mac OS default file system. Windows and UNIX always return `0` for both `type` and `creator`. **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): The file system containing the file for which the type and creator are needed. - `path` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): The path name of the file. - `type` ([`ASUns32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): (Filled by method) The type of the file. - `creator` ([`ASUns32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): (Filled by method) The creator of the file. **Returns:** `void` **See also:** [`ASFileSysSetTypeAndCreator`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysSetTypeAndCreator) #### ASFileSysIsLocal ```cpp ASBool ASFileSysIsLocal(ASFileSys fileSys) ``` Header: `ASProcs.h:2854` Returns `true` if `fileSys` is `NULL`, the default file system or the default Unicode file system. **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)) **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if `fileSys` is `NULL` or a local file system. **See also:** [`ASGetDefaultFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASGetDefaultFileSys), [`ASGetDefaultUnicodeFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASGetDefaultUnicodeFileSys) #### ASFileSysNextFolderItem ```cpp ASBool ASFileSysNextFolderItem(ASFileSys fileSys, ASFolderIterator folderIter, ASFileSysItemProps props, ASPathName *itemPath) ``` Header: `ASProcs.h:1680` Continues the iteration process associated with the ASFolderIterator object. Both `itemPath` and `itemProps` are optional, and may be `NULL` if you are not interested in that information. @since **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): (May be `NULL`) The file system with which the iteration was started. Pass `NULL` to use the default file system. - `folderIter` ([`ASFolderIterator`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFolderIterator)): An ASFolderIterator object returned from a previous call to ASFileSysFirstFolderItem().`NULL`) A properties structure describing the next object in the iteration.`NULL`) An ASPathName, allocated by ASFileSysNextFolderItem(), which is associated with the object. The caller of ASFileSysNextFolderItem() must free the ASPathName. This parameter contains an absolute path on Windows and UNIX.`true` if another object was found, `false` otherwise. - `props` (`ASFileSysItemProps`) - `itemPath` ([`ASPathName *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)) **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) **Exceptions** - `genErrBadParm` - `fileErrGeneral` - `ERR_NOMEMORY` **See also:** [`ASFileSysFirstFolderItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysFirstFolderItem), [`ASFileSysDestroyFolderIterator`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysDestroyFolderIterator) #### ASFileSysOpenFile ```cpp ASErrorCode ASFileSysOpenFile(ASFileSys fileSys, ASPathName pathName, ASFileMode mode, ASFile *fP) ``` Header: `ASProcs.h:847` Attempts to open a file in the specified file system, in the specified read/write/create mode. If the file is already open, the existing file handle is returned. The caller retains ownership of `pathName`. This call returns an error if a file over 2 GB in length is opened. ASFileSysOpenFile64() should be used instead of this call wherever possible, and must be used if files over 2 GB in length may be encountered. In Mac OS, when this method creates a file, the file's creator is set to `'CARO'` and its type is set to `'PDF '` (with a space after PDF). Platform Error Windows Returns fileErrWrPerm if trying to open a read-only file with write permissions. Returns ErrSysXtnMgr (use GetLastError()) for platform-specific error conditions that CreateFile() may use. Mac OS Returns fileErrFNF if trying to open a file for reading that does not exist. Returns ErrSysMDSystem for platform-specific errors that `FSpCreate`, `FSpSetFInfo`, `FSpOpenRF`, `FSpOpenDF`, or `SetFPos` may use). **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): (May be `NULL`) The file system from which `pathName` was obtained. Pass `NULL` to use the default file system. - `pathName` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): The path name of the file to open. - `mode` ([`ASFileMode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileMode)): An open-mode value as specified for ASFileMode. - `fP` ([`ASFile *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): (Filled by the method) The ASFile that was opened. **Returns:** [`ASErrorCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASErrorCode) `0` if the operation was successful, a non-zero error code otherwise. The error is platform and file-system specific: **Exceptions** - `genErrNoError` **See also:** [`ASFileClose`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileClose), [`ASFileReopen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileReopen), [`ASGetDefaultFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASGetDefaultFileSys) #### ASFileSysOpenFile64 ```cpp ASErrorCode ASFileSysOpenFile64(ASFileSys fileSys, ASPathName pathName, ASFileMode mode, ASFile *fP) ``` Header: `ASProcs.h:2674` Attempts to open a file in the specified file system, in the specified read/write/create mode. If the file is already open, the existing file handle is returned. The caller retains ownership of `pathName`. This call can open files over 2 GB in length and should be used instead of ASFileSysOpenFile() whenever possible. On Mac OS, when this method creates a file, the file's creator is set to `'CARO'` and its type is set to `'PDF '` (with a space after PDF). ASFileOpenModes Platform Error Windows Returns fileErrWrPerm if trying to open a read-only file with write permissions. Returns ErrSysXtnMgr (use GetLastError()) for platform-specific error conditions that CreateFile() may use. Returns `fileErrGeneral` if the developer passed in an invalid ASPathName. Mac OS Returns fileErrFNF if trying to open a file for reading that does not exist. Returns ErrSysMDSystem for platform-specific errors that `FSpCreate`, `FSpSetFInfo`, `FSpOpenRF`, `FSpOpenDF`, or `SetFPos` may use). Returns `fileErrGeneral` if the developer passed in an invalid ASPathName. **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): IN/OUT (May be `NULL`) The file system from which the path name was obtained. Pass `NULL` to use the default file system. - `pathName` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): IN/OUT The path name of the file to open. - `mode` ([`ASFileMode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileMode)): IN/OUT An `OR` of the ASFile Open Modes. - `fP` ([`ASFile *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): IN/OUT (Filled by the method) The ASFile that was opened. **Returns:** [`ASErrorCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASErrorCode) `0` if the operation was successful, a non-zero error code otherwise. The error is platform and file-system specific: **Exceptions** - `genErrNoError` **See also:** [`ASFileClose`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileClose), [`ASFileReopen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileReopen), [`ASGetDefaultFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASGetDefaultFileSys) #### ASFileSysPathFromDIPath ```cpp ASPathName ASFileSysPathFromDIPath(ASFileSys fileSys, const char *diPath, ASPathName relativeToThisPath) ``` Header: `ASProcs.h:767` Converts a device-independent path name to an ASPathName. This method can only be used for files that already exist (that is, it cannot be used to create a placeholder path name for files that a plug-in intends to create in the future). It is the caller's responsibility to release the returned ASPathName. For details about DIPath, see "File Specification Strings:" You can find this document on the web store of the International Standards Organization (ISO). This path name may not be understood on another platform since drive specifiers may be prepended. On Windows, you cannot specify a UNC path name. You must have a file mounted on the file server. For example, the following path is valid: `/f/dirname/file.pdf` where `f` is `\server\people`. The following does not work: `/server/people/dirname/file.pdf`. **Note:** Use ASFileSysPathFromDIPathEx() instead for anything other than host encoding. **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): (May be `NULL`) The file system within which the ASPathName will be created. Pass `NULL` to use the default file system. - `diPath` (`const char *`): The device-independent path name to convert. For a description of the device-independent path name format, see "File Specification Strings," in ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.11.2, page 100. - `relativeToThisPath` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): The path name relative to which `diPath` is interpreted. If it is `NULL`, `diPath` is interpreted as an absolute path name, not a relative path name. **Returns:** [`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName) An ASPathName corresponding to the parameter values supplied, `NULL` if `diPath` cannot be converted to an ASPathName or if the specified file does not already exist. **Exceptions** - `genErrNoMemory` **See also:** [`ASFileSysDIPathFromPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysDIPathFromPath), [`ASFileSysReleasePath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysReleasePath) #### ASFileSysPathFromDIPathEx ```cpp ASPathName ASFileSysPathFromDIPathEx(ASFileSys fileSys, ASConstText diPathText, ASPathName relativeToThisPath) ``` Header: `ASProcs.h:2576` Converts a device-independent path name in an ASText object to an ASPathName. This method can only be used for files that already exist (that is, it cannot be used to create a placeholder path name for files that a plug-in intends to create in the future). It is the caller's responsibility to release the returned ASPathName. This method supersedes ASFileSysPathFromDIPath(). For a description of File Specification Strings, see the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, page 100. You can find this document on the web store of the International Standards Organization (ISO). **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): (May be `NULL`) The file system within which the ASPathName will be created. Pass `NULL` to use the default file system. - `diPathText` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): The device-independent path name to convert, as an ASText object. For a description of the device-independent path name format, see "File Specification Strings," in ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.11.2, page 100. This path name may not be understood on another platform since drive specifiers may be prepended. On Windows, you cannot specify a UNC path name. You must have a file mounted on the file server. For example, the following path is valid: `/f/dirname/file.pdf` where `f` is `\\server\\people`. The following does not work: `/server/people/dirname/file.pdf`. - `relativeToThisPath` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): A path name relative to which `diPath` is interpreted. If `NULL`, `diPath` is interpreted as an absolute path name, not a relative path name. **Returns:** [`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName) An ASPathName corresponding to the parameter values supplied. Returns `NULL` if `diPath` cannot be converted to an ASPathName. This would occur, for example, if the specified file does not already exist. @exception genErrNoMemory @see ASFileSysDIPathFromPathEx @see ASFileSysReleasePath @since #### ASFileSysPerformOpOnItem ```cpp ASInt32 ASFileSysPerformOpOnItem(ASFileSys fileSys, ASPathName pathName, const char *op, ASCab params) ``` Header: `ASExtraProcs.h:2272` Performs a specified operation on a particular file, passing specified parameters. It calls the performOpOnItem() procedure registered for the `ASFileSysRec`. **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): (May be `NULL`) The file system from which `pathName` was obtained. Pass `NULL` to use the default file system. - `pathName` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): The ASPathName of the file. - `op` (`const char *`): The name of the operation to perform. A file system-defined string handled by ASFileSysPerformOpOnItemProc(). - `params` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)): An ASCab object containing parameters to pass to the operation. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) `0` if the operation was successful, a nonzero platform-dependent error code otherwise. **See also:** [`ASFileSysCanPerformOpOnItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysCanPerformOpOnItem) #### ASFileSysReleasePath ```cpp void ASFileSysReleasePath(ASFileSys fileSys, ASPathName pathName) ``` Header: `ASProcs.h:801` Decrements the internal reference count for the path name and disposes of the path name (but not the file itself) if the reference count is zero. This does not result in any file-level operations, and is unaffected by whether there is an open file for this path name. **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): (May be `NULL`) The file system from which `pathName` was obtained. Pass `NULL` to use the default file system. - `pathName` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): The ASPathName to release. **Returns:** `void` #### ASFileSysReleasePlatformPath ```cpp void ASFileSysReleasePlatformPath(ASFileSys fileSys, ASPlatformPath platformPath) ``` Header: `ASProcs.h:2293` Releases the specified platform path object. Each call to ASFileSysAcquirePlatformPath() should have a corresponding call to this method. **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): (May be `NULL`) The file system from which `pathName` was obtained. Pass `NULL` to use the default file system. - `platformPath` ([`ASPlatformPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPlatformPath)): The platform path object to release. **Returns:** `void` **See also:** [`ASFileSysAcquirePlatformPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysAcquirePlatformPath) #### ASFileSysRemoveFile ```cpp ASErrorCode ASFileSysRemoveFile(ASFileSys fileSys, ASPathName pathName) ``` Header: `ASProcs.h:864` Attempts to delete the file referred to by `pathName`. **Note:** If a file is already open for this `pathName`, the semantics of ASFileSysRemoveFile() are file system-dependent. Make sure you have closed all ASFile objects for `pathName` before calling ASFileSysRemoveFile(). **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): (May be `NULL`) The file system from which `pathName` was obtained. Pass `NULL` to use the default file system. - `pathName` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): The file to delete. **Returns:** [`ASErrorCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASErrorCode) `0` if the operation was successful, a non-zero platform-dependent error code otherwise. #### ASFileSysRemoveFolder ```cpp ASErrorCode ASFileSysRemoveFolder(ASFileSys fileSys, ASPathName path) ``` Header: `ASProcs.h:1903` Deletes the folder at the specified `pathName` only if it is empty. **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): (May be `NULL`) The file system from which `pathName` was obtained. Pass `NULL` to use the default file system. - `path` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): The path of the folder to remove. **Returns:** [`ASErrorCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASErrorCode) `0` if the operation was successful, a non-zero platform-dependent error code otherwise. **Exceptions** - `genErrMethodNotImplemented` **See also:** [`ASFileSysCreateFolder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysCreateFolder) #### ASFileSysSetTypeAndCreator ```cpp void ASFileSysSetTypeAndCreator(ASFileSys fileSys, ASPathName path, ASUns32 type, ASUns32 creator) ``` Header: `ASProcs.h:1981` Sets the type and creator of a file. See Type/Creator Codes. **Note:** As is the case for ASFileSysGetTypeAndCreator(), this method only applies to the Mac OS default file system. Windows and UNIX make this a no-op. **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): IN/OUT The file system for which the type and creator are needed. - `path` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): IN/OUT The path name of the file. - `type` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): IN/OUT The type of the file. - `creator` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): IN/OUT The creator of the file. **Returns:** `void` None. **See also:** [`ASFileSysGetTypeAndCreator`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysGetTypeAndCreator) #### ASFileSysURLFromPath ```cpp char * ASFileSysURLFromPath(ASFileSys fileSys, ASPathName path) ``` Header: `ASProcs.h:1859` Returns the URL corresponding to `pathName`. It is the caller's responsibility to free the memory associated with the returned string using ASfree(). **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): IN/OUT The file system from which `path` was obtained. Pass `NULL` to use the default file system. - `path` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): IN/OUT The ASPathName in question. **Returns:** `char *` A buffer containing the URL, or `NULL` if some error occurred. The URL is in the standard `'file://'` URL style. #### ASGetDefaultFileSys ```cpp ASFileSys ASGetDefaultFileSys(void) ``` Header: `ASProcs.h:690` Gets the default standard file system implementation for a platform. **Parameters** - (unnamed) (`void`) **Returns:** [`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys) The platform's default file system. **See also:** [`ASFileRegisterFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileRegisterFileSys), [`ASPathFromPlatformPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathFromPlatformPath) #### ASGetDefaultFileSysForPath ```cpp ASFileSys ASGetDefaultFileSysForPath(ASAtom pathSpecType, const void *pathSpec) ``` Header: `ASProcs.h:2842` Gets the best file system implementation that supports the passed in path. If the path requires the Unicode file system then the default Unicode file system is returned, otherwise the default file system is returned. **Parameters** - `pathSpecType` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)) - `pathSpec` (`const void *`) **Returns:** [`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys) The platform's default or Unicode file system. **See also:** [`ASGetDefaultFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASGetDefaultFileSys), [`ASGetDefaultUnicodeFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASGetDefaultUnicodeFileSys) #### ASGetDefaultUnicodeFileSys ```cpp ASFileSys ASGetDefaultUnicodeFileSys(void) ``` Header: `ASProcs.h:2790` Gets the file system implementation that supports Unicode file path names. If a platform does not have a file system that supports Unicode, then `NULL` will be returned. **Parameters** - (unnamed) (`void`) **Returns:** [`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys) The platform's Unicode file system. **See also:** [`ASGetDefaultFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASGetDefaultFileSys) #### ASGetRamFileSys ```cpp ASFileSys ASGetRamFileSys(void) ``` Header: `ASProcs.h:2606` Gets the in-memory file system implementation for a platform. **Parameters** - (unnamed) (`void`) **Returns:** [`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys) The platform's in-memory file system. **See also:** [`ASSetDefaultFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#ASSetDefaultFileSys), [`ASSetTempFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASSetTempFileSys) #### ASGetTempFileSys ```cpp ASFileSys ASGetTempFileSys(void) ``` Header: `ASProcs.h:2585` Gets the temporary file system implementation for a platform. **Parameters** - (unnamed) (`void`) **Returns:** [`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys) The platform's default file system. **See also:** [`ASSetTempFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASSetTempFileSys) #### ASRamFileSysSetLimitKB ```cpp void ASRamFileSysSetLimitKB(ASInt32 limit) ``` Header: `ASProcs.h:2757` Set the in-memory usage Limit for the Ram FileSys (in KB). 0 means no limit, but performance will depend on available memory on the system. **Parameters** - `limit` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)) **Returns:** `void` **See also:** [`ASGetRamFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASGetRamFileSys) #### ASSetTempFileSys ```cpp void ASSetTempFileSys(ASFileSys fileSys) ``` Header: `ASProcs.h:2596` Sets the temporary file system implementation for a platform. **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)) **Returns:** `void` none **See also:** [`ASGetDefaultFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASGetDefaultFileSys), [`ASGetTempFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASGetTempFileSys), [`ASGetRamFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASGetRamFileSys) ### Typedefs (74) #### ASDiskSpace ```cpp typedef ASUns32 ASDiskSpace ``` Header: `ASExpT.h:142` Can only contain values up to 4 GB. #### ASDiskSpace64 ```cpp typedef ASUns64 ASDiskSpace64 ``` Header: `ASExpT.h:145` #### ASFileMode ```cpp typedef ASUns16 ASFileMode ``` Header: `ASExpT.h:89` File access modes used to specify how a file can be used when it is open. Not all modes can be specified individually: ASFILE_CREATE can be used only in conjunction with ASFILE_READ or ASFILE_WRITE. In addition, it is acceptable to specify ASFILE_READ and ASFILE_WRITE together by `OR`-ing the two constants. ASFILE_SERIAL and ASFILE_LOCAL (present only in version 3.0 or later) are hints that help the Acrobat viewer optimize access to the file; they must be `OR`-ed with one or more of the other constants: Value Description ASFILE_READ Open the file for reading. ASFILE_WRITE Open the file for writing. ASFILE_CREATE Create the file if it does not exist. ASFILE_SERIAL A hint indicating that the file will be accessed sequentially. ASFILE_LOCAL A hint indicating that a local copy of the file will be needed. **See also:** [`ASFileSysOpenFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysOpenFile), [`ASFileReopen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileReopen) #### ASFileSysItemType ```cpp typedef ASEnum16 ASFileSysItemType ``` Header: `ASExpT.h:2073` #### ASlFileMode ```cpp typedef ASUns32 ASlFileMode ``` Header: `ASExpT.h:148` #### ASlFileTypeCreator ```cpp typedef ASlFileMode ASlFileTypeCreator ``` Header: `ASExpT.h:153` #### ASFileSysAcquireFileSysPathProc ```cpp typedef ASPathName(*) ASFileSysAcquireFileSysPathProc(ASPathName pathName, ASFileSys newFileSys)(ASPathName pathName, ASFileSys newFileSys) ``` Header: `ASExpT.h:2417` A callback for `ASFileSysRec` that is used for non-local file systems. It returns an ASPathName on the new ASFileSys that refers to an image (which may be cached) of the remote file. Because of the possibility of cache flushing, you must hold a copy of the remote file's ASPathName for the duration of use of the local file. **Note:** Do not remove the local file copy, since the default file system does not know about the linkage to the remote file. The removal of this temporary file should be left to the file system. **Note:** The ASPathName returned should be released with the ASFileSysReleasePath() method when it is no longer needed. **See also:** [`ASFileSysCreatePathNameProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysCreatePathNameProc) #### ASFileSysAcquirePlatformPathProc ```cpp typedef ASInt32(*) ASFileSysAcquirePlatformPathProc(ASPathName path, ASAtom platformPathType, ASPlatformPath *platformPath)(ASPathName path, ASAtom platformPathType, ASPlatformPath *platformPath) ``` Header: `ASExpT.h:3075` A callback for `ASFileSysRec` that acquires a platform-specific file system representation of the specified path, according to the specified type, wrapped in an allocated ASPlatformPath object. Use the `ASPlatformPath*` calls to get the actual platform object. **See also:** [`ASFileSysAcquireFileSysPathProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysAcquireFileSysPathProc), [`ASFileSysAcquirePlatformPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysAcquirePlatformPath) #### ASFileSysAsyncAbortProc ```cpp typedef void(*) ASFileSysAsyncAbortProc(ASMDFile f)(ASMDFile f) ``` Header: `ASExpT.h:2309` A callback for `ASFileSysRec` that aborts all uncompleted asynchronous I/O requests for the specified file. This callback can be called at any time. This callback calls each outstanding ASIORequest object's ASIODoneProc() to be called with `totalBytes = 0` and `error = -1`. **See also:** [`ASFileSysAsyncReadProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysAsyncReadProc), [`ASFileSysAsyncWriteProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysAsyncWriteProc), [`ASFileSysYieldProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysYieldProc) #### ASFileSysAsyncReadProc ```cpp typedef ASErrorCode(*) ASFileSysAsyncReadProc(ASIORequest req)(ASIORequest req) ``` Header: `ASExpT.h:2273` A callback for `ASFileSysRec` that asynchronously reads the specified data, returning immediately after the request has been queued. The ASFileSys must call the ASIODoneProc() (if one was provided) when the specified data has been read. This callback is similar to the ASFileSysMReadRequestProc(), except that this callback contains a caller-provided ASIODoneProc() and can only be used for a single byte range. **See also:** [`ASFileSysAsyncAbortProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysAsyncAbortProc), [`ASFileSysAsyncWriteProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysAsyncWriteProc), [`ASFileSysYieldProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysYieldProc) #### ASFileSysAsyncWriteProc ```cpp typedef ASErrorCode(*) ASFileSysAsyncWriteProc(ASIORequest req)(ASIORequest req) ``` Header: `ASExpT.h:2293` A callback for `ASFileSysRec` that asynchronously writes the specified data, returning immediately after the request has been queued. The ASFileSys must call the ASIODoneProc() (if one was provided) when the specified data has been written. **See also:** [`ASFileSysAsyncAbortProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysAsyncAbortProc), [`ASFileSysAsyncReadProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysAsyncReadProc), [`ASFileSysYieldProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysYieldProc) #### ASFileSysCalledGetPathNameProc ```cpp typedef void(*) ASFileSysCalledGetPathNameProc(ASFileSys fileSys, void *userData)(ASFileSys fileSys, void *userData) ``` Header: `ASExpT.h:4092` #### ASFileSysCanPerformOpOnItemProc ```cpp typedef ASInt32(*) ASFileSysCanPerformOpOnItemProc(ASPathName pathName, const char *op)(ASPathName pathName, const char *op) ``` Header: `ASExpT.h:3035` A callback for `ASFileSysRec` that tests whether a specified operation can be performed on the file, which means that it tests whether a handler is defined for that operation in `ASFileSysPerformOpOnItemProc`. **See also:** [`ASFileSysPerformOpOnItemProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysPerformOpOnItemProc), [`ASFileSysCanPerformOpOnItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysCanPerformOpOnItem) #### ASFileSysCanSetEofProc ```cpp typedef ASBool(*) ASFileSysCanSetEofProc(ASMDFile f, ASFilePos pos)(ASMDFile f, ASFilePos pos) ``` Header: `ASExpT.h:3131` A callback for `ASFileSysRec` that determines whether ASFileSys can set the end of file marker (EOF) to a new offset for the specified file. **See also:** [`ASFileSysSetEofProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysSetEofProc), [`ASFileGetEOF`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileGetEOF), [`ASFileSetEOF`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSetEOF) #### ASFileSysClearOutstandingMReadsProc ```cpp typedef void(*) ASFileSysClearOutstandingMReadsProc(ASMDFile f)(ASMDFile f) ``` Header: `ASExpT.h:2381` A callback for `ASFileSysRec` that is used to advise a file system that the previous range of bytes requested to read are not needed, so that it may drop the read requests. The file system can continue pushing the bytes if it cannot stop the reads. **See also:** [`ASFileSysMReadRequestProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysMReadRequestProc), [`ASFileRead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileRead), [`ASFileHasOutstandingMReads`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileHasOutstandingMReads) #### ASFileSysCloseProc ```cpp typedef ASErrorCode(*) ASFileSysCloseProc(ASMDFile f)(ASMDFile f) ``` Header: `ASExpT.h:2449` A callback for `ASFileSysRec`. This callback is responsible for closing the specified file. It is called by ASFileClose(). **See also:** [`ASFileSysOpenProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysOpenProc), [`ASFileClose`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileClose) #### ASFileSysCopyPathNameProc ```cpp typedef ASPathName(*) ASFileSysCopyPathNameProc(ASPathName pathName)(ASPathName pathName) ``` Header: `ASExpT.h:2644` A callback for `ASFileSysRec` that copies a path name (not the underlying file). It is called by ASFileSysCopyPath(). Copying a path name does not result in any file-level operations, and does not depend on the existence of an open file for the path name. **Note:** The ASPathName returned should be released by the ASFileSysReleasePath() method when it is no longer needed. **See also:** [`ASFileSysCopyPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysCopyPath) #### ASFileSysCreateFolderProc ```cpp typedef ASErrorCode(*) ASFileSysCreateFolderProc(ASPathName path)(ASPathName path) ``` Header: `ASExpT.h:2890` A callback for `ASFileSysRec` used to create an empty folder at the specified path. **See also:** [`ASFileSysRemoveFolderProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysRemoveFolderProc), [`ASFileSysCreateFolder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysCreateFolder) #### ASFileSysCreatePathNameProc ```cpp typedef ASPathName(*) ASFileSysCreatePathNameProc(ASAtom pathSpecType, const void *pathSpec, const void *mustBeZero)(ASAtom pathSpecType, const void *pathSpec, const void *mustBeZero) ``` Header: `ASExpT.h:2754` A callback for `ASFileSysRec` that creates an ASPathName based on the input type and PDFileSpec. Each ASFileSys implementation must publish the input types that it accepts. For example, the Mac OS ASFileSys may accept the type FSSpecPtr, and the MS-DOS ASFileSys may only accept types of `CString`. **Note:** The ASPathName returned should be released by the ASFileSysReleasePath() method when it is no longer needed. **See also:** [`ASFileSysCreatePathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysCreatePathName) #### ASFileSysDIPathFromPathExProc ```cpp typedef ASErrorCode(*) ASFileSysDIPathFromPathExProc(ASPathName path, ASPathName relativeToThisPath, ASText diPathText)(ASPathName path, ASPathName relativeToThisPath, ASText diPathText) ``` Header: `ASExpT.h:3152` A callback for `ASFileSysRec` that converts a path name to a device-independent path name, returned as an ASText object. It is called by ASFileSysDIPathFromPathEx(). **See also:** [`ASFileSysPathFromDIPathExProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysPathFromDIPathExProc), [`ASFileSysDIPathFromPathEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysDIPathFromPathEx), [`ASFileSysPathFromDIPathEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysPathFromDIPathEx) #### ASFileSysDestroyFolderIteratorProc ```cpp typedef void(*) ASFileSysDestroyFolderIteratorProc(ASFolderIterator folderIter)(ASFolderIterator folderIter) ``` Header: `ASExpT.h:2827` A callback for `ASFileSysRec` used to release the resources associated with `folderIter`. **See also:** [`ASFileSysFirstFolderItemProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysFirstFolderItemProc), [`ASFileSysNextFolderItemProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysNextFolderItemProc), [`ASFileSysFirstFolderItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysFirstFolderItem), [`ASFileSysNextFolderItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysNextFolderItem), [`ASFileSysDestroyFolderIterator`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysDestroyFolderIterator) #### ASFileSysDiPathFromPathProc ```cpp typedef char *(*) ASFileSysDiPathFromPathProc(ASPathName path, ASPathName relativeToThisPath)(ASPathName path, ASPathName relativeToThisPath) ``` Header: `ASExpT.h:2663` A callback for `ASFileSysRec` that converts a path name to a device- independent path name. It is called by ASFileSysDIPathFromPath(). **Note:** The memory for the `char*` returned should be freed with the ASfree() method when it is no longer needed. **See also:** [`ASFileSysDIPathFromPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysDIPathFromPath) #### ASFileSysDisplayASTextFromPathProc ```cpp typedef ASErrorCode(*) ASFileSysDisplayASTextFromPathProc(ASPathName path, ASText displayText)(ASPathName path, ASText displayText) ``` Header: `ASExpT.h:3109` Places a representation that can be displayed to users of a path into `displayText`. This does not raise an error. #### ASFileSysDisplayStringFromPathProc ```cpp typedef char *(*) ASFileSysDisplayStringFromPathProc(ASPathName path)(ASPathName path) ``` Header: `ASExpT.h:2910` A callback for ASFileSysRec used to obtain a representation of a path that can be displayed by the user. **Parameters** - `path`: The ASPathName in question. **Returns:** The display string, or `NULL` if some error occurred. It must be possible to release its memory with ASfree(). **See also:** [`ASFileSysDisplayStringFromPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysDisplayStringFromPath) #### ASFileSysDisposePathNameProc ```cpp typedef void(*) ASFileSysDisposePathNameProc(ASPathName pathName)(ASPathName pathName) ``` Header: `ASExpT.h:2695` A callback for `ASFileSysRec` that is called by ASFileSysReleasePath(). This callback frees any memory occupied by `pathname`. It does not result in any file-level operations. **See also:** [`ASFileSysReleasePath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysReleasePath) #### ASFileSysFirstFolderItemProc ```cpp typedef ASFolderIterator(*) ASFileSysFirstFolderItemProc(ASPathName folderPath, ASFileSysItemProps props, ASPathName *itemPath)(ASPathName folderPath, ASFileSysItemProps props, ASPathName *itemPath) ``` Header: `ASExpT.h:2789` A callback for `ASFileSysRec` that begins the process of iterating through the contents of a folder. **See also:** [`ASFileSysNextFolderItemProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysNextFolderItemProc), [`ASFileSysDestroyFolderIteratorProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysDestroyFolderIteratorProc), [`ASFileSysFirstFolderItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysFirstFolderItem), [`ASFileSysNextFolderItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysNextFolderItem), [`ASFileSysDestroyFolderIterator`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysDestroyFolderIterator) #### ASFileSysFlushProc ```cpp typedef ASErrorCode(*) ASFileSysFlushProc(ASMDFile f)(ASMDFile f) ``` Header: `ASExpT.h:2460` A callback for `ASFileSysRec` that flushes data for the specified file. It is called by ASFileFlush(). **See also:** [`ASFileSysFlushVolumeProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysFlushVolumeProc), [`ASFileFlush`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileFlush) #### ASFileSysFlushVolumeProc ```cpp typedef ASErrorCode(*) ASFileSysFlushVolumeProc(ASPathName pathName)(ASPathName pathName) ``` Header: `ASExpT.h:2735` A callback for `ASFileSysRec` that flushes the volume on which the specified file resides. This ensures that any data written to the system for the volume containing `pathName` is flushed out to the physical volume (equivalent to the Mac OS FlushVol, or to the UNIX sync). Call this after you are finished writing a complete transaction to force a commit. This callback is not called directly from any client API method, but is used internally by the Acrobat viewer. **See also:** [`ASFileSysFlushProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysFlushProc) #### ASFileSysGetEof64Proc ```cpp typedef ASErrorCode(*) ASFileSysGetEof64Proc(ASMDFile f, ASFilePos64 *pos)(ASMDFile f, ASFilePos64 *pos) ``` Header: `ASExpT.h:3264` A callback for `ASFileSysRec` that gets a file's current logical size. It is called by ASFileGetEOF() and is capable of handling file sizes over 2 GB. **See also:** [`ASFileGetEOF`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileGetEOF), [`ASFileSetEOF`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSetEOF) #### ASFileSysGetEofProc ```cpp typedef ASErrorCode(*) ASFileSysGetEofProc(ASMDFile f, ASFilePos *pos)(ASMDFile f, ASFilePos *pos) ``` Header: `ASExpT.h:2516` A callback for `ASFileSysRec` that gets a file's current logical size. It is called by ASFileGetEOF(), and is not capable of handling file sizes over 2 GB. **See also:** [`ASFileGetEOF`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileGetEOF), [`ASFileSetEOF`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSetEOF) #### ASFileSysGetFileFlags ```cpp typedef ASFlagBits(*) ASFileSysGetFileFlags(ASMDFile f)(ASMDFile f) ``` Header: `ASExpT.h:2249` A callback for `ASFileSysRec` that gets the flags for the specified file. #### ASFileSysGetFilePositionLimitProc ```cpp typedef ASErrorCode(*) ASFileSysGetFilePositionLimitProc(ASFilePos64 *pos)(ASFilePos64 *pos) ``` Header: `ASExpT.h:3208` A callback for ASFileSysRec that returns the maximum file position that can be processed by this file system. This is not the maximum size file that can be created, but the maximum file position that can be handled by the arithmetic in the file system implementation. This will typically be `(2 ^ 31) - 1` or `(2 ^ 63) - 1`. If this entry is not present, a value of `(2 ^ 31) - 1` should be assumed. **See also:** [`ASFileSysGetFilePosLimit`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysGetFilePosLimit) #### ASFileSysGetFileSysNameProc ```cpp typedef ASAtom(*) ASFileSysGetFileSysNameProc(void)(void) ``` Header: `ASExpT.h:2706` A callback for `ASFileSysRec` that gets this file system's name. This callback is not called directly by any method in the client API, but is used internally by the Acrobat viewer. **See also:** [`ASFileRegisterFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileRegisterFileSys) #### ASFileSysGetItemPropsAsCabProc ```cpp typedef ASInt32(*) ASFileSysGetItemPropsAsCabProc(ASPathName pathName, ASCab theCab)(ASPathName pathName, ASCab theCab) ``` Header: `ASExpT.h:3021` A callback for `ASFileSysRec` that gets a full description of the file system object associated with `pathName`, returning the item properties in the ASCab format. If the ASCab has no keys on entry, every known property is filled in. If it is not empty, only properties corresponding to keys in the ASCab are filled in. Keys that do not map to a property of the object are removed. The ASCab has the following potential entries: `ASBool isThere;` `ASInt32 type;` `ASBool isHidden;` `ASBool isReadOnly;` `char * creationDate; // PDF style date` `string char * modDate; // PDF style date string` `ASUns32 fileSizeHigh;` `ASUns32 fileSizeLow;` `ASInt32 folderSize;` `ASUns32 creatorCode;` `ASUns32 typeCode;` `ASUns32 versionMajor;` `ASUns32 versionMinor;` `ASBool isCheckedOut;` `ASBool isPublished;` **See also:** [`ASFileSysGetItemPropsAsCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysGetItemPropsAsCab) #### ASFileSysGetItemPropsProc ```cpp typedef ASErrorCode(*) ASFileSysGetItemPropsProc(ASPathName pathName, ASFileSysItemProps props)(ASPathName pathName, ASFileSysItemProps props) ``` Header: `ASExpT.h:2767` A callback for `ASFileSysRec` used to retrieve a full description of the file system object associated with the path. **See also:** [`ASFileSysGetItemProps`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysGetItemProps) #### ASFileSysGetNameAsASTextProc ```cpp typedef ASErrorCode(*) ASFileSysGetNameAsASTextProc(ASPathName pathName, ASText name)(ASPathName pathName, ASText name) ``` Header: `ASExpT.h:3103` A callback for `ASFileSysRec` that gets the file name for the specified ASPathName as an ASText object. **Note:** This supersedes ASFileSysGetNameProc() for Acrobat 6.0. **See also:** [`ASFileSysGetFileSysNameProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysGetFileSysNameProc), [`ASFileSysGetNameProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysGetNameProc) #### ASFileSysGetNameForDisplayProc ```cpp typedef ASErrorCode(*) ASFileSysGetNameForDisplayProc(ASPathName pathName, ASText nameForDisplay)(ASPathName pathName, ASText nameForDisplay) ``` Header: `ASExpT.h:3278` A callback for `ASFileSysRec` that gets the Windows Explorer/Mac Finder representation for the specified ASPathName as an ASText object. This may be a localized and extension-stripped version of the filename. #### ASFileSysGetNameProc ```cpp typedef ASErrorCode(*) ASFileSysGetNameProc(ASPathName pathName, char *name, ASTArraySize maxLength)(ASPathName pathName, char *name, ASTArraySize maxLength) ``` Header: `ASExpT.h:2610` A callback for `ASFileSysRec` that returns a character string containing the file name for the specified ASPathName. The character string contains only the file name; it is not a complete path name. This callback is not called directly from any plug-in API method. It is used internally by the Acrobat viewer. **See also:** [`ASFileSysGetFileSysNameProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysGetFileSysNameProc) #### ASFileSysGetParentProc ```cpp typedef ASPathName(*) ASFileSysGetParentProc(ASPathName path)(ASPathName path) ``` Header: `ASExpT.h:2880` A callback for `ASFileSysRec` used to obtain the parent of the input path. #### ASFileSysGetPlatformThingProc ```cpp typedef void *(*) ASFileSysGetPlatformThingProc(ASPathName path, ASAtom thing)(ASPathName path, ASAtom thing) ``` Header: `ASExpT.h:2979` Returns a platform file system representation of the ASPathName passed according to the atom selector. It allocates memory for the returned structure, which the caller must release with ASfree(). This does not raise an error. #### ASFileSysGetPos64Proc ```cpp typedef ASErrorCode(*) ASFileSysGetPos64Proc(ASMDFile f, ASFilePos64 *pos)(ASMDFile f, ASFilePos64 *pos) ``` Header: `ASExpT.h:3237` A callback that gets the current position for the specified file. It is called by ASFileGetPos(), and is capable of handling file postions over 2 GB. **See also:** [`ASFileSysSetPosProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysSetPosProc), [`ASFileGetPos`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileGetPos), [`ASFileSetPos`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSetPos) #### ASFileSysGetPosProc ```cpp typedef ASErrorCode(*) ASFileSysGetPosProc(ASMDFile f, ASFilePos *pos)(ASMDFile f, ASFilePos *pos) ``` Header: `ASExpT.h:2488` A callback for `ASFileSysRec` that gets the current position for the specified file. It is called by ASFileGetPos(), and is not capable of handling file positions over 2 GB. **See also:** [`ASFileSysSetPosProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysSetPosProc), [`ASFileGetPos`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileGetPos), [`ASFileSetPos`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSetPos) #### ASFileSysGetStatusProc ```cpp typedef ASFlagBits(*) ASFileSysGetStatusProc(ASMDFile f)(ASMDFile f) ``` Header: `ASExpT.h:2393` A callback for `ASFileSysRec` that gets the status of the specified file. This callback is used for asynchronous I/O. For example, it can indicate that an underlying file connection has been closed. **See also:** [`ASFileRead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileRead) #### ASFileSysGetStorageFreeSpace64Proc ```cpp typedef ASDiskSpace64(*) ASFileSysGetStorageFreeSpace64Proc(ASPathName pathName)(ASPathName pathName) ``` Header: `ASExpT.h:3289` A callback for `ASFileSysRec` that gets the amount of free space on the volume containing the specified ASPathName. It is similar to ASFileSysGetStorageFreeSpace(), except that the return value is not limited to 4 GB (with a 64-bit return value). #### ASFileSysGetStorageFreeSpaceProc ```cpp typedef ASDiskSpace(*) ASFileSysGetStorageFreeSpaceProc(ASPathName pathName)(ASPathName pathName) ``` Header: `ASExpT.h:2716` A callback for `ASFileSysRec` that gets the amount of free space on the volume containing the specified ASPathName. #### ASFileSysGetTempPathNameProc ```cpp typedef ASPathName(*) ASFileSysGetTempPathNameProc(ASPathName pathName)(ASPathName pathName) ``` Header: `ASExpT.h:2627` A callback for `ASFileSysRec` that returns a unique path name suitable for use in creating temporary files. **Note:** The ASPathName returned should be released by the ASFileSysReleasePath() method when it is no longer needed. **See also:** [`ASFileSysCopyPathNameProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysCopyPathNameProc) #### ASFileSysGetTypeAndCreatorProc ```cpp typedef void(*) ASFileSysGetTypeAndCreatorProc(ASPathName path, ASlFileTypeCreator *type, ASlFileTypeCreator *creator)(ASPathName path, ASlFileTypeCreator *type, ASlFileTypeCreator *creator) ``` Header: `ASExpT.h:2939` A callback for `ASFileSysRec` that gets the file type and creator for the file. This callback is currently only implemented on Mac OS. It does not raise an error. **See also:** [`ASFileSysSetTypeAndCreatorProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysSetTypeAndCreatorProc), [`ASFileSysGetTypeAndCreator`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysGetTypeAndCreator), [`ASFileSysSetTypeAndCreator`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysSetTypeAndCreator) #### ASFileSysHardFlushProc ```cpp typedef ASErrorCode(*) ASFileSysHardFlushProc(ASMDFile f)(ASMDFile f) ``` Header: `ASExpT.h:2970` Does a hard flush on the file. A hard flush makes sure the data is flushed even if the file is remote. This proc should succeed and do nothing if it is not supported. This does not raise an error. #### ASFileSysIsInUseProc ```cpp typedef ASBool(*) ASFileSysIsInUseProc(ASPathName pathName)(ASPathName pathName) ``` Header: `ASExpT.h:3298` A callback for `ASFileSysRec` that tests whether a file is in use by another process. #### ASFileSysIsSameFileProc ```cpp typedef ASBool(*) ASFileSysIsSameFileProc(ASMDFile f, ASPathName pathName, ASPathName newPathName)(ASMDFile f, ASPathName pathName, ASPathName newPathName) ``` Header: `ASExpT.h:2588` A callback for `ASFileSysRec` that tests whether two files are the same. #### ASFileSysMReadRequestProc ```cpp typedef ASErrorCode(*) ASFileSysMReadRequestProc(ASMDFile f, ASFile aFile, ASTFilePos *blockPairs, ASTArraySize nBlockPairs)(ASMDFile f, ASFile aFile, ASTFilePos *blockPairs, ASTArraySize nBlockPairs) ``` Header: `ASExpT.h:2366` A callback for `ASFileSysRec` that queues asynchronous requests for one or more byte ranges that the caller (usually the Acrobat viewer or library) will need in the near future. This callback is important for slow file systems, such as the web, to improve overall performance. It allows the file system to begin retrieving bytes before they are actually needed, while the Acrobat software continues processing as much as it can with the data that has already been downloaded. This callback does not actually read the data, but merely queues the requests, starts the asynchronous code that reads the data, and returns. The asynchronous code that reads the data must use ASFilePushData() to push the data from each byte range to the Acrobat software as soon as the data is ready. This callback is similar to the ASFileSysAsyncReadProc(), except that this callback contains a caller-provided ASIODoneProc() and can only be used for a single byte range. **See also:** [`ASFileSysAsyncReadProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysAsyncReadProc), [`ASFileSysClearOutstandingMReadsProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysClearOutstandingMReadsProc), [`ASFileRead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileRead), [`ASFileHasOutstandingMReads`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileHasOutstandingMReads) #### ASFileSysNextFolderItemProc ```cpp typedef ASBool(*) ASFileSysNextFolderItemProc(ASFolderIterator folderIter, ASFileSysItemProps props, ASPathName *itemPath)(ASFolderIterator folderIter, ASFileSysItemProps props, ASPathName *itemPath) ``` Header: `ASExpT.h:2812` A callback for ASFileSysRec used to continue the iteration process associated with the ASFolderIterator object. Both `itemPath` and `props` are optional and can be `NULL` if the caller is not interested in that information. **See also:** [`ASFileSysFirstFolderItemProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysFirstFolderItemProc), [`ASFileSysDestroyFolderIteratorProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysDestroyFolderIteratorProc), [`ASFileSysFirstFolderItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysFirstFolderItem), [`ASFileSysNextFolderItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysNextFolderItem), [`ASFileSysDestroyFolderIterator`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysDestroyFolderIterator) #### ASFileSysOpen64Proc ```cpp typedef ASErrorCode(*) ASFileSysOpen64Proc(ASPathName pathName, ASFileMode mode, ASMDFile *fP)(ASPathName pathName, ASFileMode mode, ASMDFile *fP) ``` Header: `ASExpT.h:3192` A callback for `ASFileSysRec` that opens the specified file. It is called by ASFileSysOpen64(). This callback must be used if the file is over 2 GB in length. **See also:** [`ASFileSysCloseProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysCloseProc), [`ASFileSysOpenFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysOpenFile), [`ASFileReopen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileReopen), [`ASFileClose`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileClose) #### ASFileSysOpenProc ```cpp typedef ASErrorCode(*) ASFileSysOpenProc(ASPathName pathName, ASFileMode mode, ASMDFile *fP)(ASPathName pathName, ASFileMode mode, ASMDFile *fP) ``` Header: `ASExpT.h:2436` A callback for `ASFileSysRec` that opens the specified file. It is called by ASFileSysOpenFile() and ASFileReopen(). This callback returns an error if the file is over 2 GB in length. **See also:** [`ASFileSysCloseProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysCloseProc), [`ASFileSysOpenFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysOpenFile), [`ASFileReopen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileReopen), [`ASFileClose`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileClose) #### ASFileSysPathFromDIPathExProc ```cpp typedef ASPathName(*) ASFileSysPathFromDIPathExProc(ASConstText diPathText, ASPathName relativeToThisPath)(ASConstText diPathText, ASPathName relativeToThisPath) ``` Header: `ASExpT.h:3174` A callback for `ASFileSysRec` that converts a device-independent path name from an ASText object to an ASPathName. It is called by ASFileSysPathFromDIPathEx(). **Note:** The ASPathName returned should be released by the ASFileSysReleasePath() method when it is no longer needed. **See also:** [`ASFileSysDIPathFromPathExProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysDIPathFromPathExProc), [`ASFileSysPathFromDIPathEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysPathFromDIPathEx), [`ASFileSysDIPathFromPathEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysDIPathFromPathEx) #### ASFileSysPathFromDIPathProc ```cpp typedef ASPathName(*) ASFileSysPathFromDIPathProc(const char *diPath, ASPathName relativeToThisPath)(const char *diPath, ASPathName relativeToThisPath) ``` Header: `ASExpT.h:2683` A callback for ASFileSysRec that converts a device-independent path name to an ASPathName. It is called by ASFileSysPathFromDIPath(). **Parameters** - `diPath`: IN/OUT A device-independent path name to convert to an ASPathName. - `relativeToThisPath`: IN/OUT If `diPath` is an absolute path name, the value of this parameter is `NULL`. If `diPath` is a relative path name, the parameter is the path name relative to which it is specified. **Note:** The ASPathName returned should be released by the ASFileSysReleasePath() method when it is no longer needed. **See also:** [`ASFileSysPathFromDIPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysPathFromDIPath), [`ASFileSysDIPathFromPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysDIPathFromPath) #### ASFileSysPerformOpOnItemProc ```cpp typedef ASInt32(*) ASFileSysPerformOpOnItemProc(ASPathName pathName, const char *op, ASCab params)(ASPathName pathName, const char *op, ASCab params) ``` Header: `ASExpT.h:3050` A callback for `ASFileSysRec` that performs the specified operation on a particular file. **See also:** [`ASFileSysCanPerformOpOnItemProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysCanPerformOpOnItemProc), [`ASFileSysPerformOpOnItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysPerformOpOnItem) #### ASFileSysRangeArrivedProc ```cpp typedef void(*) ASFileSysRangeArrivedProc(ASInt32 start, ASInt32 length, void *clientData)(ASInt32 start, ASInt32 length, void *clientData) ``` Header: `ASExpT.h:3119` A callback for `ASFileSysRec` used when a byte range has arrived during a file load operation. #### ASFileSysReadProc ```cpp typedef ASSize_t(*) ASFileSysReadProc(void *ptr, ASSize_t size, ASSize_t count, ASMDFile f, ASErrorCode *pError)(void *ptr, ASSize_t size, ASSize_t count, ASMDFile f, ASErrorCode *pError) ``` Header: `ASExpT.h:2534` A callback for `ASFileSysRec` that reads data from the specified file. It is called by ASFileRead() and returns an error if the file size is over 2 GB. **See also:** [`ASFileSysWriteProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysWriteProc), [`ASFileRead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileRead) #### ASFileSysReleasePlatformPathProc ```cpp typedef void(*) ASFileSysReleasePlatformPathProc(ASPlatformPath platformPath)(ASPlatformPath platformPath) ``` Header: `ASExpT.h:3087` A callback for `ASFileSysRec` that releases the specified platform path object when the client is done with it. **See also:** [`ASFileSysAcquirePlatformPathProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysAcquirePlatformPathProc), [`ASFileSysReleasePlatformPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysReleasePlatformPath) #### ASFileSysRemoveFolderProc ```cpp typedef ASErrorCode(*) ASFileSysRemoveFolderProc(ASPathName path)(ASPathName path) ``` Header: `ASExpT.h:2900` A callback for `ASFileSysRec` used to delete the folder at the specified path. **See also:** [`ASFileSysCreateFolderProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysCreateFolderProc), [`ASFileSysRemoveFolder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysRemoveFolder) #### ASFileSysRemoveProc ```cpp typedef ASErrorCode(*) ASFileSysRemoveProc(ASPathName pathName)(ASPathName pathName) ``` Header: `ASExpT.h:2561` A callback for `ASFileSysRec` that deletes a file. It is called by ASFileSysRemoveFile(). **See also:** [`ASFileSysRemoveFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysRemoveFile) #### ASFileSysRenameProc ```cpp typedef ASErrorCode(*) ASFileSysRenameProc(ASMDFile *f, ASPathName oldPath, ASPathName newPath)(ASMDFile *f, ASPathName oldPath, ASPathName newPath) ``` Header: `ASExpT.h:2574` A callback for `ASFileSysRec` that renames a file. It is not called directly by any method in the client API, but is used internally by the Acrobat viewer. **See also:** [`ASFileSysGetNameProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysGetNameProc) #### ASFileSysReopenProc ```cpp typedef ASMDFile(*) ASFileSysReopenProc(ASMDFile f, ASFileMode newMode, ASErrorCode *error)(ASMDFile f, ASFileMode newMode, ASErrorCode *error) ``` Header: `ASExpT.h:2961` A callback for `ASFileSysRec` that reopens a file in the specified mode. ASFileReopen() calls this method if it is present. If this method is not present, or if it returns `NULL` and `error` is `0`, ASFileReopen() does a close followed by an open. If `error` is non-zero, ASFileReopen() ignores the return value and fails with that error. On success, the old file should not need to be closed. On failure, the old file should remain unchanged. **See also:** [`ASFileReopen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileReopen), [`ASFileSysOpenFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysOpenFile) #### ASFileSysSetEof64Proc ```cpp typedef ASErrorCode(*) ASFileSysSetEof64Proc(ASMDFile f, ASFilePos64 pos)(ASMDFile f, ASFilePos64 pos) ``` Header: `ASExpT.h:3250` A callback for `ASFileSysRec` that increases or decreases the logical size of a file. It is called by ASFileSetEOF() and is capable of handling file sizes over 2 GB. **See also:** [`ASFileGetEOF`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileGetEOF), [`ASFileSetEOF`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSetEOF) #### ASFileSysSetEofProc ```cpp typedef ASErrorCode(*) ASFileSysSetEofProc(ASMDFile f, ASFilePos pos)(ASMDFile f, ASFilePos pos) ``` Header: `ASExpT.h:2502` A callback for `ASFileSysRec` that increases or decreases the logical size of a file. It is called by ASFileSetEOF(). It returns an error if the current file position is over 2 GB. **See also:** [`ASFileSysCanSetEofProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysCanSetEofProc), [`ASFileGetEOF`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileGetEOF), [`ASFileSetEOF`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSetEOF) #### ASFileSysSetModeProc ```cpp typedef ASlFileMode(*) ASFileSysSetModeProc(ASMDFile f, ASlFileMode modeValue, ASMaskBits modeMask)(ASMDFile f, ASlFileMode modeValue, ASMaskBits modeMask) ``` Header: `ASExpT.h:2869` ASFileSysSetMode() sets and gets parameters for the specified file. **Mode operations:** OperationCode Get the current mode`ASFileSetMode(aFile, 0, 0);` Set the mode`ASFileSetMode( aFile, kASFileModeDoNotYieldIfBytesNotReady, kASFileModeDoNotYieldIfBytesNotReady );` Clear the mode`ASFileSetMode( aFile, 0, kASFileModeDoNotYieldIfBytesNotReady );` **Setting parameters:** ParameterEffect kASFileModeDoNotYieldIfBytesNotReadyIf set, then ASFileRead() will not perform a `fileSys->yield()` if `RaiseIfBytesNotReady` is `true`. Otherwise, it may call `yield` before raising the exception `fileErrBytesNotReady`. kASFileModeDisableExplicitMReadRequestsIf set, `mread()` requests made via ASFileMReadRequest() become NOPs. kASFileRaiseIfBytesNotReadyIf set, ASFileRead() will raise `fileErrBytesNotReady` when trying to read from a file with a cache for which the requested bytes are not yet present. **Parameters** - `asFile`: The file handle. - `modeValue`: The value of bits to be set or cleared. #### ASFileSysSetPos64Proc ```cpp typedef ASErrorCode(*) ASFileSysSetPos64Proc(ASMDFile f, ASFilePos64 pos)(ASMDFile f, ASFilePos64 pos) ``` Header: `ASExpT.h:3223` A callback for `ASFileSysRec` that sets the current position in a file, which is the point from which data will next be read. It is called by ASFileSetPos() and is capable of handling file postions over 2 GB. **See also:** [`ASFileGetPos`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileGetPos), [`ASFileSetPos`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSetPos) #### ASFileSysSetPosProc ```cpp typedef ASErrorCode(*) ASFileSysSetPosProc(ASMDFile f, ASFilePos pos)(ASMDFile f, ASFilePos pos) ``` Header: `ASExpT.h:2474` A callback for `ASFileSysRec` that sets the current position in a file (the point from which data will next be read). It is called by ASFileSetPos(). **See also:** [`ASFileGetPos`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileGetPos), [`ASFileSetPos`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSetPos) #### ASFileSysSetTypeAndCreatorProc ```cpp typedef void(*) ASFileSysSetTypeAndCreatorProc(ASPathName path, ASlFileTypeCreator type, ASlFileTypeCreator creator)(ASPathName path, ASlFileTypeCreator type, ASlFileTypeCreator creator) ``` Header: `ASExpT.h:2924` A callback for `ASFileSysRec` that sets the file type and creator for the file. This callback is currently only implemented on Mac OS. It does not raise an error. **See also:** [`ASFileSysGetTypeAndCreatorProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysGetTypeAndCreatorProc), [`ASFileSysGetTypeAndCreator`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysGetTypeAndCreator), [`ASFileSysSetTypeAndCreator`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysSetTypeAndCreator) #### ASFileSysURLFromPathProc ```cpp typedef char *(*) ASFileSysURLFromPathProc(ASPathName path)(ASPathName path) ``` Header: `ASExpT.h:2837` A callback for ASFileSysRec used to obtain the URL associated with the given ASPathName. **Parameters** - `path`: The ASPathName in question. **Returns:** The URL or `NULL` if it cannot be determined. It must be possible to release the allocated memory with ASfree(). **See also:** [`ASFileSysURLFromPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysURLFromPath) #### ASFileSysWriteProc ```cpp typedef ASSize_t(*) ASFileSysWriteProc(void *ptr, ASSize_t size, ASSize_t count, ASMDFile f, ASErrorCode *pError)(void *ptr, ASSize_t size, ASSize_t count, ASMDFile f, ASErrorCode *pError) ``` Header: `ASExpT.h:2550` A callback for `ASFileSysRec` that writes data to the specified file. **See also:** [`ASFileSysReadProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysReadProc), [`ASFileWrite`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileWrite) #### ASFileSysYieldProc ```cpp typedef ASErrorCode(*) ASFileSysYieldProc(ASMDFile f)(ASMDFile f) ``` Header: `ASExpT.h:2330` A callback for `ASFileSysRec` that yields the asynchronous I/O requests for the specified file. This allows other processes to process events that may be required for a file read to complete. An ASFileSys should implement a yield mechanism to complement asynchronous read and write requests. On Windows, this could be a normal PeekMessage-based yield. In UNIX, it could mean using `select` on a file descriptor. **See also:** [`ASFileSysAsyncAbortProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysAsyncAbortProc), [`ASFileSysAsyncReadProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysAsyncReadProc), [`ASFileSysAsyncWriteProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysAsyncWriteProc), [`ASFileRead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileRead) #### ASIODoneProc ```cpp typedef void(*) ASIODoneProc(ASIORequest req)(ASIORequest req) ``` Header: `ASExpT.h:1989` A callback in ASIORequest used by the asynchronous read/write ASFileSys implementation and provided by the ASFile implementation to the ASFileSys. The ASFileSys must call this method when an asynchronous request is completed: • When an I/O request has some or all of its data. • If the request is successfully queued but an error prevents it from completing. • If the request is aborted by calling ASFileSysAsyncAbortProc(). In this case, `totalBytesCompleted = 0` and `pError = -1`. If the request fails, this method must still be called, with the error. It is not called, however, if there is an error queueing the read or write request. **See also:** [`ASFileSysAsyncAbortProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysAsyncAbortProc), [`ASFileSysAsyncReadProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysAsyncReadProc), [`ASFileSysAsyncWriteProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysAsyncWriteProc), [`ASFileSysYieldProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysYieldProc) ### Structures (4) #### ASFileSys ```cpp typedef struct _t_ASFileSysRec* ASFileSys ``` Header: `ASExpT.h:1840` A data structure containing callbacks that implement a file system. **See also:** [`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys) #### ASFolderIterator ```cpp typedef struct _t_ASFolderIterator* ASFolderIterator ``` Header: `ASExpT.h:2164` An opaque object used to iterate through the contents of a folder. ASFileSysFirstFolderItem() returns the first item in the folder along with an ASFolderIterator object for iterating through the rest of the items in the folder. Call ASFileSysNextFolderItem() with this object to return the next object in the folder until the method returns `false`. To discard the ASFolderIterator object, call ASFileSysDestroyFolderIterator(). **See also:** [`ASFileSysFirstFolderItemProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysFirstFolderItemProc), [`ASFileSysNextFolderItemProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysNextFolderItemProc), [`ASFileSysDestroyFolderIteratorProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysDestroyFolderIteratorProc), [`ASFileSysFirstFolderItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysFirstFolderItem), [`ASFileSysNextFolderItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysNextFolderItem), [`ASFileSysDestroyFolderIterator`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysDestroyFolderIterator) #### ASIORequest ```cpp typedef struct _t_ASIORequestRec* ASIORequest ``` Header: `ASExpT.h:1939` A data structure representing an I/O request. **See also:** [`ASFileSysAsyncReadProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysAsyncReadProc), [`ASFileSysAsyncWriteProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysAsyncWriteProc), [`ASIODoneProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASIODoneProc) #### ASPathName ```cpp typedef struct _t_ASPathNameRec* ASPathName ``` Header: `ASExpT.h:1852` **See also:** [`ASFileAcquirePathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileAcquirePathName), [`ASFileSysAcquireParent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysAcquireParent), [`ASFileSysCreatePathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysCreatePathName), [`ASFileSysPathFromDIPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysPathFromDIPath), [`ASPathFromPlatformPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathFromPlatformPath), [`PDFileSpecAcquireASPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileSpecAcquireASPath), [`ASFileSysReleasePath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysReleasePath), [`ASFileSysDIPathFromPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysDIPathFromPath) ### Definitions (55) #### ASFileSysCopyPath Header: `ASCalls.h:122` Value: `ASFileSysCopyPathName` #### ASFileSysCreatePathFromCFURLRef Header: `ASExpT.h:3833` Value: `ASFileSysCreatePathName(asfs, ASAtomFromString("CFURLRef"), (void *)CHECKTYPE(CFURLRef, cfURLRef), NULL);` #### ASFileSysCreatePathFromCString Header: `ASExpT.h:3809` Value: `ASFileSysCreatePathName(asfs, ASAtomFromString("Cstring"), (void *)CHECK_CHARSTR(cPath), NULL);` Helper macro for the ASFileSysCreatePathName() method. **Note:** This macro uses a local variable named `scratchFourBytes`: (`void* scratchFourBytes`). PDF Library users need to provide this variable in order to utilize the macro; the variable must be local to the client application, not to the library. Any client can use this macro provided that it has code similar to the following, in the same source file that uses the macro: `static void* scratchFourBytes;` **See also:** [`ASFileSysCreatePathFromDIPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysCreatePathFromDIPath), [`ASFileSysCreatePathFromFSSpec`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysCreatePathFromFSSpec), [`ASFileSysCreatePathWithFolderName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysCreatePathWithFolderName) #### ASFileSysCreatePathFromDIPath Header: `ASExpT.h:3764` Value: `ASFileSysCreatePathName(asfs, ASAtomFromString("DIPath"), (void *)CHECK_CHARSTR(cDIPath), \ (void *)CHECKTYPE(ASPathName, aspRelativeTo))` A helper macro for the ASFileSysCreatePathName() method. **See also:** [`ASFileSysCreatePathFromCString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysCreatePathFromCString), [`ASFileSysCreatePathFromFSSpec`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysCreatePathFromFSSpec), [`ASFileSysCreatePathWithFolderName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysCreatePathWithFolderName) #### ASFileSysCreatePathFromDIPathText Header: `ASExpT.h:3768` Value: `ASFileSysCreatePathName(asfs, ASAtomFromString("DIPathWithASText"), (void *)CHECKTYPE(ASText, tDIPath), \ (void *)CHECKTYPE(ASPathName, aspRelativeTo))` #### ASFileSysCreatePathFromFSRef Header: `ASExpT.h:3826` Value: `ASFileSysCreatePathName(asfs, ASAtomFromString("FSRef"), (void *)CHECKTYPE(FSRef, fsRef), NULL);` #### ASFileSysCreatePathFromFSRefWithCFStringRef Header: `ASExpT.h:3829` Value: `ASFileSysCreatePathName(asfs, ASAtomFromString("FSRefWithCFStringRef"), \ (void *)CHECKTYPE(FSRefWithCFStringRefRec *, fsRefWithCFStringRef), NULL);` #### ASFileSysCreatePathFromFSSpec Header: `ASExpT.h:3822` Value: `ASFileSysCreatePathName(asfs, ASAtomFromString("FSSpec"), (void *)CHECKTYPE(FSSpec *, cPath), NULL);` Helper macro for the ASFileSysCreatePathName() method. **See also:** [`ASFileSysCreatePathFromCString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysCreatePathFromCString), [`ASFileSysCreatePathFromDIPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysCreatePathFromDIPath), [`ASFileSysCreatePathWithFolderName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysCreatePathWithFolderName) #### ASFileSysCreatePathFromPOSIXPath Header: `ASExpT.h:3836` Value: `ASFileSysCreatePathName(asfs, ASAtomFromString("POSIXPath"), (void *)CHECK_CHARSTR(posixPath), NULL);` #### ASFileSysCreatePathWithFolderName Header: `ASExpT.h:3784` Value: `ASFileSysCreatePathName(asfs, ASAtomFromString("FolderPathName"), \ (void *)CHECKTYPE(ASPathName, aspFolder), (void *)CHECK_CHARSTR(cFileName))` Helper macro for the ASFileSysCreatePathName() method. **See also:** [`ASFileSysCreatePathFromCString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysCreatePathFromCString), [`ASFileSysCreatePathFromDIPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysCreatePathFromDIPath), [`ASFileSysCreatePathFromFSSpec`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysCreatePathFromFSSpec) #### ASFileSysCreatePathWithFolderNameWithASText Header: `ASExpT.h:3788` Value: `ASFileSysCreatePathName(asfs, ASAtomFromString("FolderPathNameWithASText"), \ (void *)CHECKTYPE(ASPathName, aspFolder), (void *)CHECKTYPE(ASText, tFileName))` #### ASFileSysReleasePath Header: `ASCalls.h:123` Value: `ASFileSysReleasePathName` #### ASFileSysRemoveFile Header: `ASCalls.h:124` Value: `ASFileSysRemove` #### KAITypeCode Header: `ASExpT.h:1763` Value: `ASFourCharCode('TEXT')` Adobe Illustrator AI file. #### kAPFTypeCode Header: `ASExpT.h:1686` Value: `ASFourCharCode('APF ')` Acrobat profile format (PPKLite). #### kAcrobatCreatorCode Header: `ASExpT.h:1626` Value: `ASFourCharCode('CARO')` Acrobat creator code. #### kDictionaryTypeCode Header: `ASExpT.h:1696` Value: `ASFourCharCode('DICT')` Spelling dictionary file. #### kEDNTypeCode Header: `ASExpT.h:1728` Value: `ASFourCharCode('fEDN')` eBook EDN activation file. #### kEPSTypeCode Header: `ASExpT.h:1768` Value: `ASFourCharCode('EPSF')` EPS file. #### kETDTypeCode Header: `ASExpT.h:1723` Value: `ASFourCharCode('fETD')` eBook Exchange Transfer Data (ETD) file. #### kExcelCreatorCode Header: `ASExpT.h:1813` Value: `ASFourCharCode('XCEL')` Microsoft Excel. #### kFDFTypeCode Header: `ASExpT.h:1651` Value: `ASFourCharCode('FDF ')` Forms data format. #### kGIFTypeCode Header: `ASExpT.h:1748` Value: `ASFourCharCode('GIFf')` GIF file. #### kHTMLCreatorCode Header: `ASExpT.h:1803` Value: `ASFourCharCode('MSIE')` Microsoft Internet Explorer. #### kHTMLTypeCode Header: `ASExpT.h:1798` Value: `ASFourCharCode('TEXT')` HTML file. #### kIllustratorCreatorCode Header: `ASExpT.h:1641` Value: `ASFourCharCode('ART5')` Adobe Illustrator creator code. #### kImageReadyCreatorCode Header: `ASExpT.h:1636` Value: `ASFourCharCode('MeSa')` Adobe ImageReady creator code. #### kJPEGTypeCode Header: `ASExpT.h:1753` Value: `ASFourCharCode('JPEG')` JPEG file. #### kLocaleTypeCode Header: `ASExpT.h:1706` Value: `ASFourCharCode('LANG')` Locale file. #### kPDFTypeCode Header: `ASExpT.h:1646` Value: `ASFourCharCode('PDF ')` Portable document format (PDF). #### kPDXTypeCode Header: `ASExpT.h:1676` Value: `ASFourCharCode('PDX ')` Acrobat catalog index file. #### kPICTTypeCode Header: `ASExpT.h:1738` Value: `ASFourCharCode('PICT')` Mac OS PICT file. #### kPNGTypeCode Header: `ASExpT.h:1758` Value: `ASFourCharCode('PNGf')` PNG file. #### kPSDTypeCode Header: `ASExpT.h:1733` Value: `ASFourCharCode('8BIM')` Adobe Photoshop PSD file. #### kPXDFTypeCode Header: `ASExpT.h:1666` Value: `ASFourCharCode('MARS')` XML PDF. #### kPhotoshopCreatorCode Header: `ASExpT.h:1631` Value: `ASFourCharCode('8BIM')` Adobe Photoshop creator code. #### kPluginNewTypeCode Header: `ASExpT.h:1718` Value: `ASFourCharCode('XTNc')` Preferred Plug-in file. Using this file type allows shipping of a Carbonized plug-in without worrying that it will try to load and show an error when installed. #### kPluginTypeCode Header: `ASExpT.h:1711` Value: `ASFourCharCode('XTND')` Plug-in file. #### kPowerPointCreatorCode Header: `ASExpT.h:1823` Value: `ASFourCharCode('SLD8')` Microsoft PowerPoint. #### kPrefsTypeCode Header: `ASExpT.h:1671` Value: `ASFourCharCode('PREF')` Preferences file. #### kQuickTimeCreatorCode Header: `ASExpT.h:1793` Value: `ASFourCharCode('TVOD')` QuickTime player. #### kQuickTimeTypeCode Header: `ASExpT.h:1788` Value: `ASFourCharCode('MooV')` QuickTime file. #### kRMFTypeCode Header: `ASExpT.h:1681` Value: `ASFourCharCode('RMF ')` Adobe Web Buy rights management file. #### kRTFTypeCode Header: `ASExpT.h:1778` Value: `ASFourCharCode('RTF ')` Text file. #### kSequenceTypeCode Header: `ASExpT.h:1691` Value: `ASFourCharCode('SEQU')` Acrobat sequence file. #### kTIFFTypeCode Header: `ASExpT.h:1743` Value: `ASFourCharCode('TIFF')` TIFF file. #### kTextCreatorCode Header: `ASExpT.h:1783` Value: `ASFourCharCode('ttxt')` SimpleText. #### kTextTypeCode Header: `ASExpT.h:1773` Value: `ASFourCharCode('TEXT')` Text file. #### kUnknownCreatorCode Header: `ASExpT.h:1833` Value: `0x3f3f3f3f` Unknown application. #### kUnknownTypeCode Header: `ASExpT.h:1828` Value: `0x3f3f3f3f` Unknown file. #### kWHATypeCode Header: `ASExpT.h:1701` Value: `ASFourCharCode('WHA ')` Web-hosted applications file. #### kWordCreatorCode Header: `ASExpT.h:1818` Value: `ASFourCharCode('W8BN')` Microsoft Word. #### kXDPTypeCode Header: `ASExpT.h:1661` Value: `ASFourCharCode('XDP ')` XML data package. #### kXFDFTypeCode Header: `ASExpT.h:1656` Value: `ASFourCharCode('XFDF')` XML forms data format. #### kXMLTypeCode Header: `ASExpT.h:1808` Value: `ASFourCharCode('TEXT')` XML file. ## ASFixed ### Functions (10) #### ASCStringToFixed ```cpp ASFixed ASCStringToFixed(const char *s) ``` Header: `ASProcs.h:559` Converts a `CString` to a fixed point number. Processes the string from left to right only until the first invalid character is located (for example, `a-z, A-Z`). **Parameters** - `s` (`const char *`): A `CString` to convert. **Returns:** [`ASFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixed) A fixed number corresponding to `s`, `0` if the string does not contain any valid number. **See also:** [`ASFixedToCString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedToCString), [`ASFixedRoundToInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedRoundToInt16), [`ASFixedRoundToInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedRoundToInt32), [`ASFixedTruncToInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedTruncToInt16), [`ASFixedTruncToInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedTruncToInt32), [`ASFixedToFloat`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedToFloat) #### ASFixedDiv ```cpp ASFixed ASFixedDiv(ASFixed a, ASFixed b) ``` Header: `ASProcs.h:522` Divides two fixed numbers. **Parameters** - `a` ([`ASFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixed)): The dividend. - `b` ([`ASFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixed)): The divisor. **Returns:** [`ASFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixed) The quotient `a / b`. **See also:** [`ASFixedMul`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedMul), `Fixed Numbers`, [`ASFixedRoundToInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedRoundToInt16), [`ASFixedRoundToInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedRoundToInt32), [`ASFixedTruncToInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedTruncToInt16), [`ASFixedTruncToInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedTruncToInt32), [`ASFixedToFloat`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedToFloat), `ASFloatToFixed`, [`ASInt16ToFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16ToFixed), [`ASInt32ToFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32ToFixed) #### ASFixedMatrixConcat ```cpp void ASFixedMatrixConcat(ASFixedMatrixP result, const ASFixedMatrix *m1, const ASFixedMatrix *m2) ``` Header: `ASProcs.h:584` Multiplies two matrices. **Parameters** - `result` (`ASFixedMatrixP`): (Filled by the method) A pointer to matrix `m2 x m1`. It is allowed for the result to point to the same location as either `m1` or `m2`. - `m1` (`const ASFixedMatrix *`): A pointer to the `ASFixedMatrix` value for the first matrix to multiply. - `m2` (`const ASFixedMatrix *`): A pointer to the `ASFixedMatrix` value for the second matrix to multiply. **Returns:** `void` **See also:** [`ASFixedMatrixInvert`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedMatrixInvert), [`ASFixedMatrixTransform`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedMatrixTransform), [`ASFixedMatrixTransformRect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedMatrixTransformRect), `Fixed Numbers`, [`ASFixedRoundToInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedRoundToInt16), [`ASFixedRoundToInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedRoundToInt32), [`ASFixedTruncToInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedTruncToInt16), [`ASFixedTruncToInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedTruncToInt32), [`ASFixedToFloat`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedToFloat), `ASFloatToFixed`, [`ASInt16ToFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16ToFixed), [`ASInt32ToFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32ToFixed) #### ASFixedMatrixInvert ```cpp void ASFixedMatrixInvert(ASFixedMatrixP result, const ASFixedMatrixP m) ``` Header: `ASProcs.h:606` Inverts a matrix. If a matrix is nearly singular (meaning that it has a determinant of nearly zero), inverting and re-inverting the matrix may not yield the original matrix. **Parameters** - `result` (`ASFixedMatrixP`): (Filled by the method) A pointer to `m-1`. It is allowed for the result to point to the same location as `m`. - `m` (`const ASFixedMatrixP`): A pointer to the `ASFixedMatrix` to invert. **Returns:** `void` **See also:** [`ASFixedMatrixConcat`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedMatrixConcat), [`ASFixedMatrixTransform`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedMatrixTransform), [`ASFixedMatrixTransformRect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedMatrixTransformRect), [`ASFixedRoundToInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedRoundToInt16), [`ASFixedRoundToInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedRoundToInt32), [`ASFixedTruncToInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedTruncToInt16), [`ASFixedTruncToInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedTruncToInt32), [`ASFixedToFloat`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedToFloat) #### ASFixedMatrixTransform ```cpp void ASFixedMatrixTransform(ASFixedPointP result, const ASFixedMatrixP m, const ASFixedPointP p) ``` Header: `ASProcs.h:632` Transforms the point `p` through the matrix `m`, puts result in result. `p` and result can point to the same place. **Parameters** - `result` (`ASFixedPointP`): (Filled by the method) A pointer to the `ASFixedPoint` containing the result of transforming `p` through `m`. It is allowed for the result to point to the same location as `m`. - `m` (`const ASFixedMatrixP`): A pointer to the `ASFixedMatrix` through which `p` is transformed. - `p` (`const ASFixedPointP`): A pointer to the `ASFixedPoint` representing the point to transform through `m`. **Returns:** `void` **See also:** [`ASFixedMatrixTransformRect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedMatrixTransformRect), [`ASFixedMatrixConcat`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedMatrixConcat), [`ASFixedMatrixInvert`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedMatrixInvert), `Fixed Numbers`, [`ASFixedRoundToInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedRoundToInt16), [`ASFixedRoundToInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedRoundToInt32), [`ASFixedTruncToInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedTruncToInt16), [`ASFixedTruncToInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedTruncToInt32), [`ASFixedToFloat`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedToFloat), `ASFloatToFixed`, [`ASInt16ToFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16ToFixed), [`ASInt32ToFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32ToFixed) #### ASFixedMatrixTransformRect ```cpp void ASFixedMatrixTransformRect(ASFixedRectP result, const ASFixedMatrixP m, const ASFixedRectP rectIn) ``` Header: `ASProcs.h:659` Transforms a rectangle through a matrix. **Parameters** - `result` (`ASFixedRectP`): (Filled by the method) A pointer to the `ASFixedRect` containing the smallest bounding box for the transformed rectangle. It is allowed for the result to point to the same location as `m`. The result will always have `bottom < top` and `left < right`. - `m` (`const ASFixedMatrixP`): A pointer to the `ASFixedMatrix` containing the matrix through which `r` is transformed. - `rectIn` (`const ASFixedRectP`): A pointer to the `ASFixedRect` containing the rectangle to transform through `m`. **Returns:** `void` **See also:** [`ASFixedMatrixTransform`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedMatrixTransform), [`ASFixedMatrixConcat`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedMatrixConcat), [`ASFixedMatrixInvert`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedMatrixInvert), `Fixed Numbers`, [`ASFixedRoundToInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedRoundToInt16), [`ASFixedRoundToInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedRoundToInt32), [`ASFixedTruncToInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedTruncToInt16), [`ASFixedTruncToInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedTruncToInt32), [`ASFixedToFloat`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedToFloat), `ASFloatToFixed`, [`ASInt16ToFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16ToFixed), [`ASInt32ToFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32ToFixed) #### ASFixedMul ```cpp ASFixed ASFixedMul(ASFixed a, ASFixed b) ``` Header: `ASProcs.h:503` Multiplies two fixed numbers. **Parameters** - `a` ([`ASFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixed)): The first number to multiply. - `b` ([`ASFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixed)): The second number to multiply. **Returns:** [`ASFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixed) The product of `a` and `b`. **See also:** [`ASFixedDiv`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedDiv), `Fixed Numbers`, [`ASFixedRoundToInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedRoundToInt16), [`ASFixedRoundToInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedRoundToInt32), [`ASFixedTruncToInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedTruncToInt16), [`ASFixedTruncToInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedTruncToInt32), [`ASFixedToFloat`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedToFloat), `ASFloatToFixed`, [`ASInt16ToFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16ToFixed), [`ASInt32ToFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32ToFixed) #### ASFixedToCString ```cpp void ASFixedToCString(ASFixed f, char *s, os_size_t maxLength, ASSmallCount precision) ``` Header: `ASProcs.h:542` Converts a fixed number to a `CString`. **Note:** The precision for Mac OS numbers is valid to 9 significant digits. **Parameters** - `f` ([`ASFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixed)): The fixed number to convert. - `s` (`char *`): (Filled by the method) The string corresponding to `f`. - `maxLength` (`os_size_t`): The maximum number of characters that `s` can contain. - `precision` ([`ASSmallCount`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASSmallCount)): The number of digits to retain in the converted number. **Returns:** `void` **See also:** [`ASCStringToFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCStringToFixed), `Fixed Numbers`, `ASFloatToFixed`, [`ASInt16ToFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16ToFixed), [`ASInt32ToFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32ToFixed) #### ASFixedToFloat ```cpp float ASFixedToFloat(ASFixed inASFixed) ``` Header: `ASProcs.h:2615` Converts an ASFixed to a `float`. **Parameters** - `inASFixed` ([`ASFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixed)): IN The ASFixed value to convert. **Returns:** `float` The `float` representation of the ASFixed value. #### FloatToASFixed ```cpp ASFixed FloatToASFixed(double inFloat) ``` Header: `ASProcs.h:2624` Converts a `float` to an ASFixed value. **Parameters** - `inFloat` (`double`): IN The `float` value to convert. **Returns:** [`ASFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixed) The ASFixed representation of the `float` value. ### Typedefs (2) #### ASFixed ```cpp typedef ASInt32 ASFixed ``` Header: `ASExpT.h:664` The ASFixed type is a 32-bit quantity representing a rational number with the high (low on little-endian machines) 16 bits representing the number's mantissa and the low (high on little-endian machines) 16 bits representing the fractional part. The definition is platform-dependent. ASFixedP is a pointer to an ASFixed object. Addition, subtraction, and negation with ASFixed types can be done with `+` and `-` operators, unless you are concerned with overflow. Overflow in ASFixed-value operations is indicated by the values `fixedPositiveInfinity` and `fixedNegativeInfinity`. **See also:** [`ASFixedDiv`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedDiv), [`ASFixedMatrixConcat`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedMatrixConcat), [`ASFixedMatrixInvert`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedMatrixInvert), [`ASFixedMatrixTransform`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedMatrixTransform), [`ASFixedMatrixTransformRect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedMatrixTransformRect), [`ASFixedMul`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedMul), [`ASFixedToCString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedToCString) #### ASFixedP ```cpp typedef ASInt32 * ASFixedP ``` Header: `ASExpT.h:664` ### Definitions (71) #### ASFixedNegInf Header: `ASExpT.h:674` Value: `ASMINInt32` #### ASFixedPosInf Header: `ASExpT.h:671` Value: `ASMAXInt32` #### ASFixedRectIsEmptyRect Header: `ASExpT.h:1147` Value: `(((r).left == fixedPositiveInfinity && (r).right == fixedNegativeInfinity && \ (r).bottom == fixedPositiveInfinity && (r).top == fixedNegativeInfinity) || \ ((r).left == emptyFixedRect.left && (r).right == emptyFixedRect.right && \ (r).bottom == emptyFixedRect.bottom && (r).top == emptyFixedRect.top))` #### ASFixedRoundToInt16 Header: `ASExpT.h:756` Value: `((ASInt16)(((f) + fixedHalf) >> 16))` Converts a fixed point number to an ASInt16, rounding the result. **See also:** [`ASFixedRoundToInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedRoundToInt32), [`ASFixedToFloat`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedToFloat), [`ASFixedTruncToInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedTruncToInt16), [`ASFixedTruncToInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedTruncToInt32), `ASFloatToFixed`, [`ASInt16ToFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16ToFixed), [`ASInt32ToFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32ToFixed) #### ASFixedRoundToInt32 Header: `ASExpT.h:709` Value: `((ASInt32)(((f) + fixedHalf) >> 16))` Converts a fixed point number to an ASInt32, rounding the result. **See also:** [`ASFixedRoundToInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedRoundToInt16), [`ASFixedToFloat`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedToFloat), [`ASFixedTruncToInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedTruncToInt16), [`ASFixedTruncToInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedTruncToInt32), `ASFloatToFixed`, [`ASInt16ToFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16ToFixed), [`ASInt32ToFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32ToFixed) #### ASFixedTruncToInt16 Header: `ASExpT.h:771` Value: `((ASInt16)((f) >> 16))` Converts a fixed point number to an ASInt16, truncating the result. **See also:** [`ASFixedRoundToInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedRoundToInt16), [`ASFixedRoundToInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedRoundToInt32), [`ASFixedToFloat`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedToFloat), [`ASFixedTruncToInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedTruncToInt32), `ASFloatToFixed`, [`ASInt16ToFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16ToFixed), [`ASInt32ToFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32ToFixed) #### ASFixedTruncToInt32 Header: `ASExpT.h:724` Value: `((ASInt32)((f) >> 16))` Converts a fixed point number to an ASInt32, truncating the result. **See also:** [`ASFixedRoundToInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedRoundToInt16), [`ASFixedRoundToInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedRoundToInt32), [`ASFixedToFloat`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedToFloat), [`ASFixedTruncToInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedTruncToInt16), `ASFloatToFixed`, [`ASInt16ToFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16ToFixed), [`ASInt32ToFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32ToFixed) #### ASInt16ToFixed Header: `ASExpT.h:739` Value: `((ASFixed)(i) * (1 << 16))` Converts an ASInt16 to a fixed point number. **See also:** [`ASFixedRoundToInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedRoundToInt16), [`ASFixedRoundToInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedRoundToInt32), [`ASFixedToFloat`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedToFloat), [`ASFixedTruncToInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedTruncToInt16), [`ASFixedTruncToInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedTruncToInt32), `ASFloatToFixed`, [`ASInt32ToFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32ToFixed) #### ASInt32ToFixed Header: `ASExpT.h:691` Value: `((((ASInt32)i) < (-32767)) ? ASFixedNegInf \ : (((ASInt32)i) > 32767) ? ASFixedPosInf \ : ((ASFixed)(i)*65536))` Converts an ASInt32 to a fixed point number. **See also:** [`ASFixedRoundToInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedRoundToInt16), [`ASFixedRoundToInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedRoundToInt32), [`ASFixedToFloat`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedToFloat), [`ASFixedTruncToInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedTruncToInt16), [`ASFixedTruncToInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixedTruncToInt32), `ASFloatToFixed`, [`ASInt16ToFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16ToFixed) #### ASUns16ToFixed Header: `ASExpT.h:741` Value: `(((i) > 32767) ? ASFixedPosInf : ((ASFixed)(i) << 16))` #### FixedMatrix Header: `CoreExpT.h:254` Value: `..Use.ASFixedMatrix.instead..` #### FixedMatrixP Header: `CoreExpT.h:255` Value: `..Use.ASFixedMatrixP.instead..` #### FixedPointP Header: `CoreExpT.h:250` Value: `..Use.ASFixedPointP.instead..` #### FixedQuad Header: `CoreExpT.h:252` Value: `..Use.ASFixedQuad.instead..` #### FixedQuadP Header: `CoreExpT.h:253` Value: `..Use.ASFixedQuadP.instead..` #### FixedRectP Header: `CoreExpT.h:251` Value: `..Use.ASFixedRectP.instead..` #### FixedRoundToInt16 Header: `ASExpT.h:843` Value: `ASFixedRoundToInt16` #### FixedRoundToInt32 Header: `ASExpT.h:840` Value: `ASFixedRoundToInt32` #### FixedTruncToInt16 Header: `ASExpT.h:844` Value: `ASFixedTruncToInt16` #### FixedTruncToInt32 Header: `ASExpT.h:841` Value: `ASFixedTruncToInt32` #### FloatIToFixed Header: `ASExpT.h:834` Value: `((x) > 32767) ? ASFixedPosInf : (((ASFixed)x) << 16)` FloatI to ASFixed (for use when you know that `float` numbers are integer values). #### FloatNToFixed Header: `ASExpT.h:831` Value: `((x)<(-32767))?ASFixedNegInf:((x)>32767)?ASFixedPosInf:(((ASFixed)(((x)*65536.0f +0.5f)))` FloatN to ASFixed (for use when you know that `float` numbers are non-negative). #### Int16ToFixed Header: `ASExpT.h:842` Value: `ASInt16ToFixed` #### Int32ToFixed Header: `ASExpT.h:839` Value: `ASInt32ToFixed` #### fixedEight Header: `ASExpT.h:989` Value: `((ASFixed)0x00080000L)` #### fixedEighth Header: `ASExpT.h:874` Value: `((ASFixed)0x00002000L)` #### fixedEleven Header: `ASExpT.h:1004` Value: `((ASFixed)0x000B0000L)` #### fixedFifty Header: `ASExpT.h:1024` Value: `((ASFixed)0x00320000L)` #### fixedFive Header: `ASExpT.h:974` Value: `((ASFixed)0x00050000L)` #### fixedFiveHundred Header: `ASExpT.h:1059` Value: `((ASFixed)0x01F40000L)` #### fixedFour Header: `ASExpT.h:969` Value: `((ASFixed)0x00040000L)` #### fixedFourThirds Header: `ASExpT.h:929` Value: `((ASFixed)0x00015555L)` #### fixedGolden Header: `ASExpT.h:954` Value: `((ASFixed)0x00019e37L)` #### fixedHalf Header: `ASExpT.h:889` Value: `((ASFixed)0x00008000L)` #### fixedHundred Header: `ASExpT.h:1039` Value: `((ASFixed)0x00640000L)` #### fixedHundredFifty Header: `ASExpT.h:1044` Value: `((ASFixed)0x00960000L)` #### fixedHundredth Header: `ASExpT.h:854` Value: `((ASFixed)0x0000028FL)` #### fixedNegativeInfinity Header: `ASExpT.h:1074` Value: `ASFixedNegInf` #### fixedNine Header: `ASExpT.h:994` Value: `((ASFixed)0x00090000L)` #### fixedNinety Header: `ASExpT.h:1034` Value: `((ASFixed)0x005a0000L)` #### fixedOne Header: `ASExpT.h:919` Value: `((ASFixed)0x00010000L)` #### fixedOne1 Header: `ASExpT.h:914` Value: `((ASFixed)0x0000ffffL)` #### fixedOneAnd3Qtr Header: `ASExpT.h:944` Value: `((ASFixed)0x0001C000L)` #### fixedOneAndQuarter Header: `ASExpT.h:924` Value: `((ASFixed)0x00014000L)` #### fixedOneEighty Header: `ASExpT.h:1049` Value: `((ASFixed)0x00b40000L)` #### fixedPi2 Header: `ASExpT.h:949` Value: `((ASFixed)0x00019220L)` #### fixedPi4 Header: `ASExpT.h:904` Value: `((ASFixed)0x0000c910L)` #### fixedPositiveInfinity Header: `ASExpT.h:1079` Value: `ASFixedPosInf` #### fixedQuarter Header: `ASExpT.h:879` Value: `((ASFixed)0x00004000L)` #### fixedSeven Header: `ASExpT.h:984` Value: `((ASFixed)0x00070000L)` #### fixedSevenEighths Header: `ASExpT.h:909` Value: `((ASFixed)0x0000E000L)` #### fixedSeventyTwo Header: `ASExpT.h:1029` Value: `((ASFixed)0x00480000L)` #### fixedSix Header: `ASExpT.h:979` Value: `((ASFixed)0x00060000L)` #### fixedSixteen Header: `ASExpT.h:1014` Value: `((ASFixed)0x00100000L)` #### fixedSixteenth Header: `ASExpT.h:859` Value: `((ASFixed)0x00001000L)` #### fixedSqrtTwo Header: `ASExpT.h:934` Value: `((ASFixed)0x00016A0AL)` #### fixedTen Header: `ASExpT.h:999` Value: `((ASFixed)0x000A0000L)` #### fixedTenThousand Header: `ASExpT.h:1069` Value: `((ASFixed)0x27100000L)` #### fixedTenth Header: `ASExpT.h:869` Value: `((ASFixed)0x00001999L)` #### fixedThird Header: `ASExpT.h:884` Value: `((ASFixed)0x00005555L)` #### fixedThirtyTwo Header: `ASExpT.h:1019` Value: `((ASFixed)0x00200000L)` #### fixedThousand Header: `ASExpT.h:1064` Value: `((ASFixed)0x03E80000L)` #### fixedThree Header: `ASExpT.h:964` Value: `((ASFixed)0x00030000L)` #### fixedThreeHalves Header: `ASExpT.h:939` Value: `((ASFixed)0x00018000L)` #### fixedThreeQuarters Header: `ASExpT.h:899` Value: `((ASFixed)0x0000C000L)` #### fixedTwelfth Header: `ASExpT.h:864` Value: `((ASFixed)0x00001555L)` #### fixedTwelve Header: `ASExpT.h:1009` Value: `((ASFixed)0x000C0000L)` #### fixedTwo Header: `ASExpT.h:959` Value: `((ASFixed)0x00020000L)` #### fixedTwoSeventy Header: `ASExpT.h:1054` Value: `((ASFixed)0x010e0000L)` #### fixedTwoThirds Header: `ASExpT.h:894` Value: `((ASFixed)0x0000AAAAL)` #### fixedZero Header: `ASExpT.h:849` Value: `((ASFixed)0x00000000L)` ## ASMem ### Functions (3) #### ASfree ```cpp void ASfree(void *ptr) ``` Header: `ASProcs.h:115` Frees the specified memory block. **Parameters** - `ptr` (`void *`): IN/OUT The block of memory to free. **Returns:** `void` **See also:** [`ASmalloc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASmalloc), [`ASrealloc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASrealloc) #### ASmalloc ```cpp void * ASmalloc(os_size_t nBytes) ``` Header: `ASProcs.h:86` Allocates and returns a pointer to a memory block containing the specified number of bytes. **Parameters** - `nBytes` (`os_size_t`): IN/OUT The number of bytes for which space is allocated. **Returns:** `void *` A pointer to the allocated memory, `NULL` on failure. **See also:** [`ASrealloc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASrealloc), [`ASfree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASfree) #### ASrealloc ```cpp void * ASrealloc(void *ptr, os_size_t newNBytes) ``` Header: `ASProcs.h:105` If possible, extends the given block and simply returns `ptr`. Otherwise, it allocates a new block of `newNBytes` bytes, copies the contents from the old pointer into the new block, frees the old pointer, and returns the pointer to the new block. If a new block cannot be allocated, the call fails and `ptr` is not freed. Reallocating a block to a smaller size will never fail. **Parameters** - `ptr` (`void *`): IN/OUT The existing memory block. - `newNBytes` (`os_size_t`): IN/OUT The number of bytes the memory block must be able to hold. **Returns:** `void *` A pointer to memory block. **See also:** [`ASmalloc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASmalloc), [`ASfree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASfree) ## ASPlatformPath ### Functions (7) #### ASPathFromPlatformPath ```cpp ASPathName ASPathFromPlatformPath(void *platformPath) ``` Header: `ASProcs.h:679` This method was deprecated in Acrobat 5.0. Use ASFileSysCreatePathName() instead. It converts a platform-specific path name to an ASPathName. It can create an ASPathName from a file path where the file does not already exist. It works for Windows UNC path names as well. It is the caller's responsibility to release the returned ASPathName. **Parameters** - `platformPath` (`void *`): A pointer to a platform-specific path name. On Windows and UNIX, it is a `NULL`-terminated string containing the full path name with the appropriate path separators for each platform. **Returns:** [`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName) The ASPathName corresponding to `platformPath`. **See also:** [`ASFileSysReleasePath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysReleasePath) #### ASPlatformPathGetCFURLRefRecPtr ```cpp CFURLRefRec_Ptr ASPlatformPathGetCFURLRefRecPtr(ASPlatformPath path) ``` Header: `ASProcs.h:2387` Gets a platform path object in the form of a CFURLRef for the Mac OS, if the ASPlatformPath object was acquired with this type in the `platformPathType` parameter of ASFileSysAcquirePlatformPath(). **Note:** Do not release the returned value, or any member data of an ASPlatformPath directly; use ASFileSysReleasePlatformPath() when finished with the object. **Parameters** - `path` ([`ASPlatformPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPlatformPath)): The platform path. **Returns:** [`CFURLRefRec_Ptr`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#CFURLRefRec_Ptr) A pointer to a structure containing a CFURLRef. **See also:** [`ASFileSysAcquirePlatformPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysAcquirePlatformPath), [`ASFileSysReleasePlatformPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysReleasePlatformPath) #### ASPlatformPathGetCstringPtr ```cpp Cstring_Ptr ASPlatformPathGetCstringPtr(ASPlatformPath path) ``` Header: `ASProcs.h:2314` Gets a platform path object in the form of a C string for Windows or UNIX, if the ASPlatformPath object was acquired with this type in the `platformPathType` parameter of ASFileSysAcquirePlatformPath(). **Note:** Applications should use this as a read-only pointer; modifying the returned buffer can corrupt the ASPlatformPath. Do not free the pointer. **Note:** Do not release the returned value, or any member data of an ASPlatformPath directly; use ASFileSysReleasePlatformPath() when finished with the object. **Parameters** - `path` ([`ASPlatformPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPlatformPath)): The platform path. **Returns:** [`Cstring_Ptr`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#Cstring_Ptr) A pointer to a C string of a platform-specific path. **See also:** [`ASFileSysAcquirePlatformPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysAcquirePlatformPath), [`ASFileSysReleasePlatformPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysReleasePlatformPath) #### ASPlatformPathGetFSRefPtr ```cpp FSRef_Ptr ASPlatformPathGetFSRefPtr(ASPlatformPath path) ``` Header: `ASProcs.h:2352` Gets a platform path object in the form of an FSRef for the Mac OS, if the ASPlatformPath object was acquired with this type in the `platformPathType` parameter of ASFileSysAcquirePlatformPath(). **Note:** Do not release the returned value, or any member data of an ASPlatformPath directly; use ASFileSysReleasePlatformPath() when finished with the object. **Parameters** - `path` ([`ASPlatformPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPlatformPath)): The platform path. **Returns:** [`FSRef_Ptr`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#FSRef_Ptr) A pointer to an FSRef. **See also:** [`ASFileSysAcquirePlatformPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysAcquirePlatformPath), [`ASPlatformPathGetFSRefWithCFStringRefRecPtr`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPlatformPathGetFSRefWithCFStringRefRecPtr), [`ASFileSysReleasePlatformPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysReleasePlatformPath) #### ASPlatformPathGetFSRefWithCFStringRefRecPtr ```cpp FSRefWithCFStringRefRec_Ptr ASPlatformPathGetFSRefWithCFStringRefRecPtr(ASPlatformPath path) ``` Header: `ASProcs.h:2371` Gets a platform path object in the form of an FSRef and CFStringRef for Mac OS, if the ASPlatformPath object was acquired with this type in the `platformPathType` parameter of ASFileSysAcquirePlatformPath(). **Note:** Do not release the returned value, or any member data of an ASPlatformPath directly; use ASFileSysReleasePlatformPath() when finished with the object. **Parameters** - `path` ([`ASPlatformPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPlatformPath)): The platform path. **Returns:** [`FSRefWithCFStringRefRec_Ptr`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#FSRefWithCFStringRefRec_Ptr) A pointer to a structure containing an FSRef and a CFStringRef. **See also:** [`ASFileSysAcquirePlatformPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysAcquirePlatformPath), [`ASPlatformPathGetFSRefPtr`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPlatformPathGetFSRefPtr), [`ASFileSysReleasePlatformPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysReleasePlatformPath) #### ASPlatformPathGetFSSpecPtr ```cpp FSSpec_Ptr ASPlatformPathGetFSSpecPtr(ASPlatformPath path) ``` Header: `ASProcs.h:2335` This method was deprecated in Acrobat 9.0. Use ASPlatformPathGetFSRefPtr(), ASPlatformPathGetFSRefWithCFStringRefRecPtr(), ASPlatformPathGetCFURLRefRecPtr(), or ASPlatformPathGetPOSIXPathPtr() instead. Gets a platform path object in the form of an FSSpec for the Mac OS, if the ASPlatformPath object was acquired with this type in the `platformPathType` parameter of ASFileSysAcquirePlatformPath(). **Note:** Do not release the returned value, or any member data of an ASPlatformPath directly; use ASFileSysReleasePlatformPath() when finished with the object. **Parameters** - `path` ([`ASPlatformPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPlatformPath)): The platform path. **Returns:** [`FSSpec_Ptr`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#FSSpec_Ptr) A pointer to an FSSpec. **See also:** [`ASFileSysAcquirePlatformPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysAcquirePlatformPath), [`ASPlatformPathGetFSRefPtr`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPlatformPathGetFSRefPtr), [`ASFileSysReleasePlatformPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysReleasePlatformPath) #### ASPlatformPathGetPOSIXPathPtr ```cpp POSIXPath_Ptr ASPlatformPathGetPOSIXPathPtr(ASPlatformPath path) ``` Header: `ASProcs.h:2404` Gets a platform path object in the form of a POSIX path C string, if the ASPlatformPath object was acquired with this type in the `platformPathType` parameter of ASFileSysAcquirePlatformPath(). **Note:** Do not release the returned value, or any member data of an ASPlatformPath directly; use ASFileSysReleasePlatformPath() when finished with the object. **Parameters** - `path` ([`ASPlatformPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPlatformPath)): The platform path. **Returns:** [`POSIXPath_Ptr`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#POSIXPath_Ptr) A pointer to a POSIX path (UTF-8 encoding) as a C string. **See also:** [`ASFileSysAcquirePlatformPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysAcquirePlatformPath), [`ASFileSysReleasePlatformPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysReleasePlatformPath) ### Typedefs (4) #### CFURLRefRec_Ptr ```cpp typedef CFURLRefRecPlacebo * CFURLRefRec_Ptr ``` Header: `ASExpT.h:2225` #### Cstring_Ptr ```cpp typedef char* Cstring_Ptr ``` Header: `ASExpT.h:2177` A UNIX or Windows platform-specific path value. **See also:** [`ASPlatformPathGetCstringPtr`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPlatformPathGetCstringPtr) #### FSRefWithCFStringRefRec_Ptr ```cpp typedef FSRefWithCFStringRefRecPlacebo * FSRefWithCFStringRefRec_Ptr ``` Header: `ASExpT.h:2212` #### POSIXPath_Ptr ```cpp typedef char* POSIXPath_Ptr ``` Header: `ASExpT.h:2182` A C string containing a POSIX path (UTF-8 encoding). **See also:** [`ASPlatformPathGetPOSIXPathPtr`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPlatformPathGetPOSIXPathPtr) ### Structures (3) #### ASPlatformPath ```cpp typedef struct _t_ASPlatformPath* ASPlatformPath ``` Header: `ASExpT.h:2172` An ASPlatformPath and associated platform path types. This is an opaque object used to retrieve a platform path object. ASFileSysAcquirePlatformPath() allocates and initializes this object. `ASPlatformPath*` calls are used to access its contents. To discard this object, call ASFileSysReleasePlatformPath(). #### FSRef_Ptr ```cpp typedef struct FSRefPlacebo * FSRef_Ptr ``` Header: `ASExpT.h:2196` A pointer to a Mac OS platform-specific FSRef. **See also:** [`ASPlatformPathGetFSRefPtr`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPlatformPathGetFSRefPtr) #### FSSpec_Ptr ```cpp typedef struct FSSpecPlacebo * FSSpec_Ptr ``` Header: `ASExpT.h:2190` A pointer to a Mac OS platform-specific FSSpec. **See also:** [`ASPlatformPathGetFSSpecPtr`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPlatformPathGetFSSpecPtr) ## ASStm ### Functions (8) #### ASMemStmRdOpen ```cpp ASStm ASMemStmRdOpen(const char *data, ASArraySize len) ``` Header: `ASProcs.h:1085` Creates a read-only ASStm from a memory-resident buffer. The stream supports seek operations. **Parameters** - `data` (`const char *`): A buffer containing the data to read into the stream. This data buffer must not be disposed of until the ASStm is closed. - `len` ([`ASArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASArraySize)): The length in bytes of `data`. **Returns:** [`ASStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStm) The newly created ASStm. **See also:** [`ASStmRead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStmRead), [`ASStmClose`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStmClose), [`CosNewStream`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewStream), [`ASMemStmRdOpen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASMemStmRdOpen), [`ASProcStmRdOpenEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASProcStmRdOpenEx) #### ASProcStmRdOpen ```cpp ASStm ASProcStmRdOpen(ASStmProc readProc, void *clientData) ``` Header: `ASProcs.h:1106` Creates a read-only ASStm from an arbitrary data-producing procedure. The stream does not support seek operations. `readProc` is called when the client of the stream attempts to read data from it. **Parameters** - `readProc` ([`ASStmProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStmProc)): A user-supplied callback that supplies the stream's data. - `clientData` (`void *`): A pointer to user-supplied data to pass to `readProc` each time it is called. **Returns:** [`ASStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStm) The newly created ASStm. **Exceptions** - `genErrNoMemory` **See also:** [`ASStmRead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStmRead), [`ASStmClose`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStmClose), [`CosNewStream`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewStream), [`ASFileStmRdOpen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileStmRdOpen), [`ASMemStmRdOpen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASMemStmRdOpen) #### ASProcStmRdOpenEx ```cpp ASStm ASProcStmRdOpenEx(ASProcStmRdExHandler handler, void *clientData) ``` Header: `ASProcs.h:2143` Extends ASProcStmRdOpen() and creates a read-only ASStm from an arbitrary data-producing procedure. The stream optionally supports seek operations, although external clients do not have the ability to initiate a seek operation. The supplied handlers are called when the client of the stream attempts to read data from it, seek it, or find it's length, as well as when the client closes it. **Parameters** - `handler` (`ASProcStmRdExHandler`): A structure containing user-supplied callbacks that supply the stream's data and destroy the stream. - `clientData` (`void *`): A pointer to user-supplied data to pass to the procedures each time they are called. **Returns:** [`ASStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStm) The newly created ASStm. **Exceptions** - `genErrNoMemory` **See also:** [`ASProcStmRdOpen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASProcStmRdOpen), [`ASStmClose`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStmClose), [`ASStmRead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStmRead) #### ASProcStmWrOpen ```cpp ASStm ASProcStmWrOpen(ASStmProc writeProc, ASProcStmDestroyProc destroyProc, void *clientData) ``` Header: `ASProcs.h:1536` Creates an ASStm from an arbitrary data-producing procedure. The stream does not support seek operations. **Parameters** - `writeProc` ([`ASStmProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStmProc)): A user-supplied callback that provides the data for the stream. - `destroyProc` ([`ASProcStmDestroyProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASProcStmDestroyProc)): A user-supplied callback that destroys the specified ASStm. (Generally, this means deallocating the memory associated with the ASStm.) - `clientData` (`void *`): A pointer to user-supplied data to pass to `writeProc` each time it is called. **Returns:** [`ASStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStm) The newly created ASStm. **Exceptions** - `genErrNoMemory` **See also:** [`ASFileStmRdOpen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileStmRdOpen), [`ASFileStmWrOpen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileStmWrOpen), [`ASMemStmRdOpen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASMemStmRdOpen), [`ASProcStmRdOpenEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASProcStmRdOpenEx), [`ASStmWrite`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStmWrite), [`ASStmRead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStmRead), [`ASStmClose`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStmClose), [`CosNewStream`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewStream) #### ASStmClose ```cpp void ASStmClose(ASStm stm) ``` Header: `ASProcs.h:1166` Closes the specified stream. **Parameters** - `stm` ([`ASStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStm)): The stream to close. **Returns:** `void` **See also:** [`ASFileStmRdOpen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileStmRdOpen), [`ASFileStmWrOpen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileStmWrOpen), [`ASMemStmRdOpen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASMemStmRdOpen), [`ASProcStmRdOpenEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASProcStmRdOpenEx) #### ASStmFlush ```cpp ASTCount ASStmFlush(ASStm stm) ``` Header: `ASProcs.h:2450` Flushes any buffered data to the specified stream. **Parameters** - `stm` ([`ASStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStm)): The stream to flush. **Returns:** [`ASTCount`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTCount) `0` if successful, non-zero otherwise. **See also:** [`ASStmClose`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStmClose) #### ASStmRead ```cpp ASTCount ASStmRead(char *ptr, ASTArraySize itemSize, ASTCount nItems, ASStm stm) ``` Header: `ASProcs.h:1125` Reads data from `stm` into memory. **Parameters** - `ptr` (`char *`): (Filled by the method) A buffer into which data is written. - `itemSize` ([`ASTArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize)): The number of bytes in a stream item. See the description of `nItems` for further information. - `nItems` ([`ASTCount`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTCount)): The number of items to read. The amount of data read into the memory buffer will be `itemSize * nItems`, unless an EOF is encountered first. The relative values of `itemSize` and `nItems` really do not matter; the only thing that matters is their product. It is often convenient to set `itemSize` to `1`, so that `nItems` is the number of bytes to read. - `stm` ([`ASStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStm)): The stream from which data is read. **Returns:** [`ASTCount`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTCount) The number of items (not bytes) read. **See also:** [`ASStmWrite`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStmWrite) #### ASStmWrite ```cpp ASTCount ASStmWrite(const char *ptr, ASTArraySize itemSize, ASTCount nItems, ASStm stm) ``` Header: `ASProcs.h:1155` Writes data from a memory buffer into an ASStm. You cannot use this method to change a PDF page content stream. It can only be used for a print stream. . Historically, this method was provided to allow plug-ins to write data into the print stream when printing to a PostScript printer (see the PDDocWillPrintPage() notification). However, ASStm is a general purpose I/O mechanism in Acrobat even though only limited open and read/write methods are provided in the plug-in API. For instance, not all ASStm objects support seek operations. **Parameters** - `ptr` (`const char *`): A buffer from which data is read. - `itemSize` ([`ASTArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize)): The number of bytes in a stream item. See the description of `nItems` for additional information. - `nItems` ([`ASTCount`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTCount)): The number of items to write. The amount of data written into the stream will be `itemSize * nItems`. The relative values of `itemSize` and `nItems` really do not matter; the only thing that matters is their product. It is often convenient to set `itemSize` to `1`, so that `nItems` is the number of bytes to read. - `stm` ([`ASStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStm)): The stream into which data is written. **Returns:** [`ASTCount`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTCount) The number of items (not bytes) written. **See also:** [`ASStmRead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStmRead) ### Typedefs (5) #### ASSmallBufferSize ```cpp typedef ASUns16 ASSmallBufferSize ``` Header: `ASExpT.h:174` May not be larger than `int16`. #### ASProcStmDestroyProc ```cpp typedef void(*) ASProcStmDestroyProc(void *clientData)(void *clientData) ``` Header: `ASExpT.h:533` A callback for use by ASProcStmWrOpen() and ASProcStmRdOpenEx(). This is called at the end of the stream so you can do clean up and free allocated memory. **See also:** [`ASStmProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStmProc), [`ASProcStmWrOpen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASProcStmWrOpen), [`ASProcStmRdOpenEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASProcStmRdOpenEx) #### ASProcStmGetLength ```cpp typedef ASFilePos64(*) ASProcStmGetLength(void *clientData)(void *clientData) ``` Header: `ASExpT.h:564` A callback for use by ASProcStmRdOpenEx(). This is called to get the length of the stream, which may be `NULL` if the stream cannot be set to a new position. ASProcStmSeekProc() and ASProcStmGetLength() must be provided together. If either is `NULL`, the stream will not be set to a new position. **Parameters** - `clientData`: IN/OUT User-supplied data that was passed in the call to ASProcStmRdOpenEx(). **Returns:** The length of the stream in bytes. **See also:** [`ASStmProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStmProc), [`ASProcStmRdOpenEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASProcStmRdOpenEx) #### ASProcStmSeekProc ```cpp typedef void(*) ASProcStmSeekProc(ASFilePos64 newPos, void *clientData)(ASFilePos64 newPos, void *clientData) ``` Header: `ASExpT.h:549` A callback for use by ASProcStmRdOpenEx(). This is called to set the stream position to a new location, which may be `NULL` if the stream cannot be set to a new position. ASProcStmSeekProc() and ASProcStmGetLength() must be provided together. If either is `NULL`, the stream will not be set to a new position. **Parameters** - `newPos`: IN - `clientData`: IN/OUT User-supplied data that was passed in the call to ASProcStmRdOpenEx(). **See also:** [`ASStmProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStmProc), [`ASProcStmRdOpenEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASProcStmRdOpenEx) #### ASStmProc ```cpp typedef ASTCount(*) ASStmProc(char *data, ASTArraySize nData, void *clientData)(char *data, ASTArraySize nData, void *clientData) ``` Header: `ASExpT.h:519` A callback for use by ASProcStmRdOpenEx() and ASProcStmWrOpen(). This should place data in the buffer specified by the parameter data. If your procedure reads data from a file, it is generally quite inefficient to open the file, read the bytes, and close the file each time bytes are requested. Instead, consider opening the file the first time bytes are requested from it, reading the entire file into a secondary buffer, and closing the file. When subsequent requests for data from the file are received, simply copy data from the secondary buffer, rather than reopening the file. **See also:** [`ASProcStmDestroyProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASProcStmDestroyProc), [`ASProcStmRdOpenEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASProcStmRdOpenEx), [`ASProcStmWrOpen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASProcStmWrOpen) ### Structures (2) #### ASStm ```cpp typedef struct _t_ASStmRec * ASStm ``` Header: `ASExpT.h:305` #### ASStmRec ```cpp typedef struct _t_ASStmRec ASStmRec ``` Header: `ASExpT.h:305` A stream object definition (see ASStream.h). It is a data stream that may be a buffer in memory, a file, or an arbitrary user-written procedure. It is typically used to extract data from a PDF file. When writing or extracting data streams, the ASStm must be connected to a Cos stream. **See also:** [`ASFileStmRdOpen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileStmRdOpen), [`ASFileStmWrOpen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileStmWrOpen), [`ASMemStmRdOpen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASMemStmRdOpen), [`ASProcStmRdOpen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASProcStmRdOpen), [`CosStreamOpenStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosStreamOpenStm), [`ASStmClose`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStmClose) ## ASText ### Functions (53) #### ASHostMBLen ```cpp ASInt32 ASHostMBLen(ASHostEncoding encoding, ASUns8 byte) ``` Header: `ASProcs.h:2040` Determines whether the given byte is a lead byte of a multi-byte character, and how many tail bytes follow. When parsing a string in a host encoding, you must keep in mind that the string could be in a variable length multi-byte encoding. In such an encoding (for example, Shift-JIS) the number of bytes required to represent a character varies on a character-by-character basis. To parse such a string you must start at the beginning and, for each byte, determine whether that byte represents a character or is the first byte of a multi-byte character. If the byte is a lead byte for a multi-byte character, you must also compute how many bytes will follow the lead byte to make up the entire character. Currently the API provides a call (PDHostMBLen()) that performs these computations, but only if the encoding in question is the operating system encoding (as returned by PDGetHostEncoding()). ASHostMBLen() allows you to determine this for any byte in any host encoding. **Note:** ASHostMBLen() cannot confirm whether the required number of trailing bytes actually follow the first byte. If you are parsing a multi-byte string, make sure your code will stop at the first `NULL` (zero) byte even if it appears immediately after the lead byte of a multi-byte character. **Parameters** - `encoding` ([`ASHostEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASHostEncoding)): The host encoding type. - `byte` ([`ASUns8`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns8)): The first byte of a multi-byte character. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The number of additional bytes required to form the character. For example, if the encoding is a double-byte encoding, the return value will be `1` for a two-byte character and `0` for a one-byte character. For Roman encodings, the return value will always be `0`. **See also:** [`PDGetHostEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDGetHostEncoding), [`PDHostMBLen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDHostMBLen) #### ASIsValidUTF8 ```cpp ASBool ASIsValidUTF8(const ASUns8 *cIn, ASCount cInLen) ``` Header: `ASExtraProcs.h:2295` Tests whether the bytes in the string conform to the Unicode UTF-8 encoding form. The method does not test whether the string is `NULL`-terminated. **Parameters** - `cIn` ([`const ASUns8 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns8)): The string. - `cInLen` ([`ASCount`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCount)): The length of the string in bytes, not including the `NULL` byte at the end. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the bytes in the string conform to the Unicode UTF-8 encoding form, `false` otherwise. #### ASScriptFromHostEncoding ```cpp ASScript ASScriptFromHostEncoding(ASHostEncoding osScript) ``` Header: `ASExtraProcs.h:56` Converts from a host encoding type to an ASScript value. On Windows, the host encoding is a `CHARSET id`. On Mac OS, the host encoding is a script code. **Parameters** - `osScript` ([`ASHostEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASHostEncoding)): The host encoding type. **Returns:** [`ASScript`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASScript) The new ASScript value. **See also:** [`ASScriptToHostEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASScriptToHostEncoding) #### ASScriptToHostEncoding ```cpp ASHostEncoding ASScriptToHostEncoding(ASScript asScript) ``` Header: `ASExtraProcs.h:45` Converts from an ASScript code to a host encoding type. On Windows, the host encoding is a `CHARSET id`. On Mac OS, the host encoding is a script code. **Parameters** - `asScript` ([`ASScript`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASScript)): The script value. **Returns:** [`ASHostEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASHostEncoding) The new host encoding type. **See also:** [`ASScriptFromHostEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASScriptFromHostEncoding) #### ASTextCaseSensitiveCmp ```cpp ASInt32 ASTextCaseSensitiveCmp(ASConstText str1, ASConstText str2) ``` Header: `ASExtraProcs.h:2310` Compares two ASConstText objects, ignoring language and country information. The comparison is case-sensitive. Various exceptions may be raised. **Parameters** - `str1` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): First text object. - `str2` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): Second text object. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) Returns a negative number if `str1 < str2`, a positive number if `str1 > str2`, and `0` if they are equal. **See also:** [`ASTextCmp`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextCmp) #### ASTextCat ```cpp void ASTextCat(ASText to, ASConstText from) ``` Header: `ASExtraProcs.h:558` Concatenates the `from` text to the end of the `to` text, altering `to` but not `from`. It does not change the language or country of `to` unless it has no language or country, in which case it acquires the language and country of `from`. **Parameters** - `to` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): IN/OUT The encoded text to which `from` is appended. - `from` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): IN/OUT The encoded text to be appended to `to`. **Returns:** `void` #### ASTextCatMany ```cpp void ASTextCatMany(ASText to,...) ``` Header: `ASExtraProcs.h:571` Concatenates a series of ASText objects to the end of the `to` object. Be sure to provide `NULL` as the last argument to the call. Various exceptions may be raised. **Parameters** - `to` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): IN/OUT The ASText object to which the subsequent ASText arguments are concatenated. - (unnamed) (`...`) **Returns:** `void` #### ASTextCmp ```cpp ASInt32 ASTextCmp(ASConstText str1, ASConstText str2) ``` Header: `ASExtraProcs.h:613` Compares two ASText objects. This routine can be used to sort text objects using the default collating rules of the underlying operating system before presenting them to the user. The comparison is case-sensitive. The results are suitable for displaying a sorted list of strings to the user in his chosen language and according to the rules of the platform on which the application is running. The results can vary based on the platform and user locale. If you want to compare strings in a way that is consistent across locales and platforms (but not suitable for displaying sorted strings to a user) see ASTextCaseSensitiveCmp(). Various exceptions may be raised. **Parameters** - `str1` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): The first text object. - `str2` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): The second text object. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) A negative number if `str1 < str2`, a positive number if `str1 > str2`, and `0` if they are equal. **See also:** [`ASTextCaseSensitiveCmp`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextCaseSensitiveCmp) #### ASTextCopy ```cpp void ASTextCopy(ASText to, ASConstText from) ``` Header: `ASExtraProcs.h:580` Copies the text in `from` to `to`, along with the country and language. **Parameters** - `to` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): IN/OUT The destination text object. - `from` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): IN/OUT The source text object. **Returns:** `void` #### ASTextDestroy ```cpp void ASTextDestroy(ASText str) ``` Header: `ASExtraProcs.h:214` Frees all memory associated with the text object. **Parameters** - `str` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): IN/OUT A text object. **Returns:** `void` #### ASTextDup ```cpp ASText ASTextDup(ASConstText str) ``` Header: `ASExtraProcs.h:590` Creates a new ASText object that contains the same text/country/language as the one passed in. **Parameters** - `str` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): A text object. **Returns:** [`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText) An ASText object. **Exceptions** - `genErrBadParm`: is raised if `str` is `NULL`. #### ASTextEval ```cpp void ASTextEval(ASText theText, ASCab params) ``` Header: `ASExtraProcs.h:2123` Replaces percent-quoted expressions in the text object with the result of their evaluation, using key/value pairs in the ASCab. For example, for a text value containing the string `"%keyone%%keytwo%"`, the value is replaced with the concatenation of the values of the keys `keyone` and `keytwo` in the ASCab passed in. **Parameters** - `theText` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): A text object containing percent-quoted expressions to replace. - `params` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)): The ASCab containing the key/value pairs to use for text replacement. **Returns:** `void` None. **Exceptions** - `genErrBadParm`: if `theText` is `NULL`. #### ASTextFilter ```cpp void ASTextFilter(ASText text, ASTextFilterType filter) ``` Header: `ASExtraProcs.h:2347` Runs the specified filter on a text object, modifying the text as specified. **Parameters** - `text` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): A text object modified by the method. - `filter` ([`ASTextFilterType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextFilterType)): The filter to run on the text object. **Returns:** `void` **Exceptions** - `genErrBadParm`: if `text` is `NULL` or if an invalid filter is specified. #### ASTextFromEncoded ```cpp ASText ASTextFromEncoded(const char *str, ASHostEncoding encoding) ``` Header: `ASExtraProcs.h:134` Creates a new text object from a `NULL`-terminated multi-byte string in the specified host encoding. **Parameters** - `str` (`const char *`): The input string. - `encoding` ([`ASHostEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASHostEncoding)): The host encoding. **Returns:** [`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText) An ASText object. **See also:** [`ASTextFromSizedEncoded`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextFromSizedEncoded) #### ASTextFromInt32 ```cpp ASText ASTextFromInt32(ASInt32 num) ``` Header: `ASExtraProcs.h:1558` Creates a new string from an ASInt32 by converting the number to its decimal representation without punctuation or leading zeros. **Parameters** - `num` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): A number of type ASInt32. **Returns:** [`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText) An ASText object. **See also:** [`ASTextFromUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextFromUns32) #### ASTextFromPDText ```cpp ASText ASTextFromPDText(const char *str) ``` Header: `ASExtraProcs.h:190` Creates a new string from some PDF text taken out of a PDF file. This is either a UTF-16 string with the `0xFEFF` prepended to the front or a PDFDocEncoding string. In either case the string is expected to have the appropriate `NULL` termination. If the PDText is in UTF-16, it may have embedded language and country information; this will cause the ASText object to have its language and country codes set to the values found in the string. **Parameters** - `str` (`const char *`): A string. **Returns:** [`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText) An ASText object. **See also:** [`ASTextFromSizedPDText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextFromSizedPDText) #### ASTextFromScriptText ```cpp ASText ASTextFromScriptText(const char *str, ASScript script) ``` Header: `ASExtraProcs.h:160` Creates a new string from a `NULL`-terminated multi-byte string of the specified script. This is a wrapper around ASTextFromEncoded(); the script is converted to a host encoding using ASScriptToHostEncoding(). **Parameters** - `str` (`const char *`): A string. - `script` ([`ASScript`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASScript)): The specified script. **Returns:** [`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText) An ASText object. **See also:** [`ASTextFromSizedScriptText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextFromSizedScriptText) #### ASTextFromSizedEncoded ```cpp ASText ASTextFromSizedEncoded(const char *str, ASTArraySize len, ASHostEncoding encoding) ``` Header: `ASExtraProcs.h:147` Creates a new text object from a multi-byte string of the specified length in the specified host encoding. **Parameters** - `str` (`const char *`): A string. - `len` ([`ASTArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize)): The length in bytes. - `encoding` ([`ASHostEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASHostEncoding)): The specified host encoding. **Returns:** [`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText) An ASText object. **Exceptions** - `genErrBadParm`: is raised if `len < 0`. **See also:** [`ASTextFromEncoded`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextFromEncoded) #### ASTextFromSizedPDText ```cpp ASText ASTextFromSizedPDText(const char *str, ASTArraySize length) ``` Header: `ASExtraProcs.h:207` Creates a new string from some PDF text taken out of a PDF file. This is either a UTF-16 string with the `0xFEFF` prepended to the front or a PDFDocEncoding string. If the PDText is in UTF-16, it may have embedded language and country information; this will cause the ASText object to have its language and country codes set to the values found in the string. The `length` parameter specifies the size, in bytes, of the string. The string must not contain embedded `NULL` characters. **Parameters** - `str` (`const char *`): A string. - `length` ([`ASTArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize)): The length in bytes. **Returns:** [`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText) An ASText object. **See also:** [`ASTextFromPDText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextFromPDText) #### ASTextFromSizedScriptText ```cpp ASText ASTextFromSizedScriptText(const char *str, ASTArraySize len, ASScript script) ``` Header: `ASExtraProcs.h:174` Creates a new text object from the specified multi-byte string of the specified script. This is a wrapper around ASTextFromEncoded(); the script is converted to a host encoding using ASScriptToHostEncoding(). **Parameters** - `str` (`const char *`): A string. - `len` ([`ASTArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize)): The length in bytes. - `script` ([`ASScript`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASScript)): The specified script. **Returns:** [`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText) An ASText object. **See also:** [`ASTextFromScriptText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextFromScriptText) #### ASTextFromSizedUnicode ```cpp ASText ASTextFromSizedUnicode(const ASUTF16Val *ucs, ASUnicodeFormat format, ASTArraySize len) ``` Header: `ASExtraProcs.h:123` Creates a new text object from the specified Unicode string. This string is not expected to have `0xFE 0xFF` prepended, or country/language identifiers. The string cannot contain an embedded `NULL` character. **Parameters** - `ucs` ([`const ASUTF16Val *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUTF16Val)): The Unicode string - `format` ([`ASUnicodeFormat`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUnicodeFormat)): The Unicode format of `ucs`. - `len` ([`ASTArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize)): The length of `ucs` in bytes. **Returns:** [`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText) An ASText object. **Exceptions** - `genErrBadParm`: is raised if `len < 0`. **See also:** [`ASTextFromUnicode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextFromUnicode) #### ASTextFromUnicode ```cpp ASText ASTextFromUnicode(const ASUTF16Val *ucs, ASUnicodeFormat format) ``` Header: `ASExtraProcs.h:106` Creates a new string from a `NULL`-terminated Unicode string. This string is not expected to have `0xFE 0xFF` prepended, or country/language identifiers. **Parameters** - `ucs` ([`const ASUTF16Val *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUTF16Val)): A Unicode string. - `format` ([`ASUnicodeFormat`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUnicodeFormat)): The Unicode format used by `ucs`. **Returns:** [`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText) An ASText object. **See also:** [`ASTextFromSizedUnicode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextFromSizedUnicode) #### ASTextFromUns32 ```cpp ASText ASTextFromUns32(ASUns32 num) ``` Header: `ASExtraProcs.h:1569` Creates a new string from an ASUns32 by converting it to a decimal representation without punctuation or leading zeros. **Parameters** - `num` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): IN/OUT A value of type ASUns32. **Returns:** [`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText) An ASText object. **See also:** [`ASTextFromInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextFromInt32) #### ASTextGetBestEncoding ```cpp ASHostEncoding ASTextGetBestEncoding(ASConstText str, ASHostEncoding preferredEncoding) ``` Header: `ASExtraProcs.h:491` Returns the best host encoding for representing the text. The best host encoding is the one that is least likely to lose characters during the conversion from Unicode to host. If the string can be represented accurately in multiple encodings (for example, it is low-ASCII text that can be correctly represented in any host encoding), ASTextGetBestEncoding() returns the preferred encoding based on the `preferredEncoding` parameter. Various exceptions may be raised. **Example** `// If you prefer to use the application's language encoding:` `ASHostEncoding bestEncoding = ASTextGetBestEncoding(text, AVAppGetLanguageEncoding());` `// If you prefer to use the operating system encoding:` `ASHostEncoding bestEncoding = ASTextGetBestEncoding(text, (ASHostEncoding)PDGetHostEncoding());` `// If you want to favor Roman encodings:` `ASHostEncoding hostRoman = ASScriptToHostEncoding(kASRomanScript);` `ASHostEncoding bestEncoding = ASTextGetBestEncoding(text, hostRoman);` **Parameters** - `str` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): An ASText string. - `preferredEncoding` ([`ASHostEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASHostEncoding)): The preferred encoding. There is no default. **Returns:** [`ASHostEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASHostEncoding) The text encoding. **See also:** [`ASTextGetBestScript`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextGetBestScript) #### ASTextGetBestScript ```cpp ASScript ASTextGetBestScript(ASConstText str, ASScript preferredScript) ``` Header: `ASExtraProcs.h:505` Returns the best host script for representing the text. The functionality is similar to ASTextGetBestEncoding(), with resulting host encoding converted to a script code using ASScriptFromHostEncoding(). **Parameters** - `str` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): IN/OUT An ASText string. - `preferredScript` ([`ASScript`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASScript)): IN/OUT The preferred host script. There is no default. **Returns:** [`ASScript`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASScript) The best host script. **See also:** [`ASTextGetBestEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextGetBestEncoding) #### ASTextGetCountry ```cpp ASCountryCode ASTextGetCountry(ASConstText text) ``` Header: `ASExtraProcs.h:515` Retrieves the country associated with an ASText object. **Parameters** - `text` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): IN/OUT An ASText object. **Returns:** [`ASCountryCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCountryCode) The country code. **See also:** [`ASTextSetCountry`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextSetCountry) #### ASTextGetEncoded ```cpp const char * ASTextGetEncoded(ASConstText str, ASHostEncoding encoding) ``` Header: `ASExtraProcs.h:387` Returns a `NULL`-terminated string in the given encoding. The memory to which this string points is owned by the ASText object and may not be valid after additional operations are performed on the object. Various exceptions may be raised. **Parameters** - `str` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): IN/OUT An ASText object. - `encoding` ([`ASHostEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASHostEncoding)): IN/OUT The specified host encoding. **Returns:** `const char *` A pointer to a `NULL`-terminated string corresponding to the text in `str`. **See also:** [`ASTextGetEncodedCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextGetEncodedCopy) #### ASTextGetEncodedCopy ```cpp char * ASTextGetEncodedCopy(ASConstText str, ASHostEncoding encoding) ``` Header: `ASExtraProcs.h:401` Returns a copy of a string in a specified encoding. **Parameters** - `str` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): An ASText object. - `encoding` ([`ASHostEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASHostEncoding)): The specified encoding. **Returns:** `char *` A copy of the text in `str`. The client owns the resulting information and is responsible for freeing it using ASfree(). **Exceptions** - `genErrNoMemory`: is raised if memory could not be allocated for the copy. **See also:** [`ASTextGetEncoded`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextGetEncoded) #### ASTextGetLanguage ```cpp ASLanguageCode ASTextGetLanguage(ASConstText text) ``` Header: `ASExtraProcs.h:537` Retrieves the language code associated with an ASText object. **Parameters** - `text` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): An ASText object. **Returns:** [`ASLanguageCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASLanguageCode) The language code. **See also:** [`ASTextSetLanguage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextSetLanguage) #### ASTextGetPDTextCopy ```cpp char * ASTextGetPDTextCopy(ASConstText str, ASTArraySize *len) ``` Header: `ASExtraProcs.h:460` Returns the text in a form suitable for storage in a PDF file. If the text can be represented using PDFDocEncoding, it is; otherwise it is represented in big-endian UTF-16 format with `0xFE 0xFF` prepended to the front and any country/language codes embedded in an escape sequence right after `0xFE 0xFF`. You can determine if the string is Unicode by inspecting the first two bytes. The Unicode case is used if the string has a language and country code set. The resulting string is `NULL`-terminated as appropriate. That is, one `NULL` byte is used for PDFDocEncoding, two are used for UTF-16. Various exceptions may be raised. **Parameters** - `str` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): A string. - `len` ([`ASTArraySize *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize)): The length in bytes of the resulting string, not counting the `NULL` bytes at the end. **Returns:** `char *` A string copy. The client owns the resulting information and is responsible for freeing it with ASfree(). #### ASTextGetScriptText ```cpp const char * ASTextGetScriptText(ASConstText str, ASScript script) ``` Header: `ASExtraProcs.h:419` Converts the Unicode string in the ASText object to the appropriate script, and returns a pointer to the converted text. The memory to which it points is owned by the ASText object and must not be altered or destroyed by the client. The memory may also become invalid after subsequent operations are applied to the ASText object. Various exceptions may be raised. **Parameters** - `str` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): IN/OUT A string. - `script` ([`ASScript`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASScript)): IN/OUT The writing script. **Returns:** `const char *` A string. **See also:** [`ASTextGetScriptTextCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextGetScriptTextCopy) #### ASTextGetScriptTextCopy ```cpp char * ASTextGetScriptTextCopy(ASConstText str, ASScript script) ``` Header: `ASExtraProcs.h:436` Converts the Unicode string in the ASText object to the appropriate script and returns a pointer to the converted text. The memory to which it points is owned by the client, which is responsible for freeing it using ASfree(). **Parameters** - `str` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): A string. - `script` ([`ASScript`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASScript)): A writing script. **Returns:** `char *` A string copy. The client owns the resulting information. **Exceptions** - `genErrNoMemory`: is raised if memory could not be allocated for the copy. **See also:** [`ASTextGetEncodedCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextGetEncodedCopy), [`ASTextGetScriptText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextGetScriptText) #### ASTextGetUnicode ```cpp const ASUTF16Val * ASTextGetUnicode(ASConstText str) ``` Header: `ASExtraProcs.h:350` Returns a pointer to a string in kUTF16HostEndian format (see ASUnicodeFormat). The memory to which this string points is owned by the ASText object, and may not be valid after additional operations are performed on the object. The Unicode text returned will not have `0xFE 0xFF` prepended or any language or country codes. **Parameters** - `str` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): A string. **Returns:** [`const ASUTF16Val *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUTF16Val) See above. **See also:** [`ASTextGetUnicodeCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextGetUnicodeCopy) #### ASTextGetUnicodeCopy ```cpp ASUTF16Val * ASTextGetUnicodeCopy(ASConstText str, ASUnicodeFormat format) ``` Header: `ASExtraProcs.h:370` Returns a pointer to a `NULL`-terminated string in the specified Unicode format. The memory to which this string points is owned by the client, which can modify it at will and is responsible for destroying it using ASfree. The Unicode text returned will not have `0xFE 0xFF` prepended or any language or country codes. **Parameters** - `str` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): A string. - `format` ([`ASUnicodeFormat`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUnicodeFormat)): The Unicode format. **Returns:** [`ASUTF16Val *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUTF16Val) A string copy. The client owns the resulting information. **Exceptions** - `genErrNoMemory`: is raised if memory could not be allocated for the copy. **See also:** [`ASTextGetUnicode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextGetUnicode) #### ASTextIsEmpty ```cpp ASBool ASTextIsEmpty(ASConstText str) ``` Header: `ASExtraProcs.h:1537` Used to determine whether the ASText object contains no text. For example, it determines if retrieving Unicode text would yield a `0`-length string. **Parameters** - `str` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): A string. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) Returns `true` if the ASText object contains no text. #### ASTextMakeEmpty ```cpp void ASTextMakeEmpty(ASText str) ``` Header: `ASExtraProcs.h:1576` Removes the contents of an ASText (turns it into an empty string). **Parameters** - `str` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)) **Returns:** `void` #### ASTextMakeEmptyClear ```cpp void ASTextMakeEmptyClear(ASText str) ``` Header: `ASExtraProcs.h:2423` Removes the contents of an `ASText` object (converts it into an empty string). It clears the released storage (for security strings). **Parameters** - `str` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)) **Returns:** `void` #### ASTextNew ```cpp ASText ASTextNew(void) ``` Header: `ASExtraProcs.h:94` Creates a new text object containing no text. **Parameters** - (unnamed) (`void`) **Returns:** [`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText) An ASText object. **Exceptions** - `genErrNoMemory` #### ASTextNormalizeEndOfLine ```cpp void ASTextNormalizeEndOfLine(ASText text) ``` Header: `ASExtraProcs.h:1547` Replaces all end-of-line characters within the ASText object with the correct end-of-line character for the current platform. For example, on Windows, `\r` and `\n` are replaced with `\r\n`. **Parameters** - `text` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): An object of type ASText. **Returns:** `void` #### ASTextReplace ```cpp void ASTextReplace(ASText src, ASConstText toReplace, ASConstText replacement) ``` Header: `ASExtraProcs.h:630` Replaces all occurrences of `toReplace` in `src` with the text specified in `replacement`. This uses an ASText string to indicate the `toReplace` string; ASTextReplaceASCII() uses a low ASCII Roman string to indicate the text to replace. Various exceptions may be raised. **Parameters** - `src` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): Source text. - `toReplace` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): Text in source text to replace. - `replacement` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): Text used in replacement. **Returns:** `void` **See also:** [`ASTextReplaceASCII`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextReplaceASCII), [`ASTextReplaceBadChars`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextReplaceBadChars) #### ASTextReplaceASCII ```cpp void ASTextReplaceASCII(ASText src, const char *toReplace, ASConstText replacement) ``` Header: `ASExtraProcs.h:653` Replaces all occurrences of `toReplace` in `src` with the text specified in `replacement`. ASTextReplace() uses an ASText string to indicate the toReplace string; this uses a low-ASCII Roman string to indicate the text to replace. This call is intended for formatting strings for the user interface. For example, it can be used for replacing a known sequence such as `'%1'` with other text. Be sure to use only low ASCII characters, which are safe on all platforms. Avoid using backslash and currency symbols. Various exceptions may be raised. **Parameters** - `src` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): The ASText object containing the text. - `toReplace` (`const char *`): The text to replace. - `replacement` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): The replacement text. **Returns:** `void` **See also:** [`ASTextReplace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextReplace), [`ASTextReplaceBadChars`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextReplaceBadChars) #### ASTextReplaceBadChars ```cpp void ASTextReplaceBadChars(ASText str, const char *pszBadCharList, char replaceChar) ``` Header: `ASExtraProcs.h:1595` Replaces all occurrences of characters contained in the list `pszBadCharList` in the text with the specified replacement character. Various exceptions may be raised. **Parameters** - `str` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): The text in which to replace characters. - `pszBadCharList` (`const char *`): A list of characters to replace, in sorted order with no duplicates. - `replaceChar` (`char`): The character with which to replace any character appearing in the list. **Returns:** `void` **See also:** [`ASTextReplace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextReplace), [`ASTextReplaceASCII`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextReplaceASCII) #### ASTextSetCountry ```cpp void ASTextSetCountry(ASText text, ASCountryCode country) ``` Header: `ASExtraProcs.h:528` Sets the language codes associated with a piece of text. ASText objects can have country and language codes associated with them. These can be explicitly set or parsed from the Unicode form of PDText strings. **Parameters** - `text` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): IN/OUT An ASText object. - `country` ([`ASCountryCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCountryCode)): IN/OUT Country code. **Returns:** `void` **See also:** [`ASTextGetCountry`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextGetCountry) #### ASTextSetEncoded ```cpp void ASTextSetEncoded(ASText str, const char *text, ASHostEncoding encoding) ``` Header: `ASExtraProcs.h:256` Replaces the contents of an existing ASText object with a `NULL`-terminated multi-byte string in the specified host encoding. **Parameters** - `str` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): IN/OUT An ASText object to hold the string. - `text` (`const char *`): IN/OUT A pointer to the text string. - `encoding` ([`ASHostEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASHostEncoding)): IN/OUT The type of encoding. **Returns:** `void` **Exceptions** - `genErrBadParm`: is raised if `text` is `NULL`. **See also:** [`ASTextSetSizedEncoded`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextSetSizedEncoded) #### ASTextSetLanguage ```cpp void ASTextSetLanguage(ASText text, ASLanguageCode language) ``` Header: `ASExtraProcs.h:547` Sets the language codes associated with a piece of text. **Parameters** - `text` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): IN/OUT An ASText object. - `language` ([`ASLanguageCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASLanguageCode)): IN/OUT The language code. **Returns:** `void` **See also:** [`ASTextGetLanguage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextGetLanguage) #### ASTextSetPDText ```cpp void ASTextSetPDText(ASText str, const char *text) ``` Header: `ASExtraProcs.h:315` Alters an existing string from some PDF text taken out of a PDF file. This is either a big-endian UTF-16 string with the `0xFEFF` prepended to the front or a PDFDocEncoding string. In either case the string is expected to have the appropriate `NULL` termination. If the PDText is in UTF-16, it may have embedded language and country information; this will cause the ASText object to have its language and country codes set to the values found in the string. **Parameters** - `str` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): A string. - `text` (`const char *`): A text string. **Returns:** `void` **See also:** [`ASTextSetSizedPDText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextSetSizedPDText) #### ASTextSetScriptText ```cpp void ASTextSetScriptText(ASText str, const char *text, ASScript script) ``` Header: `ASExtraProcs.h:284` Alters an existing string from a `NULL`-terminated multi-byte string of the specified script. This is a wrapper around ASTextFromEncoded(); the script is converted to a host encoding using ASScriptToHostEncoding(). **Parameters** - `str` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): IN/OUT A string. - `text` (`const char *`): IN/OUT A pointer to the text string. - `script` ([`ASScript`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASScript)): IN/OUT The writing script. **Returns:** `void` **See also:** [`ASTextSetSizedScriptText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextSetSizedScriptText) #### ASTextSetSizedEncoded ```cpp void ASTextSetSizedEncoded(ASText str, const char *text, ASTArraySize len, ASHostEncoding encoding) ``` Header: `ASExtraProcs.h:271` Alters an existing string from a multi-byte string in the specified host encoding and of the specified length. This text does not need to be `NULL`-terminated, and no `NULL` (zero) bytes should appear in the characters passed in. **Parameters** - `str` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): IN/OUT A string. - `text` (`const char *`): IN/OUT A pointer to the text string. - `len` ([`ASTArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize)): IN/OUT The length of the text string. - `encoding` ([`ASHostEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASHostEncoding)): IN/OUT The host encoding type. **Returns:** `void` **Exceptions** - `genErrBadParm`: is raised if `text` is `NULL`. **See also:** [`ASTextSetEncoded`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextSetEncoded) #### ASTextSetSizedPDText ```cpp void ASTextSetSizedPDText(ASText str, const char *text, ASTArraySize length) ``` Header: `ASExtraProcs.h:334` Replaces the contents of an existing ASText object with PDF text taken out of a PDF file. This is either a big-endian UTF-16 string with the `0xFEFF` prepended to the front or a PDFDocEncoding string. In either case the `length` parameter indicates the number of bytes in the string. The string should not be `NULL`-terminated and must not contain any `NULL` characters. If the PDText is in UTF-16, it may have embedded language and country information; this will cause the ASText object to have its language and country codes set to the values found in the string. **Parameters** - `str` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): A string. - `text` (`const char *`): A pointer to a text string. - `length` ([`ASTArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize)): The length of the text string. **Returns:** `void` **See also:** [`ASTextSetPDText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextSetPDText) #### ASTextSetSizedScriptText ```cpp void ASTextSetSizedScriptText(ASText str, const char *text, ASTArraySize len, ASScript script) ``` Header: `ASExtraProcs.h:299` Replaces the contents of an existing ASText object with the specified multi-byte string of the specified script. This is a wrapper around ASTextFromSizedEncoded(); the script is converted to a host encoding using ASScriptToHostEncoding(). **Parameters** - `str` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): IN/OUT A string. - `text` (`const char *`): IN/OUT A pointer to the text string. - `len` ([`ASTArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize)): IN/OUT The length of the text string. - `script` ([`ASScript`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASScript)): IN/OUT The writing script. **Returns:** `void` **Exceptions** - `genErrBadParm`: is raised if `text` is `NULL`. #### ASTextSetSizedUnicode ```cpp void ASTextSetSizedUnicode(ASText str, const ASUTF16Val *ucsValue, ASUnicodeFormat format, ASTArraySize len) ``` Header: `ASExtraProcs.h:243` Replaces the contents of an existing ASText object with the specified Unicode string. This string is not expected to have `0xFE 0xFF` prepended or embedded country/language identifiers. The string cannot contain a `NULL` character. **Parameters** - `str` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): (Filled by the method) A string. - `ucsValue` ([`const ASUTF16Val *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUTF16Val)): A Unicode string. - `format` ([`ASUnicodeFormat`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUnicodeFormat)): The Unicode format. - `len` ([`ASTArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize)): The length of the string in bytes. **Returns:** `void` **See also:** [`ASTextSetUnicode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextSetUnicode) #### ASTextSetUnicode ```cpp void ASTextSetUnicode(ASText str, const ASUTF16Val *ucsValue, ASUnicodeFormat format) ``` Header: `ASExtraProcs.h:226` Alters an existing string from a `NULL`-terminated Unicode string. This string is not expected to have `0xFE 0xFF` prepended or embedded country/language identifiers. **Parameters** - `str` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): (Filled by the method) A string. - `ucsValue` ([`const ASUTF16Val *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUTF16Val)): A Unicode string. - `format` ([`ASUnicodeFormat`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUnicodeFormat)): The Unicode format. **Returns:** `void` **See also:** [`ASTextSetSizedUnicode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextSetSizedUnicode) #### ASUCS_GetPasswordFromUnicode ```cpp void ASUCS_GetPasswordFromUnicode(ASUTF16Val *inPassword, void **outPassword, ASBool useUTF) ``` Header: `ASExtraProcs.h:2435` Converts user input of a password to a form that can be used by Acrobat to open a file. **Parameters** - `inPassword` ([`ASUTF16Val *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUTF16Val)): IN A host-endian, 16-bit `NULL`-terminated Unicode string. - `outPassword` (`void **`): OUT A location to store a pointer to an allocated `char*` `NULL`-terminated string. - `useUTF` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): IN A flag for controlling the conversion. Prior to Acrobat 9.0, passwords were converted from host code-page encoding (8-bit mode) to `PDFDocEncoding`. If `useUTF == false`, this routine does the same, starting from 16-bit Unicode. With encryption, Acrobat 9.0 and later allows Unicode passwords, normalized and converted to UTF-8 encoding. If `useUTF == true`, such a Unicode password is what is returned. **Returns:** `void` ### Typedefs (12) #### ASCountryCode ```cpp typedef ASUns16 ASCountryCode ``` Header: `ASExtraExpT.h:52` #### ASHostEncoding ```cpp typedef ASInt32 ASHostEncoding ``` Header: `ASExpT.h:3872` An integer specifying the host encoding for text. On Mac OS, it is a script code. On Windows, it is a `CHARSET id`. In UNIX, Acrobat currently only supports English, so the only valid ASHostEncoding is `0` (Roman). See ASScript. #### ASLanguageCode ```cpp typedef ASUns16 ASLanguageCode ``` Header: `ASExtraExpT.h:54` #### ASScript ```cpp typedef ASInt32 ASScript ``` Header: `ASExpT.h:3972` #### ASTextFilterType ```cpp typedef ASEnum16 ASTextFilterType ``` Header: `ASExtraExpT.h:102` Constants that specify filter types used to modify text objects. **See also:** [`ASTextFilter`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextFilter) #### ASUTF16Val ```cpp typedef ASUns16 ASUTF16Val ``` Header: `ASExpT.h:3890` Holds a single 16-bit value from a UTF-16 encoded Unicode string. It is typically used to point to the beginning of an UTF-16 string. For example: `ASUTF16Val *utf16String = ...` This data type is not large enough to hold any arbitrary Unicode character. Use ASUnicodeChar to pass individual Unicode characters. **See also:** [`ASTextGetUnicode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextGetUnicode), [`ASTextGetUnicodeCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextGetUnicodeCopy) #### ASUTF32Val ```cpp typedef ASUns32 ASUTF32Val ``` Header: `ASExpT.h:3878` #### ASUTF8Val ```cpp typedef ASUns8 ASUTF8Val ``` Header: `ASExpT.h:3895` An ASUTF8Val holds a single 8-bit value from a UTF-8 encoded Unicode string. #### ASUniChar ```cpp typedef ASUTF16Val ASUniChar ``` Header: `ASExtraExpT.h:50` #### ASUnicodeChar ```cpp typedef ASUns32 ASUnicodeChar ``` Header: `ASExpT.h:3877` An ASUnicodeChar is large enough to hold any Unicode character (at least 21 bits wide). #### ASUnicodeFormat ```cpp typedef ASEnum16 ASUnicodeFormat ``` Header: `ASExpT.h:3863` #### ASTextEvalProc ```cpp typedef ASText(*) ASTextEvalProc(ASCab params)(ASCab params) ``` Header: `ASExtraExpT.h:405` ### Structures (2) #### ASConstText ```cpp typedef const struct _t_ASTextRec* ASConstText ``` Header: `ASExpT.h:1482` An opaque object holding constant encoded text. **See also:** [`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText) #### ASText ```cpp typedef struct _t_ASTextRec* ASText ``` Header: `ASExpT.h:1476` An opaque object holding encoded text. An ASText object represents a Unicode string. ASText objects can also be used to convert between Unicode and various platform-specific text encodings, as well as conversions between various Unicode formats such as UTF-16 or UTF-8. Since it is common for a Unicode string to be repeatedly converted to or from the same platform-specific text encoding, ASText objects are optimized for this operation. For example, they can cache both the Unicode and platform-specific text strings. There are several ways of creating an ASText object depending on the type and format of the original text data. The following terminology is used throughout this API to describe the various text formats: Text FormatDescription EncodedA multi-byte string terminated with a single `0` character and coupled with a specific host encoding indicator. On Mac OS, the text encoding is specified using a script code. On Windows, the text encoding is specified using a `CHARSET` code. On UNIX the only valid host encoding indicator is `0`, which specifies text in the platform's default Roman encoding. On all platforms, Asian text is typically specified using multi-byte strings. ScriptTextA multi-byte string terminated with a single `0` character and coupled with an ASScript code. This is merely another way of specifying the Encoded case; the ASScript code is converted to a host encoding using ASScriptToHostEncoding(). UnicodeText specified using UTF-16 or UTF-8. In the UTF-16 case, the bytes can be in either big-endian format or the endian-ness that matches the platform, and are always terminated with a single ASUns16 `0` value. In the UTF-8 case, the text is always terminated with a trailing `0` byte. Unicode usage in this case is straight Unicode without the `0xFE 0xFF` prefix or language and country codes that can be encoded inside a PDF document. PDTextA string of text pulled out of a PDF document. This will either be a big-endian Unicode string pre-appended with the bytes `0xFE 0xFF`, or a string in PDFDocEncoding. In this case, the Unicode string may have embedded language and country identifiers. ASText objects strip language and country information out of the PDText string and track them separately. See below for more details. ASText objects can also be used to accomplish encoding and format conversions; you can request a string in any of the formats specified above. In all cases the ASText code attempts to preserve all characters. For example, if you attempt to concatenate two strings in separate host encodings, the implementation may convert both to Unicode and perform the concatenation in Unicode space. When creating a new ASText object or putting new data into an existing object, the implementation will always copy the supplied data into the ASText object. The original data is yours to do with as you wish (and release if necessary). The size of ASText data is always specified in bytes. For example, the `len` argument to ASTextFromSizedUnicode() specifies the number of bytes in the string, not the number of Unicode characters. Host encoding and Unicode strings are always terminated with a `NULL` character (which consists of one `NULL` byte for host encoded strings and two `NULL` bytes for Unicode strings). You cannot create a string with an embedded `NULL` character, even using the calls which take an explicit length parameter. The `Getxxx` calls return pointers to data held by the ASText object. You cannot free or manipulate this data directly. The `GetxxxCopy` calls return data you can manipulate and that you are responsible for freeing. An ASText object can have language and country codes associated with it. A language code is a 2-character ISO 639 language code. A country code is a 2- character ISO 3166 country code. In both cases the 2-character codes are packed into an ASUns16 value: the first character is packed in bits 8-15, and the second character is packed in bits 0-7. These language and country codes can be encoded into a UTF-16 variant of PDText encoding using an escape sequence. See the description of "Common Data Structures" in ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.9, page 84. You can find this document on the web store of the International Standards Organization (ISO). The ASText calls will automatically parse the language and country codes embedded inside a UTF-16 PDText object, and will also author appropriate escape sequences to embed the language and country codes (if present) when generating a UTF-16 PDText object. **See also:** [`ASTextNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextNew), [`ASTextFromEncoded`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextFromEncoded), [`ASTextFromInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextFromInt32), [`ASTextFromPDText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTextFromPDText) ### Definitions (1) #### ASTextEqual Header: `ASExtraCalls.h:111` Value: `(ASTextCmp((a), (b)) == 0)` ## ASTimeSpan ### Functions (13) #### ASGetSecs ```cpp ASCount ASGetSecs(void) ``` Header: `ASProcs.h:1963` Returns the number of seconds elapsed since midnight, January 1, 1970, coordinated universal time, up to the current time. **Parameters** - (unnamed) (`void`) **Returns:** [`ASCount`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCount) See above. #### ASTimeSpanAdd ```cpp void ASTimeSpanAdd(const ASTimeSpan timeSpan1, const ASTimeSpan timeSpan2, ASTimeSpan result) ``` Header: `ASExtraProcs.h:2007` Adds two time spans, storing the result (an exact number of seconds) in another time span object. **Parameters** - `timeSpan1` ([`const ASTimeSpan`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpan)): The first time span to add. - `timeSpan2` ([`const ASTimeSpan`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpan)): The second time span to add. - `result` ([`ASTimeSpan`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpan)): The time span object in which to store the result. **Returns:** `void` **See also:** [`ASCalendarTimeSpanAddWithBase`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCalendarTimeSpanAddWithBase), [`ASDateAddTimeSpan`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateAddTimeSpan) #### ASTimeSpanCompare ```cpp ASInt32 ASTimeSpanCompare(const ASTimeSpan timeSpan1, const ASTimeSpan timeSpan2) ``` Header: `ASExtraProcs.h:1970` Compares two time spans to determine if they are equal or if one represents fewer seconds than the other. **Parameters** - `timeSpan1` ([`const ASTimeSpan`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpan)): The first time span. - `timeSpan2` ([`const ASTimeSpan`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpan)): The second time span. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) `1` if `timeSpan1 > timeSpan2`, `0` if they are equal, and `-1` if `timeSpan1 < timeSpan2`. **See also:** [`ASDateCompare`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateCompare), [`ASCalendarTimeSpanCompare`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCalendarTimeSpanCompare) #### ASTimeSpanCopy ```cpp void ASTimeSpanCopy(const ASTimeSpan original, ASTimeSpan copy) ``` Header: `ASExtraProcs.h:1718` Copies data from one time span object to another. **Parameters** - `original` ([`const ASTimeSpan`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpan)): The time span to be copied. - `copy` ([`ASTimeSpan`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpan)): The time span into which the data is copied. **Returns:** `void` **See also:** [`ASTimeSpanDup`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpanDup) #### ASTimeSpanDestroy ```cpp void ASTimeSpanDestroy(ASTimeSpan timeSpan) ``` Header: `ASExtraProcs.h:1727` Releases and destroys a time span object. **Parameters** - `timeSpan` ([`ASTimeSpan`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpan)): The time span. **Returns:** `void` **See also:** [`ASTimeSpanDup`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpanDup), [`ASTimeSpanNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpanNew) #### ASTimeSpanDiff ```cpp void ASTimeSpanDiff(const ASTimeSpan timeSpan1, const ASTimeSpan timeSpan2, ASTimeSpan result) ``` Header: `ASExtraProcs.h:2046` Calculates the exact difference in seconds between time span objects and stores the result in the provided ASTimeSpan object. If `timeSpan2` is less than `timeSpan1`, the result is negative. **Parameters** - `timeSpan1` ([`const ASTimeSpan`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpan)): The first time span. - `timeSpan2` ([`const ASTimeSpan`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpan)): The second time span. - `result` ([`ASTimeSpan`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpan)): The time span object in which to store the difference. **Returns:** `void` **See also:** [`ASDateExactDiff`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDateExactDiff), [`ASCalendarTimeSpanDiff`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCalendarTimeSpanDiff) #### ASTimeSpanDup ```cpp ASTimeSpan ASTimeSpanDup(const ASTimeSpan timeSpan) ``` Header: `ASExtraProcs.h:1709` Creates a new time span object containing the same data as an existing time span object. It raises an exception if there is not enough memory. **Parameters** - `timeSpan` ([`const ASTimeSpan`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpan)): The time span to duplicate. **Returns:** [`ASTimeSpan`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpan) The new time span object. **See also:** [`ASTimeSpanCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpanCopy), [`ASTimeSpanDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpanDestroy), [`ASTimeSpanNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpanNew) #### ASTimeSpanGetASInt32 ```cpp ASInt32 ASTimeSpanGetASInt32(ASTimeSpan timeSpan, ASBool *outOverflow) ``` Header: `ASExtraProcs.h:2361` Gets the number of seconds from a time span object. **Parameters** - `timeSpan` ([`ASTimeSpan`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpan)): The time span object. - `outOverflow` ([`ASBool *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): (Filled by the method) `true` if the number of seconds was too large to be represented by an ASInt32 value, `false` otherwise. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The number of seconds. **See also:** [`ASTimeSpanSet`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpanSet), [`ASTimeSpanSetFromASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpanSetFromASInt32), [`ASTimeSpanSetFromString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpanSetFromString) #### ASTimeSpanNegate ```cpp void ASTimeSpanNegate(ASTimeSpan timeSpan) ``` Header: `ASExtraProcs.h:2282` Negates the time span value of a time span object. **Parameters** - `timeSpan` ([`ASTimeSpan`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpan)): The time span. **Returns:** `void` **See also:** [`ASTimeSpanSet`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpanSet), [`ASTimeSpanSetFromASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpanSetFromASInt32), [`ASTimeSpanSetFromString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpanSetFromString) #### ASTimeSpanNew ```cpp ASTimeSpan ASTimeSpanNew(void) ``` Header: `ASExtraProcs.h:1696` Creates a time span object. It raises an exception if there is not enough memory for the operation. **Parameters** - (unnamed) (`void`) **Returns:** [`ASTimeSpan`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpan) The newly created time span object. **See also:** [`ASTimeSpanCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpanCopy), [`ASTimeSpanDup`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpanDup), [`ASTimeSpanDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpanDestroy) #### ASTimeSpanSet ```cpp void ASTimeSpanSet(ASTimeSpan timeSpan, ASInt32 highBits, ASUns32 lowBits) ``` Header: `ASExtraProcs.h:2106` The internal representation of a time span uses 64-bit signed integers (to avoid the year 2038 problem caused by 32-bit representation). This method initializes a time span object to represent a time span of `x` seconds, where `x` is the 64-bit signed integer obtained from concatenating `highBits` and `lowBits`. **Parameters** - `timeSpan` ([`ASTimeSpan`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpan)): The time span object. - `highBits` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The most significant word in the desired 64-bit signed integer value. - `lowBits` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The least significant word in the desired 64-bit signed integer value. **Returns:** `void` **See also:** [`ASTimeSpanSetFromASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpanSetFromASInt32), [`ASTimeSpanSetFromString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpanSetFromString) #### ASTimeSpanSetFromASInt32 ```cpp void ASTimeSpanSetFromASInt32(ASTimeSpan timeSpan, ASInt32 numSeconds) ``` Header: `ASExtraProcs.h:2072` Initializes a time span object to represent a time span of a specific number of seconds. **Parameters** - `timeSpan` ([`ASTimeSpan`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpan)): The time span object. - `numSeconds` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The number of seconds. **Returns:** `void` **See also:** [`ASTimeSpanGetASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpanGetASInt32), [`ASTimeSpanSet`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpanSet), [`ASTimeSpanSetFromString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpanSetFromString) #### ASTimeSpanSetFromString ```cpp void ASTimeSpanSetFromString(ASTimeSpan timeSpan, const char *numSecondsString) ``` Header: `ASExtraProcs.h:2088` Converts a string to a number of seconds, and initializes a time span object to represent a time span of that number of seconds. This is useful for time spans that are too long to represent with an ASInt32 value. **Parameters** - `timeSpan` ([`ASTimeSpan`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpan)): The time span object. - `numSecondsString` (`const char *`): The string containing the number of seconds. The string must consist of an optional minus sign (for negative numbers) followed by decimal digits. No white spaces are allowed anywhere in the string. **Returns:** `void` **See also:** [`ASTimeSpanSet`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpanSet), [`ASTimeSpanSetFromASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTimeSpanSetFromASInt32) ### Structures (1) #### ASTimeSpan ```cpp typedef struct _t_ASTimeSpanRec* ASTimeSpan ``` Header: `ASExpT.h:4079` An ASTimeSpan represents an exact time span, measured in seconds. The internal representation uses 64-bit signed integers to avoid the year 2037 problem. Negative timespans are allowed. ### Definitions (1) #### ASGetSecs Header: `ASCalls.h:125` Value: `ASSecs` ## ASUUID ### Functions (5) #### ASUUIDFromCString ```cpp ASBool ASUUIDFromCString(ASUUID *dst, const char *str) ``` Header: `ASProcs.h:2210` Parses a C string, such as one generated by ASUUIDToCString(), into a unique identifier (UUID). **Parameters** - `dst` (`ASUUID *`): (Filled by the method) The UUID created from the string. - `str` (`const char *`): A `NULL`-terminated string from which to generate the UUID, in the following form: `f81d4fae-7dec-11d0-a765-00a0c91e6bf6`. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the UUID is successfully created, `false` otherwise. **See also:** [`ASUUIDGenFromHash`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUUIDGenFromHash), [`ASUUIDGenFromName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUUIDGenFromName), [`ASUUIDGenUnique`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUUIDGenUnique), [`ASUUIDToCString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUUIDToCString), `AVAppGetUUID` #### ASUUIDGenFromHash ```cpp ASBool ASUUIDGenFromHash(ASUUID *dst, ASUns8 hash[16]) ``` Header: `ASProcs.h:2193` Generates a unique identifier (UUID) from a hash value. **Parameters** - `dst` (`ASUUID *`): (Filled by the method) The UUID created from the hash. - `hash` ([`ASUns8`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns8)): A hash value, such as MD5. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the UUID is successfully created, `false` otherwise. **See also:** [`ASUUIDFromCString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUUIDFromCString), [`ASUUIDGenFromName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUUIDGenFromName), [`ASUUIDGenUnique`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUUIDGenUnique), [`ASUUIDToCString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUUIDToCString), `AVAppGetUUID` #### ASUUIDGenFromName ```cpp ASBool ASUUIDGenFromName(ASUUID *dst, const ASUUID *ns, void *name, ASByteCount bytes) ``` Header: `ASProcs.h:2177` Generates a universal unique identifier (UUID) for a block of data (a name) in a context (a namespace). **Parameters** - `dst` (`ASUUID *`): (Filled by the method) The UUID created from the name. - `ns` (`const ASUUID *`): A namespace or context meaningful to the client. - `name` (`void *`): A pointer to an arbitrary block of data to be identified by the UUID. - `bytes` ([`ASByteCount`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASByteCount)): The number of bytes in `name`. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the UUID is successfully created, `false` otherwise. **See also:** [`ASUUIDFromCString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUUIDFromCString), [`ASUUIDGenFromHash`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUUIDGenFromHash), [`ASUUIDGenUnique`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUUIDGenUnique), [`ASUUIDToCString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUUIDToCString), `AVAppGetUUID` #### ASUUIDGenUnique ```cpp ASBool ASUUIDGenUnique(ASUUID *dst) ``` Header: `ASProcs.h:2157` Generates a unique identifier (UUID). **Parameters** - `dst` (`ASUUID *`): (Filled by the method) The UUID created from the hash. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the UUID is successfully created, `false` otherwise. **See also:** [`ASUUIDFromCString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUUIDFromCString), [`ASUUIDGenFromHash`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUUIDGenFromHash), [`ASUUIDGenFromName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUUIDGenFromName), [`ASUUIDToCString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUUIDToCString), `AVAppGetUUID` #### ASUUIDToCString ```cpp void ASUUIDToCString(char *dst, const ASUUID *src) ``` Header: `ASProcs.h:2228` Generates a `NULL`-terminated C string from the unique identifier (UUID) for a user or session. **Parameters** - `dst` (`char *`): (Filled by the method) A `NULL`-terminated string from which to generate the UUID, in the following form: `f81d4fae-7dec-11d0-a765-00a0c91e6bf6`. The string must be at least the length specified by ASUUIDMaxStringLen(). - `src` (`const ASUUID *`): The UUID from which to generate the string . **Returns:** `void` **See also:** [`ASUUIDFromCString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUUIDFromCString), [`ASUUIDGenFromHash`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUUIDGenFromHash), [`ASUUIDGenFromName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUUIDGenFromName), [`ASUUIDGenUnique`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUUIDGenUnique), `AVAppGetUUID` ### Definitions (1) #### ASUUIDMaxStringLen Header: `ASExpT.h:3999` Value: `40` A constant for the maximum string length of a unique identifier (UUID). **See also:** [`ASUUIDToCString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUUIDToCString) ## General ### Functions (2) #### ASDebug ```cpp void * ASDebug(ASInt32 op, void *parm, ASTArraySize parmLen, void *clientData) ``` Header: `ASProcs.h:1041` For internal use only. **Parameters** - `op` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)) - `parm` (`void *`) - `parmLen` ([`ASTArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize)) - `clientData` (`void *`) **Returns:** `void *` #### ASGetConfiguration ```cpp void * ASGetConfiguration(ASAtom key) ``` Header: `CorProcs.h:257` Gets information about the Acrobat viewer application under which the plug-in is running. Use this method if your plug-in's functionality depends on the Acrobat viewer that is running. The method can return a product name, or check whether the current product allows editing. Do not rely on the product name to determine whether the product can edit files, as product names and feature sets may vary; use the `CanEdit` selector to do this. Value Description `CanEdit` Checks whether editing is allowed in the current environment (regardless of the product name). `Product` Checks which Acrobat application is running. Value Return type `CanEdit` An ASBool value: `true` if the current application allows editing, `false` otherwise. `Product` A `const char*` value, one of the following strings: `"Reader"`: Adobe Reader `"Exchange"`: Acrobat Standard `"Exchange-Pro"`: Acrobat Professional `"Acrobat PDF LIbrary"`: Acrobat PDF Library **Parameters** - `key` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The key determines whether the method tests editability, or finds which product configuration is running. Its values are: **Returns:** `void *` The return value's type depends on the request key. Cast the return value to the type you are expecting, based on the key you pass in: **Exceptions** - `UNDEFINED_CONFIGURATION_SELECTOR`: is returned if an unknown value is passed as `key` (see `CoreExpT.h`). ### Typedefs (47) #### ASArraySize ```cpp typedef ASUns32 ASArraySize ``` Header: `ASExpT.h:124` An array size value for use in callback procedures. **See also:** `AVDocSelectionAcquireQuadsProc`, [`CosObjOffsetProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjOffsetProc) #### ASBool ```cpp typedef ASUns16 ASBool ``` Header: `ASNumTypes.h:121` ASBool #### ASByte ```cpp typedef ASUns8 ASByte ``` Header: `ASExpT.h:187` #### ASByteCount ```cpp typedef ASUns32 ASByteCount ``` Header: `ASExpT.h:117` A byte count value for use in ASProcStmRdExHandler and ASFileSysItemProps. **See also:** [`ASUUIDGenFromName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUUIDGenFromName) #### ASCallback ```cpp typedef void* ASCallback ``` Header: `CoreExpT.h:199` #### ASCoord ```cpp typedef ASInt16 ASCoord ``` Header: `ASExpT.h:264` A coordinate for a point in device space, for use in mouse click callbacks. Values are conditionally compiled as 16-bit or 32-bit integers, depending on the Acrobat version. **See also:** [`ASGetSecs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASGetSecs), [`ASIsValidUTF8`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASIsValidUTF8), `AVAppCreateIconBundle6`, `AVDocGetNthPageView`, `AVDocGetNumPageViews` #### ASCount ```cpp typedef ASUns32 ASCount ``` Header: `ASExpT.h:184` A numeric count value. **See also:** [`ASGetSecs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASGetSecs), [`ASIsValidUTF8`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASIsValidUTF8), `AVAppCreateIconBundle6`, `AVDocGetNthPageView`, `AVDocGetNumPageViews` #### ASDuration ```cpp typedef ASInt32 ASDuration ``` Header: `ASExpT.h:163` #### ASEnum16 ```cpp typedef ASInt16 ASEnum16 ``` Header: `CoreExpT.h:75` 2-byte enumeration with values from `0` to `32,767`, used in data structures. #### ASEnum8 ```cpp typedef ASUns8 ASEnum8 ``` Header: `CoreExpT.h:70` 1-byte enumeration with values from `0` to `127`, used in data structures. #### ASFlagBits ```cpp typedef ASUns32 ASFlagBits ``` Header: `ASExpT.h:139` A flag-bits value. **See also:** [`ASFileSetMode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSetMode), [`CosDocCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocCreate), [`CosDocSaveToFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocSaveToFile), [`CosDocSaveWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocSaveWithParams), [`HFTReplaceEntry`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTReplaceEntry), [`HFTReplaceEntryEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTReplaceEntryEx), `PDAnnotInfo`, [`ASFileSysGetFileFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysGetFileFlags), [`ASFileSysGetStatusProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysGetStatusProc), [`PDAnnotHandlerGetAnnotInfoFlagsProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotHandlerGetAnnotInfoFlagsProc) #### ASFract ```cpp typedef ASInt32 ASFract ``` Header: `ASExpT.h:1186` Definition of ASFract. #### ASInt16 ```cpp typedef short int ASInt16 ``` Header: `ASNumTypes.h:49` 2-byte `signed short` numeric value. #### ASInt16P ```cpp typedef short int * ASInt16P ``` Header: `ASNumTypes.h:49` #### ASInt32 ```cpp typedef int ASInt32 ``` Header: `ASNumTypes.h:54` 4-byte `signed long` numeric value. #### ASInt32P ```cpp typedef int * ASInt32P ``` Header: `ASNumTypes.h:54` #### ASInt64 ```cpp typedef signed long long int ASInt64 ``` Header: `ASNumTypes.h:59` 8-byte `signed long` numeric value. #### ASInt8 ```cpp typedef signed char ASInt8 ``` Header: `ASNumTypes.h:45` 1-byte `signed char` value. #### ASInt8P ```cpp typedef signed char * ASInt8P ``` Header: `ASNumTypes.h:45` #### ASIntOrPtr ```cpp typedef intptr_t ASIntOrPtr ``` Header: `ASNumTypes.h:99` #### ASMaskBits ```cpp typedef ASUns32 ASMaskBits ``` Header: `ASExpT.h:160` #### ASReportType ```cpp typedef ASEnum16 ASReportType ``` Header: `ASExtraExpT.h:364` #### ASSize_t ```cpp typedef size_t ASSize_t ``` Header: `ASNumTypes.h:148` #### ASSmallCount ```cpp typedef ASInt16 ASSmallCount ``` Header: `ASExpT.h:192` A signed `int` value. Negative values are never used. #### ASTArraySize ```cpp typedef ASInt32 ASTArraySize ``` Header: `ASExpT.h:215` A numeric array size value for use in AS and Cos-level I/O methods and data structures. **See also:** `numerous`, [`ASFileCompletionProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileCompletionProc), [`ASFileSysGetNameProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysGetNameProc), [`ASFileSysMReadRequestProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysMReadRequestProc), [`ASStmProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStmProc) #### ASTCount ```cpp typedef ASInt32 ASTCount ``` Header: `ASExpT.h:239` A numeric count value for use in stream methods. **See also:** [`ASIsValidUTF8`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASIsValidUTF8), [`ASStmFlush`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStmFlush), [`ASStmRead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStmRead), [`ASStmWrite`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStmWrite), [`CosCopyStringValue`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosCopyStringValue), [`CosDocGetID`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocGetID), [`CosStreamPos`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosStreamPos), [`CosStringValue`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosStringValue), [`CosStringValueSafe`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosStringValueSafe), [`HFTNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTNew), [`ASStmProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStmProc) #### ASTVersion ```cpp typedef ASInt32 ASTVersion ``` Header: `ASExpT.h:223` A cryptographic version number. **See also:** [`CosCryptGetVersion`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosCryptGetVersion), [`CosDecryptGetMaxKeyBytes`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDecryptGetMaxKeyBytes), [`CosEncryptGetMaxKeyBytes`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosEncryptGetMaxKeyBytes) #### ASUns16 ```cpp typedef unsigned short int ASUns16 ``` Header: `ASNumTypes.h:86` 2-byte unsigned short numeric value. #### ASUns16P ```cpp typedef unsigned short int * ASUns16P ``` Header: `ASNumTypes.h:86` #### ASUns32 ```cpp typedef unsigned int ASUns32 ``` Header: `ASNumTypes.h:91` 4-byte `unsigned long` numeric value. #### ASUns32P ```cpp typedef unsigned int * ASUns32P ``` Header: `ASNumTypes.h:91` #### ASUns64 ```cpp typedef unsigned long long int ASUns64 ``` Header: `ASNumTypes.h:96` 8-byte `unsigned long` numeric value. #### ASUns8 ```cpp typedef unsigned char ASUns8 ``` Header: `ASNumTypes.h:82` 1-byte `unsigned char` value. #### ASUns8P ```cpp typedef unsigned char * ASUns8P ``` Header: `ASNumTypes.h:82` #### ASUnsOrPtr ```cpp typedef uintptr_t ASUnsOrPtr ``` Header: `ASNumTypes.h:101` #### ASVersion ```cpp typedef ASUns32 ASVersion ``` Header: `ASExpT.h:171` An HFT version number. **See also:** [`ASExtensionMgrGetHFT`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASExtensionMgrGetHFT), [`HFTServerProvideHFTProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTServerProvideHFTProc), [`HFTGetVersion`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTGetVersion) #### OPAQUE_32_BITS ```cpp typedef ASInt32 OPAQUE_32_BITS ``` Header: `CoreExpT.h:114` #### ASCancelProc ```cpp typedef ASBool(*) ASCancelProc(void *clientData)(void *clientData) ``` Header: `ASExpT.h:3697` This callback replaces CancelProc(). A callback to check for cancelling operations. An ASCancelProc() is typically passed to some method that takes a long time to complete. At frequent intervals, the method calls the ASCancelProc(). If it returns `true`, the method cancels its operation; if it returns `false`, it continues. **See also:** `PDFLPrintCancelProc (Only available with the PDF Library SDK)`, `AVAppGetCancelProc`, [`PDDocCreateThumbs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateThumbs), [`PDDocInsertPages`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocInsertPages) #### ASProgressProc ```cpp typedef ASBool(*) ASProgressProc(float current, const char *name, ASInt32 stage, void *clientData)(float current, const char *name, ASInt32 stage, void *clientData) ``` Header: `ASExpT.h:3704` #### ASReportProc ```cpp typedef void(*) ASReportProc(ASReportType reportType, ASInt32 errorCode, ASText message, ASText replacementText, ASCab moreInfo, void *reportProcData)(ASReportType reportType, ASInt32 errorCode, ASText message, ASText replacementText, ASCab moreInfo, void *reportProcData) ``` Header: `ASExtraExpT.h:400` A report proc can be used to report errors, warnings, and other messages to the user. Normally a report proc will use a dialog to notify the user of an error, but in some contexts (such as during batch processing) it may either log the error or warning to a file or ignore it. It is this callback's responsibility to destroy all objects passed to it, and it may do so at any time. **See also:** `AVAppGetReportProc`, `AVCommandGetReportProc` #### PMBeginOperationProc ```cpp typedef void(*) PMBeginOperationProc(void *clientData)(void *clientData) ``` Header: `ASExpT.h:3549` A callback used in ASProgressMonitor that initializes the progress monitor and displays it with a current value of zero. This method must be called first when the progress monitor is used. **See also:** [`PMEndOperationProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#PMEndOperationProc) #### PMEndOperationProc ```cpp typedef void(*) PMEndOperationProc(void *clientData)(void *clientData) ``` Header: `ASExpT.h:3561` A callback used in ASProgressMonitor that draws the progress monitor with its current value set to the progress monitor's duration (a full progress monitor), then removes the progress monitor from the display. **See also:** [`PMBeginOperationProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#PMBeginOperationProc) #### PMGetCurrValueProc ```cpp typedef ASDuration(*) PMGetCurrValueProc(void *clientData)(void *clientData) ``` Header: `ASExpT.h:3614` A callback used in ASProgressMonitor that gets the progress monitor's duration, set by the most recent call to the progress monitor's PMSetCurrValueProc(). **See also:** [`PMSetCurrValueProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#PMSetCurrValueProc) #### PMGetDurationProc ```cpp typedef ASDuration(*) PMGetDurationProc(void *clientData)(void *clientData) ``` Header: `ASExpT.h:3603` A callback used in ASProgressMonitor that gets the progress monitor's duration, set by the most recent call to the progress monitor's PMSetDurationProc(). **See also:** [`PMSetDurationProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#PMSetDurationProc) #### PMSetCurrValueProc ```cpp typedef void(*) PMSetCurrValueProc(ASDuration currValue, void *clientData)(ASDuration currValue, void *clientData) ``` Header: `ASExpT.h:3591` A callback used in ASProgressMonitor that sets the current value of the progress monitor and updates the display. The allowed value ranges from `0` (empty) to the value passed to `setDuration`. For example, if the progress monitor's duration is `10`, the current value must be between `0` and `10`, inclusive. **See also:** [`PMGetCurrValueProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#PMGetCurrValueProc) #### PMSetDurationProc ```cpp typedef void(*) PMSetDurationProc(ASDuration duration, void *clientData)(ASDuration duration, void *clientData) ``` Header: `ASExpT.h:3576` A callback used in ASProgressMonitor that sets the value that corresponds to a full progress monitor display. The progress monitor is subsequently filled in by setting its current value. This method must be called before you can set the progress monitor's current value. **See also:** [`PMGetDurationProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#PMGetDurationProc) #### PMSetTextProc ```cpp typedef void(*) PMSetTextProc(ASText text, void *clientData)(ASText text, void *clientData) ``` Header: `ASExpT.h:3629` A callback within `ASProgressMonitorRec` that sets the text string that is displayed by the progress monitor. The built-in document progress monitor (see AVAppGetDocProgressMonitor()) makes a copy of the text. As such, it is the client's responsibility to destroy it. ### Enums (2) #### PDFLFlattenProgressMarker Header: `ASExpT.h:3711` **Values** - `kPDFLFlattenProg_EnterInFlattener = 0` - `kPDFLFlattenProg_FindObjectsInvolvedInTransparency = 1` - `kPDFLFlattenProg_TextHeuristics = 2` - `kPDFLFlattenProg_IdentifyingComplexityRegion = 3` - `kPDFLFlattenProg_ComputingComplexityRegionClippath = 4` - `kPDFLFlattenProg_EnterInPlanarMap = 5` - `kPDFLFlattenProg_FlattenAtomicRegions = 6` - `kPDFLFlattenProg_RasterizingComplexityRegion = 7` #### PDFLRenderProgressMarker Header: `ASExpT.h:3723` **Values** - `kPDFLRenderProg_Unknown = 0` - `kPDFLRenderProg_Stage1 = 1` - `kPDFLRenderProg_Stage2 = 2` - `kPDFLRenderProg_Stage3 = 3` - `kPDFLRenderProg_Stage4 = 4` - `kPDFLRenderProg_Stage5 = 5` - `kPDFLRenderProg_Stage6 = 6` - `kPDFLRenderProg_Stage7 = 7` - `kPDFLRenderProg_Stage8 = 8` - `kPDFLRenderProg_Stage9 = 9` ### Definitions (54) #### ACRestoreEnvironProc Header: `CorCalls.h:517` Value: `restoreEnvironProc` #### ASBoolToBool Header: `CoreExpT.h:57` Value: `(boolval != FALSE)` #### ASCryptStmModeError Header: `ASExpT.h:318` Value: `0x0008` #### ASFourCharCode Header: `ASExpT.h:1618` Value: `(x)` #### ASFourCharCode Header: `ASExpT.h:1620` Value: `(0U)` #### ASMAXInt16 Header: `ASNumTypes.h:66` Value: `((ASInt16)0x7FFF)` #### ASMAXInt32 Header: `ASNumTypes.h:70` Value: `((ASInt32)0x7FFFFFFF)` #### ASMAXInt64 Header: `ASNumTypes.h:74` Value: `((ASInt64)0x7FFFFFFFFFFFFFFFLL)` #### ASMAXInt8 Header: `ASNumTypes.h:62` Value: `((ASInt8)0x7F)` #### ASMAXUns16 Header: `ASNumTypes.h:108` Value: `((ASUns16)0xFFFF)` #### ASMAXUns32 Header: `ASNumTypes.h:112` Value: `((ASUns32)0xFFFFFFFF)` #### ASMAXUns64 Header: `ASNumTypes.h:116` Value: `((ASUns64)0xFFFFFFFFFFFFFFFFLL)` #### ASMAXUns8 Header: `ASNumTypes.h:104` Value: `((ASUns8)0xFF)` #### ASMINInt16 Header: `ASNumTypes.h:68` Value: `((ASInt16)0x8000)` #### ASMINInt32 Header: `ASNumTypes.h:72` Value: `((ASInt32)0x80000000)` #### ASMINInt64 Header: `ASNumTypes.h:76` Value: `((ASInt64)0x8000000000000000LL)` #### ASMINInt8 Header: `ASNumTypes.h:64` Value: `((ASInt8)0x80)` #### ASMINUns16 Header: `ASNumTypes.h:110` Value: `((ASUns16)0x0000)` #### ASMINUns32 Header: `ASNumTypes.h:114` Value: `((ASUns32)0x00000000)` #### ASMINUns64 Header: `ASNumTypes.h:118` Value: `((ASUns64)0x0000000000000000LL)` #### ASMINUns8 Header: `ASNumTypes.h:106` Value: `((ASUns8)0x00)` #### ASUSE_OBSOLETE_TYPES Header: `CoreExpT.h:213` Value: `1` #### AS_ARCH_64BIT Header: `ASNumTypes.h:35` Value: `1` `ASNumTypes.h` defines basic integer types. #### AS_ARCH_64BIT Header: `ASNumTypes.h:37` Value: `0` `ASNumTypes.h` defines basic integer types. #### AS_UNUSED_PARAM Header: `ASExpT.h:30` Value: `type name` #### AS_UNUSED_VAR Header: `ASExpT.h:36` Value: `type name; \ name` #### CHECKTYPE Header: `ASExpT.h:3739` Value: `((void *)data)` #### CHECK_CHARSTR Header: `ASExpT.h:3747` Value: `CHECKTYPE(char *, data)` #### CancelProc Header: `ASExpT.h:3701` Value: `ASCancelProc` #### FALSE Header: `ASNumTypes.h:143` Value: `0` #### HAS_32BIT_ATOMS Header: `CoreExpT.h:138` Value: `0` #### HAS_BOOL_SUPPORT Header: `ASNumTypes.h:126` Value: `0` #### HUGEPTRTYPE Header: `CoreExpT.h:127` #### HugePtr Header: `CoreExpT.h:129` Value: `char HUGEPTRTYPE *` #### NULL Header: `CoreExpT.h:109` Value: `((void *)0)` #### POINTER_64_BITS Header: `CoreExpT.h:32` Value: `1` #### ProgressMonitor Header: `ASExpT.h:3676` Value: `ASProgressMonitor` #### ProgressMonitorRec Header: `ASExpT.h:3677` Value: `ASProgressMonitorRec` #### ProgressProc Header: `ASExpT.h:3707` Value: `ASProgressProc` #### TRUE Header: `ASNumTypes.h:139` Value: `1` #### UNDEFINED_CONFIGURATION_SELECTOR Header: `CoreExpT.h:204` Value: `((void *)-1)` This constant is returned by ASGetConfiguration() when the selector passed in is unknown to the application. #### USE_CPLUSPLUS_EXCEPTIONS_FOR_ASEXCEPTIONS Header: `CorCalls.h:161` Value: `1` #### USE_CPLUSPLUS_EXCEPTIONS_FOR_ASEXCEPTIONS Header: `CorCalls.h:163` Value: `1` #### USE_CPLUSPLUS_EXCEPTIONS_FOR_ASEXCEPTIONS Header: `CorCalls.h:165` Value: `1` #### _ALLOW_KEYWORD_MACROS Header: `CorCalls.h:90` #### _E_SUPPRESS_NESTED_DURING_HANDLER_WARNINGS Header: `CorCalls.h:132` Value: `__pragma(warning(suppress : 6244 6246))` #### _E_SUPPRESS_NESTED_DURING_HANDLER_WARNINGS Header: `CorCalls.h:134` #### false Header: `ASNumTypes.h:134` Value: `0` #### kASMAXEnum16 Header: `CoreExpT.h:80` Value: `ASMAXInt16` #### kASMAXEnum16 Header: `CoreExpT.h:96` Value: `ASMAXInt16` #### kASMAXEnum8 Header: `CoreExpT.h:78` Value: `ASMAXInt16` #### kASMAXEnum8 Header: `CoreExpT.h:94` Value: `ASMAXInt8` #### kMoreTextKey Header: `ASExtraExpT.h:366` Value: `"MoreText"` #### true Header: `ASNumTypes.h:131` Value: `1` ## HFT ### Functions (9) #### HFTDestroy ```cpp void HFTDestroy(HFT hft) ``` Header: `ASProcs.h:233` Destroys an existing HFT by freeing all the HFT's memory. Call this method only if you are absolutely sure that neither your plug-in nor any other plug-in will use the HFT again. Because this is usually impossible to know, plug-ins should not destroy HFTs. It is even dangerous to destroy an HFT at unload time, because the order in which plug-ins are unloaded is not specified. **Parameters** - `hft` ([`HFT`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFT)): The HFT to destroy. **Returns:** `void` **See also:** [`HFTNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTNew) #### HFTGetReplacedEntry ```cpp HFTEntry HFTGetReplacedEntry(HFT hft, Selector sel, HFTEntry oldEntry) ``` Header: `ASProcs.h:307` Gets the HFTEntry that was replaced by the specified HFTEntry in the specified entry. Plug-ins should generally not use this method directly, but use the `CALL_REPLACED_PROC` macro instead. It is necessary to specify both a selector (the index of an entry in the HFT's table of callback pointers) and an HFTEntry (a callback pointer) because a method may be replaced several times, and the various replacement methods are kept in a linked list. The selector determines which linked list is examined, and the HFTEntry determines the entry in the linked list to return. **Parameters** - `hft` ([`HFT`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFT)): The HFT in which a replaced entry is retrieved. See HFTReplaceEntry() for more information. - `sel` ([`Selector`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#Selector)): The selector whose previous value is obtained. See HFTReplaceEntry() for more information. - `oldEntry` ([`HFTEntry`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTEntry)): The HFTEntry for which the previous value is obtained. **Returns:** [`HFTEntry`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTEntry) The entry present prior to being replaced. `NULL` is returned if the entry has not been replaced. **See also:** [`ASExtensionMgrGetHFT`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASExtensionMgrGetHFT), `CALL_REPLACED_PROC` #### HFTGetVersion ```cpp ASVersion HFTGetVersion(HFT hft) ``` Header: `ASProcs.h:2483` Returns the version of the HFT, if available. **Parameters** - `hft` ([`HFT`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFT)): The HFT whose version is obtained. **Returns:** [`ASVersion`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASVersion) The version number if the HFT is valid and the version is available, `HFT_ERROR_NO_VERSION` otherwise. **See also:** [`HFTNewEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTNewEx) #### HFTIsValid ```cpp ASBool HFTIsValid(HFT hft) ``` Header: `ASProcs.h:1575` Tests whether an HFT is valid. **Parameters** - `hft` ([`HFT`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFT)): IN/OUT The HFT to test. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if `hft` is valid, `false` otherwise. #### HFTNew ```cpp HFT HFTNew(HFTServer hftServer, ASTCount numSelectors) ``` Header: `ASProcs.h:219` Obsolete. See HFTNewEx(). Creates a new HFT by calling the specified HFT server's HFTServerProvideHFTProc(). **Parameters** - `hftServer` ([`HFTServer`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTServer)): The HFT server for the HFT being created. The HFT server must have been created previously using HFTServerNew(). - `numSelectors` ([`ASTCount`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTCount)): The number of entries in the new HFT. This determines the number of methods that the HFT can contain; each method occupies one entry. **Returns:** [`HFT`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFT) The newly created HFT. **See also:** [`ASExtensionMgrGetHFT`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASExtensionMgrGetHFT), [`HFTDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTDestroy), [`HFTNewEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTNewEx) #### HFTNewEx ```cpp HFT HFTNewEx(HFTServer hftServer, HFTData data) ``` Header: `ASProcs.h:2507` Extends HFTNew() with version information in Acrobat 6. Creates a new HFT by calling the specified HFT server's HFTServerProvideHFTProc(). **Parameters** - `hftServer` ([`HFTServer`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTServer)): The HFT server for the HFT being created. The HFT server must have been created previously using HFTServerNew(). - `data` ([`HFTData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTData)): The data to pass to the server, which includes: • The number of entries in the new HFT, which determines the number of methods that the HFT can contain. Each method occupies one entry. • The HFT version. **Returns:** [`HFT`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFT) The newly created HFT. **See also:** [`HFTNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTNew), [`ASExtensionMgrGetHFT`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASExtensionMgrGetHFT), [`HFTDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTDestroy) #### HFTReplaceEntry ```cpp void HFTReplaceEntry(HFT hft, Selector sel, HFTEntry newEntry, ASFlagBits flags) ``` Header: `ASProcs.h:280` Replaces the specified entry in the specified HFT. This allows a plug-in to override and replace certain methods in Acrobat's API. See Replaceable Methods for a list of replaceable methods. This method can be used from anywhere in the plug-in, but it makes the most sense for most plug-ins to replace methods in the importReplaceAndRegisterCallback() procedure. Plug-ins register their HFTs in the export callback, but the code to populate the function table is only executed when the first client requests the HFT. Plug-ins can use the `REPLACE` macro instead of calling HFTReplaceEntry() directly. All plug-ins, and Acrobat itself, share a single copy of each HFT. As a result, when a plug-in replaces the implementation of a method, all other plug-ins and Acrobat also use the new implementation of that method. In addition, once a method's implementation has been replaced, there is no way to remove the new implementation without restarting Acrobat. **Note:** The `CALL_REPLACED_PROC` macro is available to call the previous HFT entry function that was replaced. **Parameters** - `hft` ([`HFT`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFT)): The HFT in which a method is replaced. Use ASExtensionMgrGetHFT() to get the HFT, given its name. For the HFTs built into the Acrobat viewer, global variables containing the HFTs have been defined, so you can skip calling ASExtensionMgrGetHFT() for these HFTs. - `sel` ([`Selector`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#Selector)): The entry in the HFT to replace, derived from the method's name by appending `SEL`. For example, to replace AVAlert, `sel` must be `AVAlertSEL`. - `newEntry` ([`HFTEntry`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTEntry)): The function to replace the current one. The function pointer must be converted to an HFTEntry using the ASCallbackCreateReplacement() macro. - `flags` ([`ASFlagBits`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFlagBits)): The new entry's properties. Currently, only HFTEntryReplaceable is defined. **Returns:** `void` **Exceptions** - `xmErrCannotReplaceSelector`: ReplaceableMethods **See also:** [`ASExtensionMgrGetHFT`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASExtensionMgrGetHFT), [`HFTGetReplacedEntry`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTGetReplacedEntry), `CALL_REPLACED_PROC`, `REPLACE`, `ASCallbackCreateReplacement` #### HFTReplaceEntryEx ```cpp void HFTReplaceEntryEx(HFT hft, Selector sel, HFTEntry newEntry, ASExtension extension, ASFlagBits flags) ``` Header: `ASProcs.h:2092` A new version of HFTReplaceEntry() that adds the extension argument. Plug-ins can use the REPLACE macro instead of calling HFTReplaceEntryEx directly. **Note:** The CALL_REPLACED_PROC macro is available to call the previous HFT entry function that was replaced. **Parameters** - `hft` ([`HFT`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFT)): The HFT in which a method is replaced. Use ASExtensionMgrGetHFT() to get the HFT, given its name. For the HFTs built into the Acrobat viewer, global variables containing the HFTs have been defined, so you can skip calling ASExtensionMgrGetHFT() for these HFTs. - `sel` ([`Selector`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#Selector)): The entry in the HFT to replace, derived from the method's name by appending `SEL`. For example, to replace AVAlert, `sel` must be `AVAlertSEL`. - `newEntry` ([`HFTEntry`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTEntry)): The function to replace the current one. The function pointer must be converted to an HFTEntry using the ASCallbackCreateReplacement() macro. - `extension` ([`ASExtension`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASExtension)): Plug-ins should pass in `gExtensionID` for this parameter (see the code for the Acrobat 5.0 version of the REPLACE macro). This parameter is stored by Acrobat so that any entries that were replaced by a plug-in can be unreplaced in the event that the plug-in unloads. - `flags` ([`ASFlagBits`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFlagBits)): The new entry's properties. Currently, only `HFTEntryReplaceable` is defined. **Returns:** `void` **Exceptions** - `xmErrCannotReplaceSelector` **See also:** [`ASExtensionMgrGetHFT`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASExtensionMgrGetHFT), [`HFTGetReplacedEntry`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTGetReplacedEntry), [`HFTReplaceEntry`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTReplaceEntry), [`HFTUnreplaceEntry`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTUnreplaceEntry), `CALL_REPLACED_PROC`, `REPLACE`, `ASCallbackCreateReplacement` #### HFTUnreplaceEntry ```cpp void HFTUnreplaceEntry(HFT hft, Selector sel, HFTEntry oldEntry, ASExtension extension) ``` Header: `ASProcs.h:2118` Removes the `oldEntry` item from `hft` at `sel` if the extension fields match. It allows HFT replacements to be undone in cases such as with the DigSig plug-in, which replaces a method that Acrobat could use after DigSig unloads. **Parameters** - `hft` ([`HFT`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFT)): The HFT in which a method is un-replaced. Use ASExtensionMgrGetHFT() to get the HFT, given its name. For the HFTs built into the Acrobat viewer, global variables containing the HFTs have been defined, so you can skip calling ASExtensionMgrGetHFT() for these HFTs. - `sel` ([`Selector`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#Selector)): The entry in the HFT to un-replace, derived from the method's name by appending `SEL`. For example, to replace AVAlert, `sel` must be `AVAlertSEL`. - `oldEntry` ([`HFTEntry`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTEntry)): The old function to be replaced. The function pointer must be converted to an HFTEntry using the ASCallbackCreateReplacement() macro. - `extension` ([`ASExtension`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASExtension)): An object of type ASExtension. **Returns:** `void` **See also:** [`ASExtensionMgrGetHFT`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASExtensionMgrGetHFT), [`HFTGetReplacedEntry`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTGetReplacedEntry), [`HFTReplaceEntry`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTReplaceEntry), [`HFTReplaceEntryEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTReplaceEntryEx), `REPLACE`, `ASCallbackCreateReplacement` ### Typedefs (4) #### HFT ```cpp typedef HFTEntry* HFT ``` Header: `CoreExpT.h:172` An object that describes a set of exported functions. It is an array of function pointers, where the first element is unused. **Note:** An HFT object may be cast to an `(HFTEntry *)`; you may then index directly into this object by a selector to obtain a pointer to a function. #### HFTData ```cpp typedef const HFTDataRec* HFTData ``` Header: `ASExpT.h:606` #### HFTEntry ```cpp typedef void* HFTEntry ``` Header: `CoreExpT.h:161` An HFTEntry may be cast to a pointer to a function whose prototype must be provided by the HFT's description file. #### Selector ```cpp typedef ASInt32 Selector ``` Header: `CoreExpT.h:154` Uniquely identifies an entry within an HFT. It is simply the integer offset of the entry from the start of the HFT. ### Definitions (4) #### BAD_SELECTOR Header: `CoreExpT.h:155` Value: `0` #### HFTEntryReplaceable Header: `CoreExpT.h:187` Value: `(0x00000001)` A flag that specifies whether an HFT entry is replaceable: • If the flag is set, the new entry can be replaced. Clients should generally use this value, allowing other clients to subsequently replace the method again. • If the flag is not set, the new entry cannot be replaced. **See also:** [`HFTReplaceEntry`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTReplaceEntry) #### HFT_ERROR_NO_VERSION Header: `ASExpT.h:586` Value: `(0xFFFFFFFF)` #### kHFT_IN_BETA_FLAG Header: `CoreExpT.h:175` Value: `0x80000000` ## HFTServer ### Functions (2) #### HFTServerDestroy ```cpp void HFTServerDestroy(HFTServer hftServer) ``` Header: `ASProcs.h:202` Destroys an HFT server. Call this method only if the HFT will not be used again. **Parameters** - `hftServer` ([`HFTServer`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTServer)): IN/OUT The HFT server to destroy. **Returns:** `void` **See also:** [`HFTServerNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTServerNew) #### HFTServerNew ```cpp HFTServer HFTServerNew(const char *name, HFTServerProvideHFTProc serverProc, HFTServerDestroyProc destroyProc, void *clientData) ``` Header: `ASProcs.h:192` Creates a new Host Function Table (HFT) server. An HFT server is responsible for creating an instance of an HFT with the specified version number, and destroying the HFT. **Parameters** - `name` (`const char *`): The new HFT server's name. - `serverProc` ([`HFTServerProvideHFTProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTServerProvideHFTProc)): (Required) A user-supplied callback that provides an HFT when given a version number. This procedure is called by ASExtensionMgrGetHFT() when another plug-in imports the HFT. - `destroyProc` ([`HFTServerDestroyProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTServerDestroyProc)): (Optional) A user-supplied callback that destroys the specified HFT (this generally means deallocating the memory associated with the HFT). This procedure is called by HFTDestroy(). - `clientData` (`void *`): A pointer to user-supplied data to pass to the HFT server. **Returns:** [`HFTServer`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTServer) The newly created HFT server. **See also:** [`HFTServerDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTServerDestroy), [`HFTNewEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTNewEx) ### Typedefs (2) #### HFTServerDestroyProc ```cpp typedef void(*) HFTServerDestroyProc(HFTServer hftServer, void *rock)(HFTServer hftServer, void *rock) ``` Header: `ASExpT.h:640` A callback for an HFT server. This destroys the specified HFT (for example, by calling HFTServerDestroy()). **See also:** [`HFTServerNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTServerNew), [`HFTDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTDestroy) #### HFTServerProvideHFTProc ```cpp typedef HFT(*) HFTServerProvideHFTProc(HFTServer hftServer, ASVersion version, void *rock)(HFTServer hftServer, ASVersion version, void *rock) ``` Header: `ASExpT.h:631` A callback for an HFT server. This returns an HFT with the specified version number. If the HFT has not yet been created, create and return it. If the HFT already exists, do not create a new copy of it; simply return the existing copy. **Note:** The version numeric type has changed in Acrobat 6.0. **See also:** [`HFTServerNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTServerNew) ### Structures (1) #### HFTServer ```cpp typedef struct _t_HFTServer* HFTServer ``` Header: `ASExpT.h:614` Each HFT is serviced by an HFT server. The HFT server is responsible for handling requests to obtain or destroy its HFT. An `HFTServer` is an object that manages several versions of an HFT for different clients which may have been compiled with different versions of the HFT's API. **See also:** [`HFTServerNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTServerNew), [`HFTServerDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFTServerDestroy) --- # COS Layer Source: https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer ## CosArray ### Functions (9) #### CosArrayGet ```cpp CosObj CosArrayGet(CosObj array, ASTArraySize index) ``` Header: `CosProcs.h:791` Gets the specified element from an array. @since **Parameters** - `array` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The array from which an element is obtained. - `index` ([`ASTArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize)): The array element to obtain. The first element in an array has an index of zero. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) **See also:** [`CosArrayLength`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosArrayLength), [`CosArrayPut`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosArrayPut), [`CosArrayInsert`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosArrayInsert) #### CosArrayInsert ```cpp void CosArrayInsert(CosObj array, ASTArraySize pos, CosObj obj) ``` Header: `CosProcs.h:844` Inserts an object into an array. An exception is raised if the object to insert is a direct object that is already contained in another object, or if the object to insert belongs to another document. It is not safe to call `CosArrayInsert()` during a call to `CosObjEnum()` on that same array (for example, from within the callback procedure). **Parameters** - `array` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The array into which the object is inserted. - `pos` ([`ASTArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize)): The location in the array to insert the object. The object is inserted before the specified location. The first element in an array has a pos of zero. If `pos >= CosArrayLength(array)`, `obj` is added at the end of the array. The length of the array always increases by `1`. - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The object to insert. **Returns:** `void` **See also:** [`CosArrayLength`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosArrayLength), [`CosArrayRemove`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosArrayRemove), [`CosArrayGet`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosArrayGet) #### CosArrayIsWeakReference ```cpp ASBool CosArrayIsWeakReference(CosObj array, ASInt32 n) ``` Header: `CosProcs.h:2110` Return the state of a weak reference in an array. See `CosDictIsWeakReference()` for details. **Parameters** - `array` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): An array. - `n` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The index of an item in the array. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) Returns the value of the `isWeak` parameter in the most recent call to `CosArraySetWeakReference()` with these parameters, or `false` if there has been no such call. #### CosArrayLength ```cpp ASTArraySize CosArrayLength(CosObj array) ``` Header: `CosProcs.h:874` Gets the number of elements in `array`. **Parameters** - `array` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): IN/OUT The array for which the number of elements is determined. **Returns:** [`ASTArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize) The number of elements in `array`. #### CosArrayPut ```cpp void CosArrayPut(CosObj array, ASTArraySize index, CosObj obj) ``` Header: `CosProcs.h:818` Puts the specified object into the specified location in an array. The array is extended as much as necessary and `NULL` objects are stored in empty slots. It sets the `PDDocNeedsSave` flag (see `PDDocSetFlags`) flag of the `array` object's CosDoc if `array` is indirect or is a direct object with an indirect composite object at the root of its container chain. It is not safe to call `CosArrayPut()` during a call to `CosObjEnum()` on that same array (for example, from within the callback procedure), if doing so would extend the length of the array. An exception is raised if the object to insert is a direct object that is already contained in another object, or if the object to insert belongs to another document. **Parameters** - `array` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The array in which `obj` is stored. - `index` ([`ASTArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize)): The location in `array` to store `obj`. The first element of an array has an index of zero. - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The Cos object to insert into `array`. **Returns:** `void` **See also:** [`CosArrayLength`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosArrayLength), [`CosArrayGet`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosArrayGet), [`CosArrayInsert`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosArrayInsert) #### CosArrayRemove ```cpp void CosArrayRemove(CosObj array, CosObj obj) ``` Header: `CosProcs.h:865` Finds the first element, if any, equal to the specified object and removes it from the array. `CosObjEqual()` is used to determine whether an array element is equal to the specified object. The array is compressed after removing the element. The compression is accomplished by moving each element following the deleted element to the slot with the next smaller index and decrementing the array's length by `1`. It is not safe to call `CosArrayRemove()` during a call to `CosObjEnum()` on that same dictionary (for example, from within the callback procedure). **Parameters** - `array` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The array from which `obj` is removed. - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The object to remove. **Returns:** `void` **See also:** [`CosArrayInsert`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosArrayInsert) #### CosArrayRemoveNth ```cpp void CosArrayRemoveNth(CosObj array, ASTArraySize pos) ``` Header: `CosProcs.h:1344` Checks whether the position is within the array bounds, removes it from the array, moves each subsequent element to the slot with the next smaller index, and decrements the array's length by `1`. It sets the `dirty` flag of the `array` object's `CosDoc`. **Parameters** - `array` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): IN/OUT The `CosArray` from which to remove the member. - `pos` ([`ASTArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize)): IN/OUT The index for the array member to remove. Array indices start at `0`. **Returns:** `void` **See also:** [`CosArrayRemove`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosArrayRemove) #### CosArraySetWeakReference ```cpp void CosArraySetWeakReference(CosObj array, ASInt32 n, ASBool isWeak) ``` Header: `CosProcs.h:2099` Establishes or removes a weak reference from an array. For a description of weak references, see `CosDictSetWeakReference()`. **Parameters** - `array` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): An array. - `n` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The index of the element that is the weak reference. Note that the weak reference *travels* with the element; that is, if an item is marked as a weak reference, and an item is subsequently inserted before that item, the weak reference applies to the same element as it did previously. - `isWeak` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): Sets a weak reference for an array. **Returns:** `void` #### CosNewArray ```cpp CosObj CosNewArray(CosDoc dP, ASBool indirect, ASTArraySize nElements) ``` Header: `CosProcs.h:255` Creates and returns a new array Cos object. **Parameters** - `dP` ([`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc)): The document in which the array is used. - `indirect` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): If `true`, it creates the array as an indirect Cos object, and sets the document's `PDDocNeedsSave` flag (see `PDDocSetFlags`). If `false`, it creates the array as a direct object. - `nElements` ([`ASTArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize)): The number of elements that will be in the array. `nElements` is only a hint; Cos arrays grow dynamically as needed. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) The newly created array Cos object. **See also:** [`CosObjDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjDestroy), [`CosArrayGet`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosArrayGet), [`CosArrayInsert`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosArrayInsert), [`CosArrayLength`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosArrayLength), [`CosArrayPut`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosArrayPut), [`CosArrayRemove`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosArrayRemove) ## CosBoolean ### Functions (2) #### CosBooleanValue ```cpp ASBool CosBooleanValue(CosObj obj) ``` Header: `CosProcs.h:530` Gets the value of the specified boolean object. An exception is raised if `obj` has the wrong Cos type. **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The boolean Cos object whose value is obtained. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) The value of `obj`. **See also:** [`CosNewBoolean`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewBoolean) #### CosNewBoolean ```cpp CosObj CosNewBoolean(CosDoc dP, ASBool indirect, ASBool value) ``` Header: `CosProcs.h:194` Creates a new boolean object associated with the specified document and having the specified value. **Parameters** - `dP` ([`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc)): IN The document in which the boolean is used. - `indirect` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): IN If `true`, it creates the boolean object as an indirect object, and sets the document (`dP`) object's `PDDocNeedsSave` flag (see `PDDocFlags`). If `false`, it creates the boolean object as a direct object. - `value` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): IN The value the new boolean object will have. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) A Cos boolean object. **See also:** [`CosBooleanValue`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosBooleanValue), [`CosObjDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjDestroy) ## CosCrypt ### Functions (5) #### CosCryptGetVersion ```cpp ASTVersion CosCryptGetVersion() ``` Header: `CosProcs.h:1390` Gets the current version number of the encryption algorithm supported. **Returns:** [`ASTVersion`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTVersion) The current version number of the encryption supported. **See also:** [`CosDecryptGetMaxKeyBytes`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDecryptGetMaxKeyBytes), [`CosEncryptGetMaxKeyBytes`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosEncryptGetMaxKeyBytes) #### CosDecryptData ```cpp void CosDecryptData(void *src, ASTArraySize len, void *dst, char *cryptData, ASTArraySize cryptDataLen) ``` Header: `CosProcs.h:1005` Decrypts data in a buffer using the specified encryption key. The standard Acrobat viewer encryption/decryption algorithm (RC4 from RSA Data Security, Inc.) is used. An exception is raised if encryption encounters an internal error. **Parameters** - `src` (`void *`): The buffer containing the data to decrypt. - `len` ([`ASTArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize)): The number of bytes in `src`. - `dst` (`void *`): (Filled by the method) The buffer into which the decrypted data will be placed. This may point to the same location as `src`. - `cryptData` (`char *`): The encryption key. - `cryptDataLen` ([`ASTArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize)): The length of the encryption key in bytes. It cannot be greater than `5`. **Returns:** `void` **See also:** [`CosEncryptData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosEncryptData) #### CosDecryptGetMaxKeyBytes ```cpp CosByteMax CosDecryptGetMaxKeyBytes(ASTVersion cryptVersion) ``` Header: `CosProcs.h:1406` Gets the maximum number of the decryption key length, in bytes, for the specified `cryptVersion`. **Parameters** - `cryptVersion` ([`ASTVersion`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTVersion)): IN/OUT The Cos crypt version, which is the version of the algorithm that is used to encrypt and decrypt document data. `cryptVersion` equal to `0` is treated as `cryptVersion` equal to `1` to maintain backward compatibility. **Returns:** [`CosByteMax`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosByteMax) The maximum number of key length, in bytes, for the specified `cryptVersion`. If `cryptVersion` is not currently supported, it returns `-1`. **See also:** [`CosCryptGetVersion`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosCryptGetVersion), [`CosEncryptGetMaxKeyBytes`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosEncryptGetMaxKeyBytes) #### CosEncryptData ```cpp void CosEncryptData(void *src, ASTArraySize len, void *dst, char *cryptData, ASTArraySize cryptDataLen) ``` Header: `CosProcs.h:1027` Encrypts data in a buffer using the specified encryption key. The standard Acrobat viewer encryption/decryption algorithm (RC4 from RSA Data Security, Inc.) is used. An exception is raised if encryption encounters an internal error. **Parameters** - `src` (`void *`): The buffer containing the data to encrypt. - `len` ([`ASTArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize)): The number of bytes in `src`. - `dst` (`void *`): (Filled by the method) The buffer into which the encrypted data will be placed. This may point to the same location as `src`. - `cryptData` (`char *`): The encryption key. - `cryptDataLen` ([`ASTArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize)): Length of the encryption key, in bytes. It cannot be greater than `5`. **Returns:** `void` **See also:** [`CosDecryptData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDecryptData) #### CosEncryptGetMaxKeyBytes ```cpp CosByteMax CosEncryptGetMaxKeyBytes(ASTVersion cryptVersion) ``` Header: `CosProcs.h:1422` Gets the maximum number of the encryption key length, in bytes, for the specified `cryptVersion`. **Parameters** - `cryptVersion` ([`ASTVersion`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTVersion)): IN/OUT The Cos crypt version, which is the version of the algorithm that is used to encrypt and decrypt document data. `cryptVersion` equal to `0` is treated as `cryptVersion` equal to `1` to maintain backward compatibility. **Returns:** [`CosByteMax`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosByteMax) The maximum number of key length, in bytes, for the specified `cryptVersion`. If `cryptVersion` is not currently supported, it returns `-1`. **See also:** [`CosCryptGetVersion`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosCryptGetVersion), [`CosDecryptGetMaxKeyBytes`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDecryptGetMaxKeyBytes) ### Typedefs (2) #### CosCryptVersion ```cpp typedef ASInt32 CosCryptVersion ``` Header: `CosExpT.h:42` #### CosCryptStringProc ```cpp typedef ASInt32(*) CosCryptStringProc(CosDoc dP, ASAtom filterName, char *dest, char *src, ASInt32 dstSize, ASInt32 srcLength, ASUns32 genNumber, ASUns32 objNumber)(CosDoc dP, ASAtom filterName, char *dest, char *src, ASInt32 dstSize, ASInt32 srcLength, ASUns32 genNumber, ASUns32 objNumber) ``` Header: `CosExpT.h:329` A prototype for the string encryption/decryption callback. This is part of the Crypt Filter mechanism. ## CosDict ### Functions (15) #### CosDictGet ```cpp CosObj CosDictGet(CosObj dict, ASAtom key) ``` Header: `CosProcs.h:633` Gets the value of the specified key in the specified dictionary. If it is called with a stream object instead of a dictionary object, this method gets the value of the specified key from the stream's attributes dictionary. @note Use CosObjEnum() to list all key-value pairs in a dictionary. @since **Parameters** - `dict` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The dictionary or stream from which a value is obtained. - `key` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The key whose value is obtained, repesented as an ASAtom. See the description of "Dictionary Objects" in ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.3.7, page 18. You can find this document on the web store of the International Standards Organization (ISO). Here you will find the names of keys in dictionary objects that are part of standard PDF, such as annotations or page objects (for example, `CosDictGet(dict, ASAtomFromString("Length"))` ). Note that strings can be used directly as keys, by calling `CosDictGetKeyString()` (for example, CosDictGetKeyString(dict, "Length") ). This method is preferred, because it avoids the creation of new ASAtom objects. **Key Names:** Even though key names in a PDF file are written with a leading slash (e.g., `<>`), the slash is omitted when creating an `ASAtom` to be used as a key, or when using the string directly as a key, as in the examples above. Cos name objects can also be used as keys, by calling `CosDictGetKey()`. This method will also avoid the creation of new `ASAtom` objects and is often more convenient than using `ASAtom` objects or strings.`key` is not present or if its value is `NULL` (which is equivalent), it returns a `NULL` Cos object (a Cos object of type `CosNull`.) **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) **See also:** [`CosDictGetKey`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictGetKey), [`CosDictGetKeyString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictGetKeyString), [`CosDictPut`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictPut), [`CosDictPutKey`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictPutKey), [`CosDictPutKeyString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictPutKeyString), [`CosDictKnown`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictKnown), [`CosDictKnownKey`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictKnownKey), [`CosDictKnownKeyString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictKnownKeyString), [`CosStreamDict`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosStreamDict) #### CosDictGetKey ```cpp CosObj CosDictGetKey(CosObj dict, CosObj key) ``` Header: `CosProcs.h:1917` Gets the value of the specified key in the specified dictionary. For more details, see `CosDictGet()`. **Parameters** - `dict` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The dictionary or stream from which a value is obtained. - `key` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The key whose value is obtained, represented as a Cos name object. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) The object associated with the specified key. If `key` is not present, it returns a `NULL` Cos object. **See also:** [`CosDictGet`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictGet), [`CosDictGetKeyString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictGetKeyString) #### CosDictGetKeyString ```cpp CosObj CosDictGetKeyString(CosObj dict, const char *key) ``` Header: `CosProcs.h:1981` Gets the value of the specified key in the specified dictionary. For more details, see `CosDictGet()`. **Parameters** - `dict` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The dictionary or stream from which a value is obtained. - `key` (`const char *`): The key whose value is obtained, represented as a string. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) The object associated with the specified key. If key is not present, returns a `NULL` Cos object. **See also:** [`CosDictGet`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictGet), [`CosDictGetKey`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictGetKey) #### CosDictIsWeakReference ```cpp ASBool CosDictIsWeakReference(CosObj dict, const char *key) ``` Header: `CosProcs.h:2084` Gets the state of a weak reference. For details, see `CosDictSetWeakReference()`. **Parameters** - `dict` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): A dictionary. - `key` (`const char *`): The name of a key. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) Returns the value of the `isWeak` parameter in the most recent call to CosDictSetWeakReference() with these parameters, or `false` if there has been no such call. #### CosDictKnown ```cpp ASBool CosDictKnown(CosObj dict, ASAtom key) ``` Header: `CosProcs.h:775` Tests whether a specific key is found in the specified dictionary. Calling this method is equivalent to checking if the value returned from `CosDictGet()` is a `NULL` Cos object. If it is called with a stream object instead of a dictionary object, this method tests whether the specified key is found in the stream's attributes dictionary. You can find this document on the web store of the International Standards Organization (ISO). Here you will find the names of keys in dictionary objects that are part of standard PDF, such as annotations or page objects (see `CosDictGet()` for **Key Names**). Note that strings can be used directly as keys, by calling `CosDictKnownKeyString()` (for example, `CosDictKnownKeyString(dict, "Length")`). This method is preferred, because it avoids the creation of new `ASAtom` objects. Cos name objects can also be used as keys, by calling `CosDictKnownKey()`. This method will also avoid the creation of new `ASAtom` objects and is often more convenient than using `ASAtom` objects or strings. **Parameters** - `dict` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The dictionary or stream in which to look for `key`. - `key` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The key to find. See the description of "Dictionary Objects" in ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.3.7, page 18. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the value of a key is known (exists and is not `NULL`) in `dict`, `false` otherwise. **See also:** [`CosDictGet`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictGet), [`CosDictGetKey`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictGetKey), [`CosDictGetKeyString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictGetKeyString), [`CosDictPut`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictPut), [`CosDictPutKey`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictPutKey), [`CosDictPutKeyString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictPutKeyString), [`CosDictKnownKey`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictKnownKey), [`CosDictKnownKeyString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictKnownKeyString), [`CosStreamDict`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosStreamDict) #### CosDictKnownKey ```cpp ASBool CosDictKnownKey(CosObj dict, CosObj key) ``` Header: `CosProcs.h:1933` Tests whether a specific key is found in the specified dictionary. Calling this method is equivalent to checking if the value returned from `CosDictGetKey()` is a `NULL` Cos object. For more details, see CosDictKnown(). **Parameters** - `dict` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The dictionary or stream in which to look for `key`. - `key` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The key to find, represented as a Cos name object. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the value of a key is known (exists and is not `NULL`) in `dict`, `false` otherwise. **See also:** [`CosDictKnownKey`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictKnownKey), [`CosDictKnownKeyString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictKnownKeyString) #### CosDictKnownKeyString ```cpp ASBool CosDictKnownKeyString(CosObj dict, const char *key) ``` Header: `CosProcs.h:1997` Tests whether a specific key is found in the specified dictionary. Calling this method is equivalent to checking if the value returned from `CosDictGetKeyString()` is a `NULL` Cos object. For more details, see `CosDictKnown()`. **Parameters** - `dict` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The dictionary or stream in which to look for key. - `key` (`const char *`): The key to find, represented as a string. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the value of a key is known (exists and is not `NULL`) in `dict`, `false` otherwise. **See also:** [`CosDictKnownKey`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictKnownKey), [`CosDictKnownKeyString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictKnownKeyString) #### CosDictPut ```cpp void CosDictPut(CosObj dict, ASAtom key, CosObj val) ``` Header: `CosProcs.h:688` Sets the value of a dictionary key, adding the key to the dictionary if it is not already present. Sets the `PDDocNeedsSave` flag (see `PDDocSetFlags`) of the `dict` object's `CosDoc` if `dict` is indirect or is a direct object with an indirect composite object at the root of its container chain. This method can also be used with a stream object. In that case, the key-value pair is added to the stream's attributes dictionary. It is not safe to call `CosDictPut()` during a call to `CosObjEnum()` on that same dictionary (for example, from within the callback procedure). An exception is raised if `val` is a direct non-scalar object that is already contained in another dictionary, array, or stream, or if `dict` and `val` belong to different documents. @note A dictionary entry whose value is `NULL` is equivalent to an absent entry; using `CosDictPut()` to put a `NULL` value in a dictionary has the same effect as calling `CosDictRemove()` to remove it from the dictionary. @since **Parameters** - `dict` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The dictionary or stream in which a value is set. - `key` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The key whose value is set, represented as an `ASAtom`. See the description of "Dictionary Objects" in ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.3.7, page 18. You can find this document on the web store of the International Standards Organization (ISO). Here you will find the names of keys in dictionary objects that are part of standard PDF, such as annotations or page objects (see `CosDictGet()` for **Key Names**) Note that strings can be used directly as keys, by calling `CosDictPutKeyString()` (for example, `CosDictPutKeyString(dict, "Length", lenObj)`). This method is preferred, because it avoids the creation of new `ASAtom` objects. Cos name objects can also be used as keys, by calling `CosDictPutKey()`. This method will also avoid the creation of new `ASAtom` objects and is often more convenient than using ASAtom objects or strings. - `val` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The value to set. **Returns:** `void` **See also:** [`CosDictGet`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictGet), [`CosDictGetKey`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictGetKey), [`CosDictGetKeyString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictGetKeyString), [`CosDictPutKey`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictPutKey), [`CosDictPutKeyString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictPutKeyString), [`CosDictKnown`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictKnown), [`CosDictKnownKey`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictKnownKey), [`CosDictKnownKeyString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictKnownKeyString), [`CosStreamDict`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosStreamDict) #### CosDictPutKey ```cpp void CosDictPutKey(CosObj dict, CosObj key, CosObj val) ``` Header: `CosProcs.h:1955` Sets the value of a dictionary key, adding the key to the dictionary if it is not already present. For more details, see `CosDictPut()`. It is not safe to call `CosDictPutKey()` during a call to `CosObjEnum()` on that same dictionary (for example, from within the callback procedure) An exception is raised if `val` is a direct non-scalar object that is already contained in another dictionary, array, or stream, or if `dict` and `val` belong to different documents. @since **Parameters** - `dict` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The dictionary or stream in which a value is set. - `key` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The key whose value is set, represented as a Cos name object. - `val` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The value to set. **Returns:** `void` **See also:** [`CosDictPut`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictPut), [`CosDictPutKeyString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictPutKeyString) #### CosDictPutKeyString ```cpp void CosDictPutKeyString(CosObj dict, const char *key, CosObj val) ``` Header: `CosProcs.h:2018` Sets the value of a dictionary key, adding the key to the dictionary if it is not already present. For more details, see `CosDictPut()`. It is not safe to call `CosDictPutKey()` during a call to `CosObjEnum()` on that same dictionary (for example, from within the callback procedure). An exception is raised if `val` is a direct non-scalar object that is already contained in another dictionary, array, or stream, or if `dict` and `val` belong to different documents. @since **Parameters** - `dict` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The dictionary or stream in which a value is set. - `key` (`const char *`): The key whose value is set, represented as a string. - `val` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The value to set. **Returns:** `void` **See also:** [`CosDictPut`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictPut), [`CosDictPutKey`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictPutKey) #### CosDictRemove ```cpp void CosDictRemove(CosObj dict, ASAtom key) ``` Header: `CosProcs.h:735` Removes a key-value pair from a dictionary. Sets the `PDDocNeedsSave` flag (see `PDDocSetFlags`) of the `dict` object's `CosDoc` if the dictionary is indirect or has an indirect composite object at the root of its container chain. If it is called with a stream object instead of a dictionary object, this method removes the value of the specified key from the stream's attributes dictionary. It is not safe to call `CosDictRemove()` during a call to `CosObjEnum()` on that same dictionary (for example, from within the callback procedure). If the key is not present in the dictionary, `CosDictRemove()` has no effect. You can find this document on the web store of the International Standards Organization (ISO). Here you will find the names of keys in dictionary objects that are part of standard PDF, such as annotations or page objects (see `CosDictGet()` for **Key Names**). Note that strings can be used directly as keys, by calling CosDictRemoveString() (for example, `CosDictRemoveString(dict, "Length")`). This method is preferred, because it avoids the creation of new `ASAtom` objects. Cos name objects can also be used as keys, by calling `CosDictRemoveKey()`. This method will also avoid the creation of new `ASAtom` objects and is often more convenient than using `ASAtom` objects or strings. **Parameters** - `dict` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The dictionary from which the key-value pair is removed. - `key` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The key to remove, represented as an ASAtom. See the description of "Dictionary Objects" in ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.3.7, page 18. **Returns:** `void` **See also:** [`CosDictGet`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictGet), [`CosDictGetKey`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictGetKey), [`CosDictGetKeyString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictGetKeyString), [`CosDictPut`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictPut), [`CosDictPutKey`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictPutKey), [`CosDictPutKeyString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictPutKeyString), [`CosDictKnown`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictKnown), [`CosDictKnownKey`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictKnownKey), [`CosDictKnownKeyString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictKnownKeyString), [`CosDictRemoveKey`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictRemoveKey), [`CosDictRemoveKeyString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictRemoveKeyString), [`CosStreamDict`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosStreamDict) #### CosDictRemoveKey ```cpp void CosDictRemoveKey(CosObj dict, CosObj key) ``` Header: `CosProcs.h:1968` Removes a key-value pair from a dictionary. For more details, see `CosDictRemove()`. **Parameters** - `dict` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The dictionary from which the key-value pair is removed. - `key` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The key to remove, represented as a Cos name object. **Returns:** `void` **See also:** [`CosDictRemove`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictRemove), [`CosDictRemoveKeyString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictRemoveKeyString) #### CosDictRemoveKeyString ```cpp void CosDictRemoveKeyString(CosObj dict, const char *key) ``` Header: `CosProcs.h:2030` Removes a key-value pair from a dictionary. For more details, see `CosDictRemove()`. **Parameters** - `dict` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The dictionary from which the key-value pair is removed. - `key` (`const char *`): The key to remove, represented as a string. **Returns:** `void` **See also:** [`CosDictRemove`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictRemove), [`CosDictRemoveKey`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictRemoveKey) #### CosDictSetWeakReference ```cpp void CosDictSetWeakReference(CosObj dict, const char *key, ASBool isWeak) ``` Header: `CosProcs.h:2073` *Weak* and *strong* references. When a Cos document is saved in full-save mode, objects that are not accessible from the root of the document are destroyed. This process uses a mark-and-sweep garbage collector: the root is marked, and then every object to which it refers is marked, and so on. At the end of this marking phase, objects that are not marked are destroyed. A so-called weak reference changes this policy: during the marking phase, a reference that has been declared to be weak will not be marked. For example, when a dictionary is marked, all its keys and values are normally also marked. But if a certain key has been set as a weak reference, then the corresponding value will not be marked. Consequently, if there are no other references to that value, it will be destroyed. A so-called strong reference also changes this policy, but in the opposite direction. An object for which there is a strong reference will be marked (and therefore will not be garbage-collected), even if there is no path to the object from the root of the document, and even if a weak reference exists for it. `CosDictSetWeakReference()` establishes or removes a weak reference from a dictionary. It is not an error if there is no such value at the time of garbage collection or at the time of the call to this function. If `isWeak` is `false` (the default condition), then there is no such behavior, and the value, if any, will be marked in the normal manner. The case where `isWeak` is specified as `false` is intended primarily to reverse the effect of a previous call in which `isWeak` was `true`. **Parameters** - `dict` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The dictionary containing the weak reference. - `key` (`const char *`): The name of a key in the dictionary. - `isWeak` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): If `true`, the object stored in `dict` under `key` at the time of every subsequent full-save garbage collection will not be marked as a component of the dictionary. If there is no other path to that object from the root of the document, then it will be garbage- collected (destroyed) by garbage collection. **Returns:** `void` #### CosNewDict ```cpp CosObj CosNewDict(CosDoc dP, ASBool indirect, ASTArraySize nEntries) ``` Header: `CosProcs.h:283` Creates a new dictionary. For information on dictionary objects in standard PDF files, such as annotations or page objects, see the description of "Dictionary Objects" in ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.3.7, page 18. You can find this document on the web store of the International Standards Organization (ISO). **Parameters** - `dP` ([`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc)): The document in which the dictionary is used. - `indirect` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): If `true`, it creates the dictionary as an indirect Cos object, and sets the `dP` object's `PDDocNeedsSave` flag (see `PDDocFlags`). If `false`, it creates the dictionary as a direct object. - `nEntries` ([`ASTArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize)): The number of entries in the dictionary. This value is only a hint; Cos dictionaries grow dynamically as needed. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) The newly created dictionary Cos object. **See also:** [`CosDictGet`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictGet), [`CosDictKnown`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictKnown), [`CosDictPut`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictPut), [`CosDictRemove`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictRemove), [`CosObjDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjDestroy) ## CosDoc ### Functions (21) #### CosDocClose ```cpp void CosDocClose(CosDoc cosDoc) ``` Header: `CosProcs.h:1074` Closes a Cos document. You should only call this method with a document obtained via `CosDocOpenWithParams()` to release resources used by the Cos document. **Parameters** - `cosDoc` ([`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc)): IN/OUT The document to close. **Returns:** `void` **See also:** [`CosDocOpenWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocOpenWithParams) #### CosDocCreate ```cpp CosDoc CosDocCreate(ASFlagBits createFlags) ``` Header: `CosProcs.h:1085` Creates an empty Cos document. **Parameters** - `createFlags` ([`ASFlagBits`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFlagBits)): An inclusive OR of bit flags that specify the attributes of a CosDoc when created by `CosDocCreate()`. The only flag currently defined is `cosDocCreateInfoDict (0x01)`, which creates an Info dictionary for the document. **Returns:** [`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc) An empty Cos document. **See also:** [`CosDocSaveToFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocSaveToFile) #### CosDocEnumEOFs ```cpp ASBool CosDocEnumEOFs(CosDoc cosDoc, CosDocEnumEOFsProc proc, void *clientData) ``` Header: `CosProcs.h:1274` Calls the specified procedure for each EOF in a given `CosDoc`, where the EOF is a position in a PDF file after a `%%EOF` keyword that marks the end of either a main cross-reference section, or an update cross-reference section that corresponds to an incremental save. Not every `%%EOF` keyword fits these criteria. For example, the first `%%EOF` in a linearized (optimized for the web) file does not, so its position is not be passed to `proc`. If `cosDoc` was created in memory (using CosDocCreate()), or if it was damaged and needed to be repaired, the procedure is not called at all. **Parameters** - `cosDoc` ([`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc)): The `CosDoc` in which the EOF's are enumerated. - `proc` ([`CosDocEnumEOFsProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocEnumEOFsProc)): The `CosDocEnumEOFsProc()` to call for each EOF. - `clientData` (`void *`): A pointer to user-supplied data to pass to `proc` each time it is called. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) **See also:** [`CosDocEnumIndirect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocEnumIndirect), [`CosDocEnumEOFs64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocEnumEOFs64) #### CosDocEnumEOFs64 ```cpp ASBool CosDocEnumEOFs64(CosDoc cosDoc, CosDocEnumEOFsProc64 proc, void *clientData) ``` Header: `CosProcs.h:2210` Calls the specified procedure for each EOF in a given `CosDoc`. For details, see `CosDocEnumEOFs()`. This is the same as `CosDocEnumEOFs()`, except that the callback proc takes a 64-bit file position instead of a 32-bit file position. **Parameters** - `cosDoc` ([`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc)): The `CosDoc` in which the EOF's are enumerated. - `proc` ([`CosDocEnumEOFsProc64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocEnumEOFsProc64)): The `CosDocEnumEOFsProc64()` to call for each EOF. - `clientData` (`void *`): A pointer to user-supplied data to pass to `proc` each time it is called. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if all of the calls to `proc` return `true`, `false` as soon as a call to `proc` returns `false`. **See also:** [`CosDocEnumIndirect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocEnumIndirect), [`CosDocEnumEOFs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocEnumEOFs) #### CosDocEnumIndirect ```cpp ASBool CosDocEnumIndirect(CosDoc dP, CosObjEnumProc proc, void *clientData) ``` Header: `CosProcs.h:1378` Enumerates all the indirect objects of a given `CosDoc`. The objects are enumerated in no particular order. Successive enumerations of the same Cos document are not guaranteed to enumerate objects in the same order. This method does not enumerate invalid objects, which include objects that are defined as `NULL`, objects that are not defined at all (those having no cross-reference entry), and objects that are on the free list. See the description of "Indirect Objects" in section 7.3.10 in ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.11.2, page 21. You can find this document on the web store of the International Standards Organization (ISO). This re-raises any exception that `proc` raises. **Parameters** - `dP` ([`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc)): The `CosDoc` whose indirect objects are enumerated. - `proc` ([`CosObjEnumProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjEnumProc)): A user-supplied callback to call for each indirect object in `dP`. Enumeration ends when `proc` returns `false` or all indirect objects have been enumerated. The value parameter returned in `proc` is always the `NULL` Cos object. - `clientData` (`void *`): A pointer to user-supplied data to pass to `proc` each time it is called. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if all of the calls to `proc` returned `true`. It returns `false` as soon as a call to `proc` returns `false`. **See also:** [`CosObjEnum`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjEnum) #### CosDocGetAdobeExtensionLevel ```cpp ASBool CosDocGetAdobeExtensionLevel(CosDoc dP, CosObj *baseVersion, ASUns32 *extension) ``` Header: `CosProcs.h:2442` Tests whether the supplied `CosDoc` contains the Adobe Extensions Dictionary for the ISO 32000 standard, and if so, returns the BaseVersion and ExtensionLevel 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](https://www.adobe.com/devnet/pdf/pdf_reference.html) 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](https://www.adobe.com/devnet/pdf/pdf_reference.html) **Parameters** - `dP` ([`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc)): IN The Cos document to test. - `baseVersion` ([`CosObj *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): OUT The PDF version on which the extensions are based (will be of type `CosName`). - `extension` ([`ASUns32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): OUT The level of the extension expressed as a monotonically increasing integer. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the file contains the Adobe Extensions dictionary for the ISO 32000 standard, `false` otherwise. **See also:** [`CosDocHasISOExtensions`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocHasISOExtensions), [`CosDocSetAdobeExtensionLevel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocSetAdobeExtensionLevel) #### CosDocGetID ```cpp ASBool CosDocGetID(CosDoc dP, CosByte **pInstanceID, CosByte **pPermaID, ASTCount *instIDLength, ASTCount *permIDLength) ``` Header: `CosProcs.h:1506` Returns two ID byte arrays identifying the CosDoc. The client should copy these arrays before making the next call to Acrobat. **Parameters** - `dP` ([`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc)): IN/OUT The CosDoc whose ID byte arrays are returned. - `pInstanceID` ([`CosByte **`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosByte)): IN/OUT (Filled by the method) The instance ID. - `pPermaID` ([`CosByte **`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosByte)): IN/OUT (Filled by the method) The permanent ID. - `instIDLength` ([`ASTCount *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTCount)): IN/OUT The length of `pInstanceID` in bytes. - `permIDLength` ([`ASTCount *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTCount)): IN/OUT The length of `pPermaID` in bytes. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the ID is returned, `false` otherwise. #### CosDocGetInfoDict ```cpp CosObj CosDocGetInfoDict(CosDoc dP) ``` Header: `CosProcs.h:981` Gets the specified document's `Info` dictionary. In general, access the document's `Info` dictionary using PDDocGetInfo() and `PDDocSetInfo()` wherever possible. **Parameters** - `dP` ([`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc)): IN/OUT The document whose `Info` dictionary is obtained. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) The document's `Info` dictionary Cos object. **See also:** [`CosDocGetRoot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocGetRoot), [`PDDocGetInfo`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetInfo), [`PDDocSetInfo`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetInfo) #### CosDocGetObjByID ```cpp CosObj CosDocGetObjByID(CosDoc dP, CosID objNum) ``` Header: `CosProcs.h:1200` Gets the indirect `CosObj` with the latest generation number. **Parameters** - `dP` ([`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc)): The `CosDoc` to search for the matching Cos object. - `objNum` ([`CosID`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosID)): The local master index for the indirect Cos object to return. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) The `CosObj` with the latest generation number whose ID (object number) equals `objNum`, or the `NULL` object if there is no object with this ID. **See also:** [`CosObjGetID`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjGetID) #### CosDocGetRoot ```cpp CosObj CosDocGetRoot(CosDoc dP) ``` Header: `CosProcs.h:967` Gets the `Catalog` (the root object) for the specified document. See the description of the Document Catalog in "Common Data Structures" in ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.7.2, page 71. You can find this document on the web store of the International Standards Organization (ISO). **Parameters** - `dP` ([`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc)): IN/OUT The document whose `Catalog` is obtained. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) The document's `Catalog` dictionary Cos object. **See also:** [`CosDocGetInfoDict`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocGetInfoDict) #### CosDocHasFullCompression ```cpp ASBool CosDocHasFullCompression(CosDoc doc) ``` Header: `CosProcs.h:1798` Tests whether the Cos document is fully compressed. In a fully compressed document, most objects are stored in object streams, which are normally Flate-encoded to reduce the size of the PDF file. Cross-reference information for these objects is stored in cross-reference streams, which are also normally Flate-encoded. See the description of "Cross-Reference Streams" in ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.5.8, page 49. You can find this document on the web store of the International Standards Organization (ISO). **Parameters** - `doc` ([`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc)): The document whose compression is checked. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the document is fully compressed, `false` otherwise. **See also:** [`CosDocHasPartialCompression`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocHasPartialCompression) #### CosDocHasISOExtensions ```cpp ASBool CosDocHasISOExtensions(CosDoc dP) ``` Header: `CosProcs.h:2420` Tests whether the supplied `CosDoc` contains the Adobe Extensions Dictionary for the ISO 32000 standard. 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](https://www.adobe.com/devnet/pdf/pdf_reference.html) 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](https://www.adobe.com/devnet/pdf/pdf_reference.html) **Parameters** - `dP` ([`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc)): The Cos document to test. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the file contains the Adobe Extensions dictionary for the ISO 32000 standard, `false` otherwise. **See also:** [`CosDocGetAdobeExtensionLevel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocGetAdobeExtensionLevel), [`CosDocSetAdobeExtensionLevel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocSetAdobeExtensionLevel) #### CosDocHasPartialCompression ```cpp ASBool CosDocHasPartialCompression(CosDoc doc) ``` Header: `CosProcs.h:1828` Tests whether the Cos document is partially compressed. In a partially compressed file, the size of the logical structure information is reduced. Current PDF viewers have full access to the structure information. In a partially compressed document, objects related to logical structure are stored in object streams, which are normally Flate-encoded to compress the document. Their cross-reference information is stored twice: in a cross-reference stream, to which there is a reference in the trailer of an update section, and in the main cross-reference table, which indicates that the objects are on the free list. See the description of "Cross-Reference Streams" in section 7.5.8 in ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, page 49. You can find this document on the web store of the International Standards Organization (ISO). See also the decription of the "Cross-Reference Table" in section 7.5.3, page 40. **Parameters** - `doc` ([`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc)): The document whose compression is checked. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the document is partially compressed, `false` otherwise. **See also:** [`CosDocHasFullCompression`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocHasFullCompression) #### CosDocObjIsWithinRange ```cpp ASBool CosDocObjIsWithinRange(CosObj obj, ASInt32 byteRanges[], ASInt32 numEntries) ``` Header: `CosProcs.h:1577` Tests whether the definition of a specified Cos object, in the file associated with the object's CosDoc, begins within any of a set of byte ranges. The test is inclusive; that is the object may begin at the first or last byte of a range. An exception is raised if `obj` is a direct object or `numEntries` is an odd number. **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The Cos object (must be indirect). - `byteRanges` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): An array containing pairs of byte offsets within the document. Each pair is a start and end offset from the beginning of the document. - `numEntries` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The number of byte offsets (not pairs) in the `byteRanges` array. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the object begins within any of the given ranges and has not been modified, `false` otherwise. #### CosDocObjIsWithinRange64 ```cpp ASBool CosDocObjIsWithinRange64(CosObj obj, ASFilePos64 byteRanges[], ASInt32 numEntries) ``` Header: `CosProcs.h:2263` Tests whether the definition of a specified Cos object, in the file associated with the object's `CosDoc`, begins within any of a set of byte ranges. For details, see `CosDocObjIsWithinRange()`. This is the same as `CosDocObjIsWithinRange()`, except that the byte ranges are 64-bit file positions instead of a 32-bit file positions. An exception is raised if `obj` is a direct object or `numEntries` is an odd number. **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The Cos object (must be indirect). - `byteRanges` ([`ASFilePos64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFilePos64)): An array containing pairs of byte offsets within the document. Each pair is a start and end offset from the beginning of the document. - `numEntries` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The number of byte offsets (not pairs) in the `byteRanges` array. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the object begins within any of the given ranges and has not been modified, `false` otherwise. #### CosDocOpenWithParams ```cpp CosDoc CosDocOpenWithParams(CosDocOpenParams params) ``` Header: `CosProcs.h:1064` Opens a Cos document. The document does not need to be a PDF document. In `params`, the client specifies a file system and path name from which to open the document. The client may also specify a header string other than `"%PDF-"`. For example, a client might want to open a private file type, such as `"%FDF-"`. Various exceptions may be raised. Opening non-Cos docs with this API is unsupported and may lock the file after an open attempt. If the `doRepair` flag is set in the open flags, a minimal document can be opened. A minimal document contains the header string and a trailer dictionary. It may contain indirect objects before the trailer dictionary, and the trailer dictionary can refer to those objects, as shown in the following example: `FDF-1.0` `1 0 obj` `<< /Version /1.5` `/FDF << /F 20 0 R /JavaScript 5 0 R >>` `>>` `trailer` `<<` `/Root 1 0 R` `>>` **Parameters** - `params` (`CosDocOpenParams`): Specifies how to open the document. **Returns:** [`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc) A Cos document. **See also:** [`CosDocClose`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocClose) #### CosDocSaveToFile ```cpp void CosDocSaveToFile(CosDoc cosDoc, ASFile asFile, CosDocSaveFlags saveFlags, CosDocSaveParams saveParams) ``` Header: `CosProcs.h:1131` Saves a Cos document to a file handle. `CosDocSaveToFile()` will not generate an cross-reference table in the saved file. If you want the cross-reference to be generated, then you have to use `CosDocSaveWithParams()`, which generates the cross-reference table by default. **Parameters** - `cosDoc` ([`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc)): The document to save. - `asFile` ([`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): The file to which the document is written; it must be open in write mode. This file is not necessarily position-able. - `saveFlags` ([`CosDocSaveFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocSaveFlags)): An `OR` of the `CosDocSaveFlags` bit flag values specifying how to save the document. - `saveParams` (`CosDocSaveParams`): Optional parameters for use when saving a document, as described in `CosDocSaveParams()`. **Returns:** `void` **Exceptions** - `cosErrAfterSave` - `cosErrNeedFullSave` - `genErrBadParm` - `cosErrAfterSave` - `cosErrNeedFullSave` - `genErrBadParm` **See also:** [`CosDocCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocCreate), [`CosDocSaveWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocSaveWithParams) **Since:** `Saves a Cos document to a file. CosDocSaveToFile() will not generate a cross-reference index (table or stream) in the saved file. If you want the index to be generated, then you must use CosDocSaveWithParams() , which generates it by default.` #### CosDocSaveWithParams ```cpp void CosDocSaveWithParams(CosDoc cosDoc, ASFile asFile, CosDocSaveFlags saveFlags, CosDocSaveParams saveParams) ``` Header: `CosProcs.h:1245` Saves a Cos document, optionally to a new file handle. It generates an cross-reference table by default. **Parameters** - `cosDoc` ([`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc)): The `CosDoc` for the document to save. - `asFile` ([`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): The file to which the document will be written. This file must already be open in write mode. If you pass `NULL`, `cosDoc` is saved to the file with which it was originally associated. - `saveFlags` ([`CosDocSaveFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocSaveFlags)): An `OR` of the `CosDocSaveFlags` bit flag values specifying how to save the document. - `saveParams` (`CosDocSaveParams`): `CosDocSaveParams` parameters for use when saving the `CosDoc` document. **Returns:** `void` **Exceptions** - `cosErrAfterSave` - `cosErrNeedFullSave` - `genErrBadParm` - `cosErrAfterSave` - `cosErrNeedFullSave` - `genErrBadParm` **See also:** [`CosDocCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocCreate), [`CosDocSaveToFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocSaveToFile) **Since:** `Saves a Cos document, optionally to a new file. It generates a cross-reference index (table or stream) by default.` #### CosDocSetAdobeExtensionLevel ```cpp void CosDocSetAdobeExtensionLevel(CosDoc dP, CosObj baseVersion, ASUns32 extension) ``` Header: `CosProcs.h:2460` Adds the necessary data structures to the supplied `CosDoc` to identify it as containing the Adobe Extensions Dictionary for the ISO 32000 standard. 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](https://www.adobe.com/devnet/pdf/pdf_reference.html) **Parameters** - `dP` ([`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc)): The Cos document to set. - `baseVersion` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The PDF version on which the extensions are based (will be of type `CosName`). - `extension` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The level of the extension expressed as a monotonically increasing integer. **Returns:** `void` **See also:** [`CosDocHasISOExtensions`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocHasISOExtensions), [`CosDocGetAdobeExtensionLevel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocGetAdobeExtensionLevel) #### CosDocSetDirty ```cpp void CosDocSetDirty(CosDoc cosDoc, ASBool isDirty) ``` Header: `CosProcs.h:1146` Sets a Cos document's `dirty` flag to a given boolean value. If this flag is `true` when the document is closed, it indicates that the document must be saved to preserve changes. **Parameters** - `cosDoc` ([`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc)): The Cos document whose `dirty` flag is set. - `isDirty` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): `true` if dirty, `false` otherwise. **Returns:** `void` **See also:** [`CosDocSaveToFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocSaveToFile), [`CosDocSaveWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocSaveWithParams) #### CosSetMaxDocStorage ```cpp void CosSetMaxDocStorage(ASInt32 maxMemory) ``` Header: `CosProcs.h:1553` Puts a limit on the amount of memory (RAM) that can be used to store Cos objects per doc. The default, minimum and maximum values of this limit are 30 MB, 512 KB and 40 MB respectively. This method can be used to increase or decrease the amount of memory reserved for Cos objects within this limit. Beyond the limit, Cos objects may be stored on disk. **Parameters** - `maxMemory` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The maximum amount of RAM (in bytes) that will be used to store fixed-size Cos objects. **Returns:** `void` ### Typedefs (4) #### CosByte ```cpp typedef ASUns8 CosByte ``` Header: `CosExpT.h:57` Used for an array of bytes in CosDocGetID(). **See also:** [`CosDocGetID`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocGetID) #### CosDocSaveFlags ```cpp typedef ASFlagBits CosDocSaveFlags ``` Header: `CosExpT.h:215` #### CosDocEnumEOFsProc ```cpp typedef ASBool(*) CosDocEnumEOFsProc(CosDoc cosDoc, ASFileOffset fileOffset, void *clientData)(CosDoc cosDoc, ASFileOffset fileOffset, void *clientData) ``` Header: `CosExpT.h:273` A callback for CosDocEnumEOFs(). It is called once for each position in a CosDoc after a `%EOF` keyword that marks the end of either a main cross-reference section, or an update cross-reference section that corresponds to an incremental save. See CosDocEnumEOFs() for more details. **Note:** The precise value passed to the procedure is not defined. It is at least one byte past the `%EOF` keyword, but may include one or more white space characters. When the procedure is called only once, there is no guarantee that `fileOffset` is the same as the length of the file. **See also:** [`CosDocEnumEOFs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocEnumEOFs), [`CosDocEnumEOFsProc64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocEnumEOFsProc64) #### CosDocEnumEOFsProc64 ```cpp typedef ASBool(*) CosDocEnumEOFsProc64(CosDoc cosDoc, ASFileOffset64 fileOffset, void *clientData)(CosDoc cosDoc, ASFileOffset64 fileOffset, void *clientData) ``` Header: `CosExpT.h:292` A callback for CosDocEnumEOFs64(). It is called once for each position in a CosDoc after a `%EOF` keyword that marks the end of either a main cross-reference section, or an update cross-reference section that corresponds to an incremental save. See CosDocEnumEOFs() for more details. This is similar to CosDocEnumEOFsProc(), except that the `fileOffset` parameter is a 64-bit value instead of a 31-bit value. **See also:** [`CosDocEnumEOFs64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocEnumEOFs64), [`CosDocEnumEOFsProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocEnumEOFsProc) ### Structures (1) #### CosDoc ```cpp typedef struct _t_CosDoc* CosDoc ``` Header: `CosExpT.h:94` ### Definitions (7) #### cosDocCreateInfoDict Header: `CosExpT.h:198` Value: `0x01` #### cosSaveBinaryOK Header: `CosExpT.h:208` Value: `0x08` It is ok to store binary data in the file. #### cosSaveConcealObjStreams Header: `CosExpT.h:213` Value: `0x10` If there are any object streams, write them in a way that is hidden from PDF 1.4 (and earlier) viewers. This is used for hybrid files, for example. #### cosSaveCopy Header: `CosExpT.h:206` Value: `0x04` Do NOT use the newly saved file as new store, stay with the current one #### cosSaveFullSave Header: `CosExpT.h:204` Value: `0x02` Write all objects, not just changes. #### cosSaveGarbageCollect Header: `CosExpT.h:202` Value: `0x01` Delete unreferenced objects before save. #### kCosDocOpenDoRepair Header: `CosExpT.h:173` Value: `0x0001` ## CosName ### Functions (4) #### CosCopyNameStringValue ```cpp char * CosCopyNameStringValue(CosObj obj, ASTCount *nBytes) ``` Header: `CosProcs.h:2190` Returns a newly allocated buffer containing a copy of the Cos object's name as a `NULL`-terminated string. Upon return, `nBytes` contains the number of bytes in the string. `CosCopyNameStringValue()` never returns `NULL`; it raises an exception if the allocation fails. The client is responsible for freeing the result by calling `ASfree()`. Unlike Cos strings, the strings corresponding to Cos names are `NULL`-terminated. This routine will avoid creating an `ASAtom` corresponding to the object's name and is generally more efficient than copying the value returned by `ASAtomGetString(CosNameValue(obj))`. (`ASAtom` objects consume global memory that is not deallocated.) An out-of-memory exception is raised if insufficient memory is available. **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): IN A Cos name object. - `nBytes` ([`ASTCount *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTCount)): OUT The length of the name of the Cos object, and therefore the length of the returned string. `nBytes` may be `NULL` if you do not care how many bytes are in the name. **Returns:** `char *` A copy of the Cos object's name, as a `NULL`-terminated string. **See also:** [`CosNewName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewName), [`CosNewNameFromString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewNameFromString), [`CosNameValue`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNameValue), [`CosCopyStringValue`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosCopyStringValue) #### CosNameValue ```cpp ASAtom CosNameValue(CosObj obj) ``` Header: `CosProcs.h:547` Gets the value of a name object. An exception is raised if `obj` has the wrong type, if storage is exhausted, or if file access fails. **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The object of type `CosName` whose value is obtained. **Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom) The `ASAtom` corresponding to the specified name object. An `ASAtom` can be converted to a string using `ASAtomGetString()`. Note that `CosCopyNameStringValue()` can be used to obtain the name as a string, without creating an `ASAtom` (`ASAtom` objects consume global memory that is not deallocated). **See also:** [`CosNewName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewName), [`CosNewNameFromString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewNameFromString), [`CosCopyNameStringValue`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosCopyNameStringValue) #### CosNewName ```cpp CosObj CosNewName(CosDoc dP, ASBool indirect, ASAtom name) ``` Header: `CosProcs.h:215` Creates a new name object associated with the specified document and having the specified value. **Parameters** - `dP` ([`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc)): The document in which the new name is used. - `indirect` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): If `true`, it creates the name as an indirect object, and sets the document's `PDDocNeedsSave` flag (see `PDDocFlags`) flag. If `false`, it creates the name as a direct object. - `name` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The `ASAtom` corresponding to the name to create. A C string can be converted to an `ASAtom` using `ASAtomFromString()`. Note that a name object can be created directly from a C string, without creating an `ASAtom`, by using `CosNewNameFromString()`. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) The newly created name Cos object. **See also:** [`CosNameValue`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNameValue), [`CosNewNameFromString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewNameFromString), [`CosCopyNameStringValue`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosCopyNameStringValue), [`CosObjDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjDestroy) #### CosNewNameFromString ```cpp CosObj CosNewNameFromString(CosDoc dP, ASBool indirect, const char *namestring) ``` Header: `CosProcs.h:2159` Creates a new name object associated with the specified document and having the specified value. **Parameters** - `dP` ([`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc)): The document in which the new name is used. - `indirect` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): If `true`, it creates the name as an indirect object, and sets the document's `PDDocNeedsSave` flag (see `PDDocFlags`) flag. If `false`, it creates the name as a direct object. - `namestring` (`const char *`): The name to create. This routine will not create an `ASAtom` corresponding to `namestring` and is generally more efficient than `CosNewName()`. (`ASAtom` objects consume global memory that is not deallocated.) **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) The newly created name Cos object. **See also:** [`CosNewName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewName), [`CosNameValue`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNameValue), [`CosCopyNameStringValue`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosCopyNameStringValue), [`CosObjDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjDestroy) ## CosNumber ### Functions (13) #### CosDoubleValue ```cpp double CosDoubleValue(CosObj obj) ``` Header: `CosProcs.h:2401` Gets the value of `obj` as a double-precision floating-point real number. An exception is raised if the given object has the wrong Cos type. **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The object whose value is obtained. It must have type `CosInteger` or `CosReal` (`CosFixed`). The result is undefined if the real value is outside the range of floating-point numbers. **Returns:** `double` The numeric value of `obj`, represented as a floating-point number. **See also:** [`CosNewFloat`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewFloat), [`CosNewDouble`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewDouble), [`CosFloatValue`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosFloatValue), [`CosIntegerValue`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosIntegerValue), [`CosInteger64Value`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosInteger64Value), [`CosFixedValue`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosFixedValue) #### CosFixedValue ```cpp ASFixed CosFixedValue(CosObj obj) ``` Header: `CosProcs.h:519` Gets the value of `obj` as a fixed-point real number. @since **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The object whose value is obtained. It must have type `CosInteger` or `CosReal` (`CosFixed`). The result is undefined if the real value is outside the range of `ASFixed` numbers. An exception is raised if the given object has the wrong Cos type. **Returns:** [`ASFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixed) **See also:** [`CosIntegerValue`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosIntegerValue), [`CosNewFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewFixed) #### CosFloatValue ```cpp float CosFloatValue(CosObj obj) ``` Header: `CosProcs.h:1904` Gets the value of `obj` as a single-precision floating-point real number. An exception is raised if the given object has the wrong Cos type. **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The object whose value is obtained. It must have type `CosInteger` or `CosReal` (`CosFixed`). The result is undefined if the real value is outside the range of floating-point numbers. **Returns:** `float` The numeric value of `obj`, represented as a floating-point number. **See also:** [`CosNewFloat`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewFloat), [`CosIntegerValue`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosIntegerValue), [`CosInteger64Value`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosInteger64Value), [`CosFixedValue`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosFixedValue) #### CosInteger64Value ```cpp ASInt64 CosInteger64Value(CosObj obj) ``` Header: `CosProcs.h:1868` Gets the 64-bit integer value of a specified number object. An exception is raised if the given object has the wrong Cos type. **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The object whose integer value is obtained. It must have type `CosInteger` or `CosReal` (`CosFixed`). If it is `CosReal`, its value is rounded to the nearest integer. The result is undefined if the real value is outside the range of `ASInt64` numbers. **Returns:** [`ASInt64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt64) The 64-bit integer value of `obj`. **See also:** [`CosNewInteger64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewInteger64), [`CosIntegerValue`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosIntegerValue), `CosFixed Value`, [`CosFloatValue`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosFloatValue) #### CosIntegerValue ```cpp ASInt32 CosIntegerValue(CosObj obj) ``` Header: `CosProcs.h:504` Gets the 32-bit integer value of a specified number object. An exception is raised if the given object has the wrong Cos type. **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The object whose integer value is obtained. It must have type `CosInteger` or `CosReal` (`CosFixed`). If it is `CosReal`, its value is rounded to the nearest integer. The result is undefined if the real value is outside the range of `ASInt32` numbers. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The 32-bit integer value of `obj`. **See also:** [`CosNewInteger`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewInteger), [`CosNewFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewFixed), [`CosNewFloat`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewFloat) #### CosNewDouble ```cpp CosObj CosNewDouble(CosDoc dP, ASBool indirect, double value) ``` Header: `CosProcs.h:2359` Creates a new real-number object from a double-precision floating-point number associated with the specified document. **Parameters** - `dP` ([`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc)): The document in which the number is used. - `indirect` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): If `true`, it creates the real-number object as an indirect object, and sets the document `dP` object's `PDDocNeedsSave` flag (see `PDDocFlags`). If `false`, it creates the number as a direct object. - `value` (`double`): The real number, represented as a double-precision floating-point number. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) A Cos object of type `CosReal` (`CosFixed`). **See also:** [`CosDoubleValue`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoubleValue), [`CosFloatValue`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosFloatValue), [`CosNewFloat`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewFloat), [`CosNewInteger`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewInteger), [`CosNewInteger64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewInteger64), [`CosNewFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewFixed) #### CosNewDoubleEx ```cpp CosObj CosNewDoubleEx(CosDoc dP, ASBool indirect, double value, ASUns8 numSigDigs) ``` Header: `CosProcs.h:2382` Creates a new real-number object from a double-precision floating-point number associated with the specified document. **Parameters** - `dP` ([`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc)): The document in which the number is used. - `indirect` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): If `true`, it creates the real-number object as an indirect object, and sets the document `dP` object's `PDDocNeedsSave` flag (see `PDDocFlags`). If `false`, it creates the number as a direct object. - `value` (`double`): The maximum number of significant digits to use when this object is written to a file. Legal values are 6-13 for direct objects, 6-16 for indirect objects - `numSigDigs` ([`ASUns8`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns8)) **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) A Cos object of type `CosReal` (`CosFixed`). **See also:** [`CosDoubleValue`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoubleValue), [`CosFloatValue`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosFloatValue), [`CosNewFloat`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewFloat), [`CosNewInteger`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewInteger), [`CosNewInteger64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewInteger64), [`CosNewFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewFixed) #### CosNewFixed ```cpp CosObj CosNewFixed(CosDoc dP, ASBool indirect, ASFixed value) ``` Header: `CosProcs.h:178` Creates a new real-number object from a fixed-point number associated with the specified document. **Parameters** - `dP` ([`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc)): The document in which the number is used. - `indirect` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): If `true`, it creates the real-number object as an indirect object, and sets the document (`dP`) object's `PDDocNeedsSave` flag (see `PDDocFlags`). If `false`, it creates the number as a direct object. - `value` ([`ASFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixed)): The real number, represented as a fixed-point number. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) A Cos object of type `CosReal` (`CosFixed`). **See also:** [`CosFixedValue`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosFixedValue), [`CosNewInteger`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewInteger), [`CosNewFloat`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewFloat), [`CosObjDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjDestroy) #### CosNewFloat ```cpp CosObj CosNewFloat(CosDoc dP, ASBool indirect, float value) ``` Header: `CosProcs.h:1887` Creates a new real-number object from a single-precision floating-point number associated with the specified document. **Parameters** - `dP` ([`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc)): The document in which the number is used. - `indirect` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): If `true`, it creates the real-number object as an indirect object, and sets the document `dP` object's `PDDocNeedsSave` flag (see `PDDocFlags`). If `false`, it creates the number as a direct object. - `value` (`float`): The real number, represented as a single-precision floating-point number. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) A Cos object of type `CosReal` (`CosFixed`). **See also:** [`CosFloatValue`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosFloatValue), [`CosNewInteger`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewInteger), [`CosNewInteger64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewInteger64), [`CosNewFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewFixed) #### CosNewInteger ```cpp CosObj CosNewInteger(CosDoc dP, ASBool indirect, ASInt32 value) ``` Header: `CosProcs.h:159` Creates a new 32-bit integer object associated with the specified document and having the specified value. **Parameters** - `dP` ([`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc)): IN The document in which the integer is used. - `indirect` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): IN If `true`, it creates the integer object as an indirect object, and sets the document `dP` object's `PDDocNeedsSave` flag (see PDDocFlags). If `false`, it creates the integer as a direct object. - `value` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN The value, represented as a 32-bit integer. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) An object of type CosInteger. **See also:** [`CosIntegerValue`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosIntegerValue), [`CosNewFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewFixed), [`CosNewFloat`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewFloat), [`CosObjDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjDestroy) #### CosNewInteger64 ```cpp CosObj CosNewInteger64(CosDoc dP, ASBool indirect, ASInt64 value) ``` Header: `CosProcs.h:1850` Acrobat 7 additions Creates a new 64-bit integer object associated with the specified document and having the specified value. **Parameters** - `dP` ([`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc)): IN The document in which the integer is used. - `indirect` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): IN If `true`, it creates the integer object as an indirect object, and sets the document `dP` object's `PDDocNeedsSave` flag (see PDDocFlags). If `false`, it creates the integer as a direct object. - `value` ([`ASInt64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt64)): IN The value, represented as a 64-bit integer. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) An object of type CosInteger. **See also:** [`CosInteger64Value`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosInteger64Value), [`CosNewInteger`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewInteger), [`CosNewFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewFixed), [`CosNewFloat`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewFloat) #### CosNumberIsWithinASFixedRange ```cpp ASBool CosNumberIsWithinASFixedRange(CosObj obj) ``` Header: `CosProcs.h:2242` Tests whether the value of a Cos number is inside the range of `ASFixed` numbers, `[-32768.0, +32768.0)`. If so, the `ASFixed` value may be obtained by calling CosFixedValue(). If not, the floating-point value may be obtained by calling CosFloatValue(). It raises an exception if `obj` is not a number (`CosInteger` or `CosReal`). **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): A Cos integer or real number. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the value of the number is in the range of `ASFixed`, `false` otherwise. **See also:** [`CosFixedValue`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosFixedValue), [`CosFloatValue`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosFloatValue) #### CosNumberIsWithinASInt32Range ```cpp ASBool CosNumberIsWithinASInt32Range(CosObj obj) ``` Header: `CosProcs.h:2226` Tests whether the value of a Cos number is inside the range of 32-bit integers, `[-2147483648, +2147483647]`. If so, the 32-bit value may be obtained by calling `CosIntegerValue()`. If not, the 64-bit value may be obtained by calling `CosIntegerValue64()`. It raises an exception if `obj` is not a number (`CosInteger` or `CosReal`). **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): A Cos integer or real number. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the value of the number is in the range of 32-bit integers, `false` otherwise. **See also:** [`CosIntegerValue`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosIntegerValue), `CosIntegervalue64` ## CosObj ### Functions (18) #### CosNewNull ```cpp CosObj CosNewNull(void) ``` Header: `CosProcs.h:141` Returns a direct object of type CosNull. This `NULL` object is said to be invalid. You can compare an object to `NULL` using either of the following methods (the second is more efficient): `CosObjEqual(obj, CosNewNull());` `CosObjGetType(obj) == CosNull;` In general, use CosNewNull() only to initialize a local variable or pass a parameter. `NULL` objects may be stored as array elements, but not as dictionary values. The following statements are equivalent: `CosDictPut(dict, key, CosNewNull());` `CosDictRemove(dict, key);` **Parameters** - (unnamed) (`void`) **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) A `NULL` Cos object. **See also:** [`CosObjGetType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjGetType) #### CosObjAcquire ```cpp void CosObjAcquire(CosObj obj) ``` Header: `CosProcs.h:2124` Create a strong reference for an object. For a description of strong references, see `CosDictSetWeakReference()`. For indirect objects and direct nonscalars, `CosObjAcquire()` increments an internal reference count for `obj`. The reference count is used by the garbage collector, which is invoked during a full-save of the document. If the reference count is positive at the time of garbage collection (it is initially `0`), then the object will not be garbage-collected, regardless of whether the object is accessible from the root of the document. **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): A Cos object. **Returns:** `void` #### CosObjCmp ```cpp ASInt32 CosObjCmp(CosObj obj1, CosObj obj2) ``` Header: `CosProcs.h:1541` Compares the two `CosObj` objects. The result is `0` only if `CosObjEqual(obj1, obj2)` is `true`. Otherwise, the result is either `-1` or `1`. The result is useful for ordering or sorting Cos objects. No other significance should be attached to the result. In particular, a nonzero result indicates nothing about the type of either object. The result is valid only within a single instance of the document. That is, if CosObjCmp() returns a nonzero value and the document is closed and then reopened, there is no guarantee that it will return the same nonzero value for those same objects. The following conditions apply: • If `CosObjCmp(a, b) == 0`, then `CosObjCmp(b, a) == 0`. • If `CosObjCmp(a, b) > 0`, then `CosObjCmp(b, a) < 0`. • If `CosObjCmp(a, b) < 0`, then `CosObjCmp(b, a) > 0`. • If `CosObjCmp(a, b) == 0` and `CosObjCmp(b, c) == 0`, then `CosObjCmp ( a, c ) == 0`. • If `CosObjCmp(a, b) > 0` and `CosObjCmp(b, c) > 0`, then `CosObjCmp (a, c) > 0`. • If `CosObjCmp(a, b) < 0` and `CosObjCmp(b, c) < 0`, then `CosObjCmp(a, c) < 0`. **Parameters** - `obj1` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The first `CosObj` to compare. - `obj2` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The second `CosObj` to compare. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) Returns zero if the two objects are equal, `-1` if `obj1` is less than `obj2`, `1` if `obj1` is greater than `obj2`. **See also:** [`CosObjEqual`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjEqual) #### CosObjCopy ```cpp CosObj CosObjCopy(CosObj srcObj, CosDoc destDoc, ASBool copyIndirect) ``` Header: `CosProcs.h:1330` Copies a `CosObj` from one document to another (or the same document). **Parameters** - `srcObj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The `CosObj` to copy. - `destDoc` ([`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc)): The `CosDoc` for the document into which the `CosObj` is copied. - `copyIndirect` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): `true` if all indirectly referenced objects from `srcObj` are copied to `destDoc`, `false` otherwise. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) The `CosObj` which has been copied to the destination document. **See also:** [`CosObjEqual`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjEqual) #### CosObjDestroy ```cpp void CosObjDestroy(CosObj obj) ``` Header: `CosProcs.h:488` Destroys a Cos object. This method does nothing if `obj` is a direct scalar object, such as the `NULL` object. If a composite object (an array, dictionary or stream) is destroyed: • All the direct objects in it are automatically destroyed. • The indirect objects in it are not destroyed. **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The object to destroy. **Returns:** `void` **See also:** [`CosNewArray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewArray), [`CosNewBoolean`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewBoolean), [`CosNewDict`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewDict), [`CosNewFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewFixed), [`CosNewInteger`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewInteger), [`CosNewName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewName), [`CosNewStream`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewStream), [`CosNewString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewString) #### CosObjEnum ```cpp ASBool CosObjEnum(CosObj obj, CosObjEnumProc proc, void *clientData) ``` Header: `CosProcs.h:106` Enumerates the elements of a Cos object by calling a user-supplied procedure for each component of the object. **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The object whose elements are enumerated. - For scalars or strings, the `proc` is not called, and CosObjEnum() returns `true`. - For dictionaries, `proc` is called for each key-value pair. The order in which the key-value pairs are enumerated is undefined. - For arrays, `proc` is called with each element as the first paramater to `proc`, and the `NULL` object as the second parameter. Array elements are enumerated in ascending order of index. For streams, `proc` is called once, with the stream's dictionary as the first parameter to the `proc` and the `NULL` object as the second parameter. - `proc` ([`CosObjEnumProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjEnumProc)): A user-supplied callback to call for each element of `obj`. Neither `proc` nor any routine called by `proc` may modify `obj`. Doing so can produce undefined results or errors. For example, if `obj` is an array, `proc` must not call CosArrayRemove(); if `obj` is a dictionary, `proc` must not call CosDictPut(). - `clientData` (`void *`): A pointer to user-supplied data to pass to `proc` each time it is called. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) Returns `true` if every call to `proc` returned `true`. As soon as any call to `proc` returns `false`, the enumeration stops and CosObjEnum() returns `false`. **See also:** [`CosArrayGet`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosArrayGet), [`CosDictGet`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictGet), [`CosDocEnumEOFs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocEnumEOFs), [`CosDocEnumIndirect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocEnumIndirect) #### CosObjEqual ```cpp ASBool CosObjEqual(CosObj obj1, CosObj obj2) ``` Header: `CosProcs.h:55` Tests whether two Cos objects are equal. Cos objects are equal when all of the following conditions are true: • They are either both direct or both indirect. • They have the same type. • If they are indirect, they have the same generation number. • If they are scalars, they have the same value. (Two `NULL` objects are equal.) • If they are non-scalar, they reference the same value. The last condition implies that the comparison is *shallow*. For example: `CosObj a, b, c; a = CosNewString (doc, "XYZ"); b = CosNewString(doc, "XYZ"); c = b;` In this case, `CosObjEqual(a,b)` is `false`, but `CosObjEqual(b,c)` is `true`. **Parameters** - `obj1` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): An object to compare with `obj2`. - `obj2` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): An object to compare with `obj1`. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if `obj1` and `obj2` are equal, `false` otherwise. **See also:** [`CosObjCmp`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjCmp) #### CosObjGetCompressibility ```cpp ASBool CosObjGetCompressibility(CosObj obj) ``` Header: `CosProcs.h:1706` Tests whether an object is *compressible*. A compressible object can be added to a `CosObjCollection`. An object is compressible only if all of the following conditions are true: • It is indirect. • It has a generation number of zero. • It is not a stream. • It has not been marked as incompressible by `CosObjSetCompressibility()`. **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The object to test. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if `obj` is compressible, `false` otherwise. **See also:** [`CosObjIsCompressed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjIsCompressed), [`CosObjSetCompressibility`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjSetCompressibility) #### CosObjGetDoc ```cpp CosDoc CosObjGetDoc(CosObj obj) ``` Header: `CosProcs.h:118` Gets the CosDoc containing the specified object. This is defined only for indirect or non-scalar objects. **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The object whose CosDoc is obtained. **Returns:** [`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc) The object's CosDoc. **Exceptions** - `cosErrInvalidObj`: is raised if the object is a direct scalar object. **See also:** [`PDDocGetCosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetCosDoc) #### CosObjGetGeneration ```cpp CosGeneration CosObjGetGeneration(CosObj obj) ``` Header: `CosProcs.h:1185` Gets the generation number of an indirect Cos object. See the description of the Indirect Objects in "Objects," in ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.3.1, page 21. You can find this document on the web store of the International Standards Organization (ISO). **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): IN/OUT The indirect `CosObj` for which the generation number is obtained. A `CosObj` can be determined to be indirect using `CosObjIsIndirect()`. **Returns:** [`CosGeneration`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosGeneration) The generation number of `cosObj`. **Exceptions** - `cosErrInvalidObj`: is raised if the object is not valid or is not indirect. **See also:** [`CosObjGetID`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjGetID), [`CosObjIsIndirect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjIsIndirect) #### CosObjGetID ```cpp CosID CosObjGetID(CosObj obj) ``` Header: `CosProcs.h:1166` Gets the local master index for an indirect object. For indirect objects, the local master index is the same as the indirect object index that appears in the PDF file. **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): IN/OUT The indirect `CosObj` for which the ID is obtained. A `CosObj` can be determined to be indirect using `CosObjIsIndirect()`. **Returns:** [`CosID`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosID) The ID of `obj`. **Exceptions** - `cosErrInvalidObj`: is raised if the object is not valid or is not indirect. **See also:** [`CosDocGetObjByID`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocGetObjByID), [`CosObjGetGeneration`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjGetGeneration), [`CosObjIsIndirect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjIsIndirect) #### CosObjGetType ```cpp CosType CosObjGetType(CosObj obj) ``` Header: `CosProcs.h:63` Gets an object's type. **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The object whose type is obtained. **Returns:** [`CosType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosType) The object's type. #### CosObjHash ```cpp CosHashCode CosObjHash(CosObj obj) ``` Header: `CosProcs.h:1315` Gets a 32-bit hash code for the given `CosObj`. Two `CosObj` objects with equal hash codes are not necessarily equal, however. Use `CosObjEqual()` to determine the equality of Cos objects. **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The `CosObj` for which to obtain a hash code. **Returns:** [`CosHashCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosHashCode) 32-bit hash code for the given `CosObj`, or `CosNewNull()` if there is no object with this ID. **See also:** [`CosObjEqual`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjEqual) #### CosObjIsCompressed ```cpp ASBool CosObjIsCompressed(CosObj obj) ``` Header: `CosProcs.h:1585` Tests whether an object is compressed (part of a CosObjCollection). **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The object to test. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if `obj` is compressed, `false` otherwise. #### CosObjIsIndirect ```cpp ASBool CosObjIsIndirect(CosObj obj) ``` Header: `CosProcs.h:71` Tests whether an object is indirect. **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The object to test. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if `obj` is indirect, `false` if `obj` is direct. #### CosObjRefreshAfterLinearizedSave ```cpp void CosObjRefreshAfterLinearizedSave(CosObj *obj, CosDoc doc) ``` Header: `CosProcs.h:1776` In Acrobat 6.0, this method updates an indirect Cos object after a linearized save operation. Linearizing renumbers all indirect objects; this function returns the new renumbered Cos object, which should be used from this point on. This call is only valid from within notification callbacks responding to the PDDocDidSave() notification. If called from outside this context, or if the passed Cos object is direct, the function does not modify the object. In Acrobat 7.0 and later, linearizing does not renumber objects, and this method has no effect. **Parameters** - `obj` ([`CosObj *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): A pointer to the object to refresh. The object is updated by the method. - `doc` ([`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc)): The document that was saved. **Returns:** `void` #### CosObjRelease ```cpp void CosObjRelease(CosObj obj) ``` Header: `CosProcs.h:2138` Removes a strong reference for an object. For a description of strong references, see `CosDictSetWeakReference()`. For indirect objects and direct nonscalars, `CosObjRelease()` decrements an internal reference count for `obj`. The reference count is used by the garbage collector, which is invoked during a full-save of the document. If the reference count is positive at the time of garbage collection (it is initially `0`), then the object will not be garbage-collected, regardless of whether the object is accessible from the root of the document. **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): A Cos object. **Returns:** `void` #### CosObjSetCompressibility ```cpp void CosObjSetCompressibility(CosObj obj, ASBool compressible) ``` Header: `CosProcs.h:1686` Controls whether a Cos object can be compressed. A compressible object can be added to a CosObjCollection. If you set the compressibility to `false`, calling `CosObjAddToCollection()` on that object has no effect. If the object is already compressed, it is removed from the object collection to which it belongs and then marked as incompressible. This method does nothing if applied to a direct object, a stream, or an object whose generation number is not zero. Objects of these types are never compressible. **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The object whose compressibility is set. - `compressible` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): `true` if the object can be made part of a `CosObjCollection`, `false` otherwise. **Returns:** `void` `true` if `obj` is marked as compressible, `false` otherwise. **See also:** [`CosObjAddToCollection`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjAddToCollection), [`CosObjGetCompressibility`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjGetCompressibility), [`CosObjIsCompressed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjIsCompressed) ### Typedefs (9) #### CosGeneration ```cpp typedef ASUns16 CosGeneration ``` Header: `CosExpT.h:44` #### CosHashCode ```cpp typedef ASUns32 CosHashCode ``` Header: `CosExpT.h:48` `0` is not valid. #### CosID ```cpp typedef ASUns32 CosID ``` Header: `CosExpT.h:46` #### CosObj ```cpp typedef OPAQUE_64_BITS CosObj ``` Header: `CosExpT.h:96` #### CosType ```cpp typedef ASInt32 CosType ``` Header: `CosExpT.h:90` Constants that specify a Cos object's type (string, number, dictionary, and so on). **See also:** [`CosObjGetType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjGetType) #### CosObjEnumProc ```cpp typedef ASBool(*) CosObjEnumProc(CosObj obj, CosObj value, void *clientData)(CosObj obj, CosObj value, void *clientData) ``` Header: `CosExpT.h:132` A callback for CosObjEnum(), CosDocEnumIndirect(), and PDDocEnumOCGs(). It is called once for each component of a composite Cos object (dictionary, array, and stream). Value Description `Dictionary` A key. `Array` An array element. `Stream` The stream's dictionary (the whole thing, not one key at a time). Value Description `Dictionary` The value associated with the Key. `Array` A `NULL` Cos object. `Stream` A `NULL` Cos object. For CosDocEnumIndirect() and PDDocEnumOCGs(), this is always the `NULL` Cos object. **See also:** [`CosObjEnum`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjEnum), [`CosDocEnumIndirect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDocEnumIndirect), [`PDDocEnumOCGs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocEnumOCGs) #### CosObjOffsetProc ```cpp typedef void(*) CosObjOffsetProc(CosObj obj, ASFilePos fileOffset, ASArraySize length, void *clientData)(CosObj obj, ASFilePos fileOffset, ASArraySize length, void *clientData) ``` Header: `CosExpT.h:308` A callback for PDDocSaveParams() used by PDDocSaveWithParams(). Use this to get information about Cos objects of interest while a PDDoc is being saved. **See also:** [`PDDocSaveWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSaveWithParams) #### CosObjOffsetProc64 ```cpp typedef void(*) CosObjOffsetProc64(CosObj obj, ASFilePos64 fileOffset, ASUns64 length, void *clientData)(CosObj obj, ASFilePos64 fileOffset, ASUns64 length, void *clientData) ``` Header: `CosExpT.h:311` #### CosObjSetCallbackFlagProc ```cpp typedef ASBool(*) CosObjSetCallbackFlagProc(CosObj obj, ASBool set)(CosObj obj, ASBool set) ``` Header: `CosExpT.h:326` A callback in PDDocPreSaveInfo(), which is used by the PDDocPreSaveProc() callback. Use this callback to set a flag in each CosObj that you care about, so that your callback will be called back during the PDDoc's save and will be given the Cos object's offset and length. After a PDF file is saved, the Cos objects previously obtained are no longer valid. **See also:** [`PDDocSaveWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSaveWithParams) ## CosObjCollection ### Functions (8) #### CosNewObjCollection ```cpp CosObjCollection CosNewObjCollection(CosDoc dP) ``` Header: `CosProcs.h:1601` Creates a new object collection for objects in a document. **Parameters** - `dP` ([`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc)): The document whose objects are collected, or `NULL` to create a `NULL` collection (a `NULL` collection is not associated with a document and cannot store objects; it is generally used only as an initial value for a variable of type CosObjCollection). **Returns:** [`CosObjCollection`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjCollection) The newly created Cos object collection. **See also:** [`CosObjAddToCollection`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjAddToCollection), [`CosObjCollectionEnum`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjCollectionEnum), [`CosObjGetCollection`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjGetCollection), [`CosObjCollectionIsNull`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjCollectionIsNull) #### CosObjAddToCollection ```cpp ASBool CosObjAddToCollection(CosObjCollection coll, CosObj item) ``` Header: `CosProcs.h:1647` Adds a Cos object to a collection; see `CosObjCollection` for requirements of these collections. This method sets the dirty flag of the collection's Cos document. An exception is raised if the collection and the object belong to different Cos documents. **Parameters** - `coll` ([`CosObjCollection`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjCollection)): The Cos object collection. - `item` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The object to add. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if `obj` was successfully added to the collection, `false` otherwise. **See also:** [`CosObjGetCompressibility`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjGetCompressibility), [`CosObjIsCompressed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjIsCompressed), [`CosObjRemoveFromCollection`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjRemoveFromCollection), [`CosObjSetCompressibility`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjSetCompressibility) #### CosObjCollectionEnum ```cpp ASBool CosObjCollectionEnum(CosObjCollection coll, CosObjEnumProc proc, void *clientData) ``` Header: `CosProcs.h:1756` Enumerates the members of a Cos object collection, calling a user-supplied procedure for each member object. The order in which the objects are enumerated is undefined. **Parameters** - `coll` ([`CosObjCollection`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjCollection)): The object collection whose members are enumerated. - `proc` ([`CosObjEnumProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjEnumProc)): A user-supplied callback to call for each member object of `coll`. Enumeration ends if `proc` returns `false`. The callback must not modify the collection (for example, by adding or removing objects). Doing so produces undefined results or errors. - `clientData` (`void *`): A pointer to user-supplied data to pass to `proc` each time it is called. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) Returns the value that `proc` returned (meaning that it returns `true` if all the member objects were enumerated, `false` if enumeration was terminated at the request of `proc`). **See also:** [`CosObjGetCollection`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjGetCollection) #### CosObjCollectionEqual ```cpp ASBool CosObjCollectionEqual(CosObjCollection c1, CosObjCollection c2) ``` Header: `CosProcs.h:1735` Tests whether two Cos object collections are the same collection. Two `NULL` collections are always equal (a `NULL` collection is not associated with a document and cannot store objects; it is generally used only as an initial value for a variable of type `CosObjCollection`). **Parameters** - `c1` ([`CosObjCollection`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjCollection)): An object collection to compare. - `c2` ([`CosObjCollection`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjCollection)): An object collection to compare. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if `c1` and `c2` are the same collection, `false` otherwise. **See also:** [`CosNewObjCollection`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewObjCollection), [`CosObjGetCollection`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjGetCollection), [`CosObjCollectionIsNull`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjCollectionIsNull) #### CosObjCollectionIsNull ```cpp ASBool CosObjCollectionIsNull(CosObjCollection coll) ``` Header: `CosProcs.h:1613` Tests whether an object collection is `NULL`. A `NULL` collection is not associated with a document and cannot store objects; it is generally used only as an initial value for a variable of type `CosObjCollection`. **Parameters** - `coll` ([`CosObjCollection`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjCollection)): The object collection to test. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if `coll` is `NULL`, `false` otherwise. **See also:** [`CosNewObjCollection`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewObjCollection) #### CosObjCollectionSize ```cpp ASUns32 CosObjCollectionSize(CosObjCollection coll) ``` Header: `CosProcs.h:1718` Gets the number of objects in an object collection. The size of a `NULL` collection is zero. **Parameters** - `coll` ([`CosObjCollection`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjCollection)): The object collection whose size is obtained. **Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32) The number of objects in the collection. **See also:** [`CosObjAddToCollection`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjAddToCollection), [`CosObjRemoveFromCollection`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjRemoveFromCollection), [`CosObjCollectionEnum`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjCollectionEnum) #### CosObjGetCollection ```cpp CosObjCollection CosObjGetCollection(CosObj obj) ``` Header: `CosProcs.h:1628` Gets the `CosObjCollection` containing the specified object. If the object is not in a collection, the method raises an exception. An error is raised if `obj` is not in a collection. **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The object whose `CosObjCollection` is obtained. **Returns:** [`CosObjCollection`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjCollection) The `CosObjCollection` to which the object belongs. **See also:** [`CosObjAddToCollection`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjAddToCollection), [`CosObjIsCompressed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjIsCompressed) #### CosObjRemoveFromCollection ```cpp void CosObjRemoveFromCollection(CosObj obj) ``` Header: `CosProcs.h:1662` Removes a Cos object from the `CosObjCollection` to which it belongs. An exception is raised if the object is not in the collection. **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The object to remove. **Returns:** `void` **See also:** [`CosObjAddToCollection`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjAddToCollection), [`CosObjGetCompressibility`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjGetCompressibility), [`CosObjIsCompressed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjIsCompressed), [`CosObjSetCompressibility`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjSetCompressibility) ### Typedefs (1) #### CosObjCollection ```cpp typedef OPAQUE_64_BITS CosObjCollection ``` Header: `CosExpT.h:97` ## CosStream ### Functions (8) #### CosNewStream ```cpp CosObj CosNewStream(CosDoc dP, ASBool indirect, ASStm stm, CosStreamStartAndCode sourceStart, ASBool encodeTheSourceData, CosObj attributesDict, CosObj encodeParms, CosByteMax sourceLength) ``` Header: `CosProcs.h:465` Creates a new Cos stream, using data from an existing `ASStm`. The data is copied, so the source stream may be closed after CosNewStream returns. This method creates a Cos stream object by writing its PDF representation to an intermediate file in this format: `<>` `stream` `... data, possibly encoded ...` `endstream` See the description of the Stream Objects in "Objects," in ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.3.8, page 19. You can find this document on the web store of the International Standards Organization (ISO). This occurs in four steps: **Step 1: Writing the attribute dictionary ** If `attributesDict` is a valid Cos dictionary, the method writes that dictionary to the intermediate file. Otherwise, it creates a new direct dictionary, determining a `Length` key according to the `sourceLength` value: • If `sourceLength` is negative, or if the source data is to be encoded (see below), the value of the `Length` key is a reference to a new indirect object, whose value will be set in **Step 4**. • Otherwise, `Length` is a direct scalar representing `sourceLength`. The dictionary that is written becomes the new stream's attribute dictionary. **Step 2: Reading the data ** `sourceStart` determines where in the source stream to begin reading, and whether the source is seekable. • If `sourceStart` is a negative number, the source is assumed to be non-seekable but positioned at the point where reading should start. • Otherwise, the source is assumed to be seekable, and reading starts at the position indicated by `sourceStart`. If `sourceStart` is zero, data is read from the beginning of the source stream. Positive values for `sourceStart` may be used, for instance, to skip over initial data in the stream. **Step 3: Encoding the data ** If `attributesDict` is a valid Cos dictionary, it contains a `Filter` key, and `encodeTheSourceData` is `true`, the method encodes the data after reading it from the source stream and before writing it to the intermediate file. The `attributesDict` is used as the new stream's dictionary. The `Filter` entry in this dictionary indicates how the data in the resulting Cos stream object will be subsequently decoded; the value may be the name of a decoding filter or an array of such names. Specify multiple filters in the order they should be applied to decode the data (if parameters are needed to decode the data, they are specified as the value of the `DecodeParms` key in `attributesDict`. See the description of the DecodeParms attribute in Table 5 in ISO 32000-1:2008, Document Management-Portable Document Format- Part 1: PDF 1.7, section 7.3.8.2, page 20. You can find this document on the web store of the International Standards Organization (ISO). For each decoding filter, there is a corresponding encoding filter, which the method applies to the source data during this step. If parameters are needed to encode the data, they must be specified in the call by `encodeParms` (the encoding parameters are often different from the decoding parameters). The `encodeParms` parameter is optional for all encoding filters except `DCTDecode` and `JBIG2Decode`. See the `encodeParms` field of `PDEFilterSpec`. If an array of filters is supplied, and at least one of them requires encoding parameters, then a corresponding array of encoding parameters is also required. Use the `NULL` object to represent default parameters for filters that have defaults. In any other case, the method copies the source data directly into the Cos stream with no encoding. If `sourceLength` is negative, it reads bytes until the source reaches its EOF. Otherwise, `sourceLength` indicates how many bytes to read from the source, and an exception is raised if the source reaches EOF before that. **Step 4: Writing the data** After the data is written, if the value of the `Length` key in the attributes dictionary was an indirect reference (either because it was supplied that way in `attributesDict`, or because it was created that way in **Step 1**, the value of that indirect object is set to the number of bytes actually written (that is, the encoded length if the data was encoded). An indirect `Length` key is useful for one-pass writing, when the size of the written data is not known in advance, either because the data was to be encoded, or because there was no way to know how much data there would be before the source reached its EOF. An exception is raised if `attributesDict` is neither the `NULL` object nor a direct Cos dictionary, `sourceStart` is nonnegative but the source is not seekable, or if `sourceLength` is nonnegative but the source stream reaches EOF before that many bytes have been read. For attributeDict, see the description of Stream Objects in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.9, page 288. You can find this document on the web store of the International Standards Organization (ISO). See the encoding step in the description above. You can find this document on the web store of the International Standards Organization (ISO). See the encoding step in the description above. If no encoding parameters are needed, this value is ignored. **Note:** CosNewStream() sets the document `PDDocNeedsSave` flag (see PDDocFlags). **Note:** You cannot call `CosStreamPos()` on a stream created with `CosNewStream()` until the file has been saved. **Parameters** - `dP` ([`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc)): The Cos document in which the newly created stream will be used. - `indirect` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): Must always be `true`, specifying that the Cos stream is created as an indirect object (all streams are indirect). This also sets the document's `PDDocNeedsSave` flag (see `PDDocFlags`). - `stm` ([`ASStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStm)): The source stream containing the data to copy into the new stream. The caller is responsible for closing `stm` after `CosNewStream()` returns. The source stream can be any readable `ASStm`. Typical sources are: • Files (`ASFileStmRdOpen()`) or memory (`ASMemStmRdOpen()`). These streams are always seekable. • Arbitrary procedures (`ASProcStmRdOpen()` or `ASProcStmRdOpenEx()`), or other Cos streams (`CosStreamOpenStm()`). These streams are always non-seekable. - `sourceStart` ([`CosStreamStartAndCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosStreamStartAndCode)): The byte offset into `stm` from which data reading starts for a seekable stream. If the value is negative, it specifies that the stream is not seekable. - `encodeTheSourceData` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): Determines whether the data in `stm` should be encoded using filters specified in `attributesDict` before it is written to the Cos stream. See the description of the encoding step above. If `attributesDict` is a `NULL` object or if the dictionary has no `Filter` key, this value is ignored. - `attributesDict` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): Either the `NULL` Cos object, or a direct Cos dictionary containing stream attributes, such as the length of the Cos stream data and a list of decoding filters and parameters to apply to the data. See the description of the Stream Objects in "Objects" in ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.3.8, page 19. - `encodeParms` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The parameters to be used by the filters if the source data is encoded before it is written to the file. The parameters follow the structure for the value of the `DecodeParms` stream attribute. See the description of the DecodeParms attribute in Table 5 in ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.3.8.2, page 20. - `sourceLength` ([`CosByteMax`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosByteMax)): The amount of data to be read from the source. If negative (typically `-1`), data is read from the source until it reaches its EOF. See **Step 1** in the description above. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) The newly created stream Cos object. **See also:** [`CosObjDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjDestroy), [`CosNewStream64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewStream64) #### CosNewStream64 ```cpp CosObj CosNewStream64(CosDoc dP, ASBool indirect, ASStm stm, ASInt64 stmStartPos, ASBool stmDataIsDecoded, CosObj attributesDict, CosObj encodeParms, ASInt64 sourceLength, ASBool allowDelayedRead) ``` Header: `CosProcs.h:2302` Creates a new Cos stream, using data from an existing `ASStm`. For details, see `CosNewStream()`. This is the same as `CosNewStream()`, except that `decodeLength` is a 64-bit value instead of a 32-bit value, and `allowDelayedRead` enables the implementation to avoid making an intermediate copy of the stream data. This is useful when creating very large streams of data. **Important:** In this case, the caller must not close `stm` until it is established, through some independent mechanism, that the data will not be read again (see `ASProcStmRdOpenEx()` for further details on this feature). If `allowDelayedRead` is `false`, the source data is copied during this call, so the source stream may be closed after `CosNewStream64()` returns. **Parameters** - `dP` ([`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc)): The Cos document in which the newly created stream will be used. - `indirect` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): Must always be `true`, specifying that the Cos stream is created as an indirect object. - `stm` ([`ASStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStm)): The source stream containing the data to copy into the new stream. - `stmStartPos` ([`ASInt64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt64)): Starting position for the stream. Its default is `0`. - `stmDataIsDecoded` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): A boolean value indicating whether the data in `stm` should be encoded using filters specified in `attributesDict`. - `attributesDict` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): Either the `NULL` Cos object, or a direct Cos dictionary containing stream attributes. - `encodeParms` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The parameters to be used by the filters if the source data is to be encoded. - `sourceLength` ([`ASInt64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt64)): The amount of data to be read from the source. - `allowDelayedRead` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): If this is `true` and `stm` permits seek operations, then the data from `stm` will not be read during this call, but rather at a subsequent time, and it may be read more than once. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) The newly created stream Cos object. **See also:** [`CosNewStream`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewStream), [`ASProcStmRdOpenEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASProcStmRdOpenEx) #### CosStreamDict ```cpp CosObj CosStreamDict(CosObj stream) ``` Header: `CosProcs.h:909` Gets a stream's attributes dictionary. **Parameters** - `stream` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): IN/OUT The stream whose attributes dictionary is obtained. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) The stream's attributes dictionary Cos object. **See also:** [`CosStreamLength`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosStreamLength), [`CosStreamPos`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosStreamPos), [`CosDictGet`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictGet), [`CosDictPut`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDictPut) #### CosStreamLength ```cpp ASTArraySize CosStreamLength(CosObj stream) ``` Header: `CosProcs.h:896` Gets the length of a Cos stream from the `Length` key in the stream's attributes dictionary. This specifies the length of the undecoded data, which is the number of bytes in the stream before the `Filter` (if any) is applied. This has the same effect as calling `CosIntegerValue(CosDictGetKeyString(stream, "Length"))`. An exception is raised if the `Length` key is not found in the attributes dictionary, if its value is not an integer, or if its value is outside the range of 32-bit integers. **Parameters** - `stream` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The stream whose length is obtained. **Returns:** [`ASTArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize) The length of the stream. **See also:** [`CosStreamDict`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosStreamDict), [`CosStreamPos`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosStreamPos), [`CosStreamLength64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosStreamLength64) #### CosStreamLength64 ```cpp ASInt64 CosStreamLength64(CosObj stream) ``` Header: `CosProcs.h:2322` Gets the length of a Cos stream from the `Length` key in the stream's attributes dictionary. See `CosStreamLength()` for details. This is the same as `CosStreamLength()`, except that the return value is a 64-bit integer instead of a 32-bit integer. This has the same effect as calling `CosInteger64Value(CosDictGetKeyString(stream, "Length"))` An exception is raised if the Length key is not found in the attributes dictionary, or if its value is not an integer. **Parameters** - `stream` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The stream whose length is obtained. **Returns:** [`ASInt64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt64) The length of the stream. **See also:** [`CosStreamDict`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosStreamDict), [`CosStreamLength`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosStreamLength) #### CosStreamOpenStm ```cpp ASStm CosStreamOpenStm(CosObj stream, CosStreamOpenMode mode) ``` Header: `CosProcs.h:926` Creates a new, non-seekable `ASStm` for reading data from a Cos stream. The data in the Cos stream may be filtered and encrypted. After opening the Cos stream, data can be read from it into memory using `ASStmRead()`. When reading is completed, close the stream using `ASStmClose()`. **Parameters** - `stream` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The Cos stream object for which an `ASStm` is opened. - `mode` ([`CosStreamOpenMode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosStreamOpenMode)): This must be one of the `CosStreamOpenMode` values. **Returns:** [`ASStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStm) The newly-opened `ASStm`. **See also:** [`ASStmRead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStmRead), [`ASStmWrite`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStmWrite), [`CosNewStream`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewStream) #### CosStreamPos ```cpp ASTCount CosStreamPos(CosObj stream) ``` Header: `CosProcs.h:953` Gets the byte offset of the start of a Cos stream's data in the PDF file (which is the byte offset of the beginning of the line following the `stream` token). Use this method to obtain the file location of any private data in a stream that you need to read directly rather than letting it pass through the normal Cos mechanisms. For example, this could apply to a QuickTime video embedded in a PDF file. `CosStreamPos()` is only valid when called on a stream that is already stored in a PDF document. If the stream was created using `CosNewStream()`, the new stream is stored in the document's temp file, and you cannot invoke `CosStreamPos()` on it. After the file has been saved, you can use `CosStreamPos()` on the stream. **Parameters** - `stream` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The stream whose current position is obtained. **Returns:** [`ASTCount`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTCount) **Exceptions** - `cosErrInvalidObj`: is raised if the stream object has not yet been saved to the PDF file. In other words, before you can call `CosStreamPos()` on a newly created stream, you must first save the PDF file. **See also:** [`CosStreamDict`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosStreamDict), [`CosStreamLength`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosStreamLength) #### CosStreamPos64 ```cpp ASFilePos64 CosStreamPos64(CosObj stream) ``` Header: `CosProcs.h:2338` Gets the byte offset of the start of a Cos stream's data in the PDF file. For details, see `CosStreamPos()`. This is the same as `CosStreamPos()`, except that the return value is a 64-bit file position instead of a 32-bit file position. **Parameters** - `stream` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The stream whose current position is obtained. **Returns:** [`ASFilePos64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFilePos64) The byte offset of the start of the Cos stream's data in the PDF file. **Exceptions** - `cosErrInvalidObj`: is raised if the stream object has not yet been saved to the PDF file. **See also:** [`CosStreamPos`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosStreamPos), [`CosStreamLength`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosStreamLength) ### Typedefs (3) #### CosByteMax ```cpp typedef ASInt32 CosByteMax ``` Header: `CosExpT.h:52` `-1` for none, error, or other special meaning #### CosStreamOpenMode ```cpp typedef ASEnum8 CosStreamOpenMode ``` Header: `CosExpT.h:169` Constants that specify whether filters and decryption should be applied to the stream's data. **See also:** [`CosStreamOpenStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosStreamOpenStm) #### CosStreamStartAndCode ```cpp typedef ASInt32 CosStreamStartAndCode ``` Header: `CosExpT.h:50` ## CosString ### Functions (6) #### CosCopyStringValue ```cpp char * CosCopyStringValue(CosObj obj, ASTCount *nBytes) ``` Header: `CosProcs.h:1459` Returns a newly allocated buffer containing a copy of the Cos object's string value. Upon return, `nBytes` contains the number of bytes in the original Cos string. `CosCopyStringValue()` never returns `NULL`; it raises an exception if the allocation fails. The client is responsible for freeing the result by calling `ASfree()`. `CosCopyStringValue()` allocates extra memory past the end of the string and writes zeros into these extra bytes to ensure that the string is `NULL`-terminated whether viewed as a UTF-16 (Unicode) string or as a C string (these bytes are not included in the number returned in `nBytes`). If the Cos string has `0` length, `nBytes` will be `0`, and a pointer to newly allocated memory containing some zero bytes is returned (that is, `CosCopyStringValue()` still returns a `NULL`-terminated string but with zero length). An out-of-memory exception is raised if insufficient memory is available. It can also raise any exception that CosStringValue() can raise. @note In general, the returned value is not a `NULL`-terminated C string. Cos string objects are binary and can contain arbitrary byte sequences, including `NULL` characters. Standard C string handling functions may not work as expected. @since **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): IN The Cos object whose string value is copied and returned. - `nBytes` ([`ASTCount *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTCount)): OUT (Filled by the method) The length of the original Cos string in bytes. It can be `NULL` if you do not care how many bytes were in the original string. **Returns:** `char *` **See also:** [`CosStringValueSafe`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosStringValueSafe) #### CosNewString ```cpp CosObj CosNewString(CosDoc dP, ASBool indirect, const char *str, ASTArraySize nBytes) ``` Header: `CosProcs.h:234` Creates and returns a new Cos string object. @since **Parameters** - `dP` ([`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc)): The document in which the string is used. - `indirect` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): If `true`, it creates the string as an indirect object, and sets the document (`dP`) object's `PDDocNeedsSave` flag (see `PDDocFlags`). If `false`, it creates the string as a direct object. - `str` (`const char *`): The value that the new string will have. It is not a C string, since Cos strings can contain `NULL` characters. The data in `str` is copied; that is, if `str` was dynamically allocated, it can be freed after this call. - `nBytes` ([`ASTArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize)): The length of `str`. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) **See also:** [`CosStringValue`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosStringValue), [`CosObjDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjDestroy) #### CosStringGetHexFlag ```cpp ASBool CosStringGetHexFlag(CosObj cosObj) ``` Header: `CosProcs.h:1301` Gets the hex flag of the `CosString`. The hex flag specifies whether the `CosString` should be written out as hex when writing the Cos Object to file. **Parameters** - `cosObj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): IN/OUT The `CosString` for which the hex flag is obtained. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) The current value of the flag. **Exceptions** - `cosErrExpectedString` **See also:** [`CosStringSetHexFlag`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosStringSetHexFlag) #### CosStringSetHexFlag ```cpp ASBool CosStringSetHexFlag(CosObj cosObj, ASBool setHex) ``` Header: `CosProcs.h:1288` Sets the hex flag of the `CosString`. The hex flag specifies whether the `CosString` should be written out as hex when writing the Cos Object to file. **Parameters** - `cosObj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The `CosString` for which the hex flag is set. - `setHex` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): The value to set for the flag. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) The value of `setHex`. **Exceptions** - `cosErrExpectedString` **See also:** [`CosStringGetHexFlag`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosStringGetHexFlag) #### CosStringValue ```cpp char * CosStringValue(CosObj obj, ASTCount *nBytes) ``` Header: `CosProcs.h:586` Gets the value of a string Cos object, and the string's length. An exception is raised if the type of `obj` is not a `CosString`. **Note:** The pointer returned from this method is not guaranteed to remain valid if `CosStringValue()` is called again. It is recommended that you use `CosStringValueSafe()` or `CosCopyStringValue()` instead; these methods place the string into a user-allocated buffer. **Note:** The caller must immediately copy the returned string. The memory pointed to be the return value may become invalid if any memory-allocating calls are made. In particular, consider the sequence: `str1 = CosStringValue(...); str2 = CosStringValue(...);` In this case, the contents of `str1` may be invalid by the time the second CosStringValue() call returns. **Note:** The returned value is not a C-style string. Cos string objects can contain `NULL` bytes. Standard C string-handling functions may not work as expected. **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): IN The object whose value is obtained. - `nBytes` ([`ASTCount *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTCount)): OUT (Filled by the method) The length of the string, in bytes. It must be a non-`NULL` pointer. **Returns:** `char *` The value of `obj`. **See also:** [`CosNewString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewString), [`CosCopyStringValue`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosCopyStringValue) #### CosStringValueSafe ```cpp char * CosStringValueSafe(CosObj obj, char *buffer, ASTArraySize bufferSize, ASTCount *nBytes) ``` Header: `CosProcs.h:1488` Copies at most `bufferSize` bytes from the `obj` parameter's string value into `buffer`, and stores the actual length of the Cos string in `*nBytes`. If `bufferSize` is greater than the length of the Cos string, the remaining bytes in `buffer` have undefined values upon return. A bad-parameter exception is raised if `bufferSize` is less than `0` or `nBytes` is `NULL`. It can also raise any exception that `CosStringValue()` can raise. **Note:** In general, the returned value is not a `NULL`-terminated C string. Cos string objects are binary data and can contain any arbitrary byte sequence, including embedded `NULL` characters. Standard C string handling functions may not work as expected. **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The Cos object whose string value is copied. - `buffer` (`char *`): The buffer into which the Cos string value is copied, or `NULL`. - `bufferSize` ([`ASTArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTArraySize)): The length of `buffer` or `0`. - `nBytes` ([`ASTCount *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASTCount)): (Filled by the method) The length of the original Cos string in bytes (which may be more than `bufferSize`). It must be a non-`NULL` pointer. **Returns:** `char *` A copy of the Cos string value or an exception. It will never return `NULL`. **See also:** [`CosCopyStringValue`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosCopyStringValue) ## PDDoc ### Enums (1) #### AdobePDFVersion Header: `CosExpT.h:339` **Values** - `kNullPDFVersion = 0x00000000` - `kMinPDFVersion = 0x00010000` - `kAdobeAcrobat4Version = 0x00010300` - `kAdobeAcrobat5Version = 0x00010400` - `kAdobeAcrobat6Version = 0x00010500` - `kAdobeAcrobat7Version = 0x00010600` - `kAdobeAcrobat8Version = 0x00010700` - `kAdobeAcrobat9Version = 0x00010703` - `kAdobeAcrobat9_1Version = 0x00010705` - `kAdobeAcrobat10Version = 0x00010708` - `kAdobeAcrobat11Version = 0x0001070B` - `kMinSaveVersion = kAdobeAcrobat4Version` - `kMinXRefStreamVersion = kAdobeAcrobat6Version` - `kDefaultPDFVersion = kAdobeAcrobat7Version` - `kLastAdobe1XVersionWithoutExt = 0x00010700` - `kLastAdobe1XVersionWithExt = kAdobeAcrobat11Version` - `kMinPDFNextVersion = 0x00020000` - `kCurrentPDFVersion = 0x00020000` --- # PD Layer Source: https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer ## ASFileAttachment ### Functions (3) #### ASFileAttachmentCreatePathName ```cpp void ASFileAttachmentCreatePathName(PDDoc pdDoc, ASText pathText, ASFileSys *fileSys, ASPathName *pathName) ``` Header: `PDProcs.h:12669` Creates an `ASPathName` corresponding to the specified file or folder in the collection. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document containing the specified file or folder. - `pathText` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): The text-based representation of the path. The path consists of a file name or sequence of file names. A file name may not contain any of the characters `'\', '/', ':', '*', '?', '<', '>', '|'`, and may not contain `'.'` as the final character. When `'/'` appears in a path, it signifies that the preceding file name is a folder, and that the subsequent file name is a child of that folder. The root of a collection may be identified by passing `"/"`, `NULL`, or an empty string for `pathText`. - `fileSys` ([`ASFileSys *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): A pointer that will be filled by the function. This parameter provides the caller with the `ASFileSys` to use in conjunction with the specified file or folder. - `pathName` ([`ASPathName *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): A pointer that will be filled by the function. This parameter provides the caller with the `ASPathName` to use in conjunction with the specified file or folder. **Returns:** `void` #### ASFileAttachmentGetPDFileAttachment ```cpp ASBool ASFileAttachmentGetPDFileAttachment(ASFileSys fileSys, ASPathName pathName, PDFileAttachment *attachment) ``` Header: `PDProcs.h:12680` Produces a `PDFileAttachment` corresponding to the `ASFileSys` and `ASPathName`. It raises an exception if the `ASFileSys` is is not the embedded files file system, or if the `ASPathName` or `PDFileAttachment` parameters are `NULL`. **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): The `ASFileSys` for file attachments. - `pathName` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): The `ASPathName` identifying the file attachment of interest. - `attachment` ([`PDFileAttachment *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileAttachment)): A pointer that will be receive the file attachment. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the file attachment was found, `false` otherwise. #### ASFileAttachmentGetPDFolder ```cpp ASBool ASFileAttachmentGetPDFolder(ASFileSys fileSys, ASPathName pathName, PDFolder *folder) ``` Header: `PDProcs.h:12691` Produces a `PDFolder` corresponding to the `ASFileSys` and `ASPathName`. It raises an exception if the `ASFileSys` is is not the embedded files file system, or if the `ASPathName` or `PDFolder` parameters are `NULL`. **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): The `ASFileSys` for file attachments - `pathName` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): The `ASPathName` identifying the folder of interest. - `folder` ([`PDFolder *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFolder)) **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the folder was found, `false` otherwise. ## General ### Functions (18) #### PDApplyFunction ```cpp void PDApplyFunction(CosObj funcDict, const float inVals[], float outVals[]) ``` Header: `PDProcs.h:7652` Given a CosObj that represents a function, it applies the function to the supplied values. It raises an error if the CosObj is malformed. Deprecateduse PDApplyFunctionEx instead **Parameters** - `funcDict` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The CosObj representing a function. - `inVals` (`const float`): Input values. - `outVals` (`float`): Output values. **Returns:** `void` **Exceptions** - `genErrBadParm`: is raised if the CosObj is not a function dictionary. #### PDApplyFunctionEx ```cpp void PDApplyFunctionEx(CosObj funcDict, const float inVals[], const ASArraySize nInput, float outVals[], const ASArraySize nOutput) ``` Header: `PDProcs.h:12709` Given a CosObj that represents a function, it applies the function to the supplied values. It raises an error if the CosObj is malformed. **Parameters** - `funcDict` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The CosObj representing a function. - `inVals` (`const float`): Input values. - `nInput` ([`const ASArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASArraySize)): Number of input values. - `outVals` (`float`): Output values. - `nOutput` ([`const ASArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASArraySize)): Number of output values. **Returns:** `void` **Exceptions** - `genErrBadParm`: is raised if the CosObj is not a function dictionary or the number of i/o do not match with that of the function. #### PDDrawCosObjToWindow ```cpp void PDDrawCosObjToWindow(CosObj cosObj, void *window, void *displayContext, ASBool isDPS, ASFixedMatrix *matrix, ASFixedRect *updateRect, CancelProc cancelProc, void *cancelProcClientData) ``` Header: `PDProcs.h:5502` Draws the specified stream of PDF marking operators into the specified window. This method is used for platform-independent drawing of graphics and text. This method changes the Current Transformation Matrix (CTM) and zoom factor for the current page. This leaves the file "dirty," or stale. The version of the file on the disk no longer matches the more current version in system memory. See the description of Resource Dictionaries in ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.8.3, on page 82. You can find this document on the web store of the International Standards Organization (ISO). See the description of the Content Stream Operators in Annex A of the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, Annex A.2, on page 643. You can find this document on the web store of the International Standards Organization (ISO). A pseudocode example of the stream object is: `<< /Length 1000 /Filter` `[...filters...] /Resources <<` `/ProcSet [ /PDF /Text ]` `/Font <> >>` `>>` `stream` `...stream data...` `endstream` **Note:** Platform: ((!MAC_PLATFORM || (MAC_PLATFORM && !AS_ARCH_64BIT))) && ((!MAC_PLATFORM)) **Parameters** - `cosObj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The stream Cos object to draw into the window. This stream can be created using CosNewStream(). The stream's dictionary must contain a Resources key whose value is a dictionary specifying all the resources needed to draw the Cos object (including a ProcSet entry). Its structure and contents are the same as for the Resources dictionary for a Page object. - `window` (`void *`): A pointer to a platform-dependent window object (`HWND` on Windows, `WindowPtr`). On Windows, to draw into an offscreen `DC`, pass `NULL` for `window`. - `displayContext` (`void *`): A pointer to a platform-dependent display context structure (`hDC` on Windows). - `isDPS` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): Currently unused. Always set it to `false`. - `matrix` (`ASFixedMatrix *`): A pointer to a matrix to concatenate onto the default page matrix. It is useful for scaling and for converting from page to window coordinates. - `updateRect` (`ASFixedRect *`): A pointer to a rectangle, specified in user space coordinates. Any objects outside of `updateRect` will not be drawn. All objects are drawn if `updateRect` is `NULL`. - `cancelProc` ([`CancelProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#CancelProc)): A procedure called periodically to check for the user's cancelling of the drawing operation. The default cancel proc can be obtained using AVAppGetCancelProc(). It may be `NULL`, in which case no cancel proc is used. - `cancelProcClientData` (`void *`): A pointer to user-supplied data to pass to `cancelProc` each time it is called. It should be `NULL` if `cancelProc` is `NULL`. **Returns:** `void` **See also:** [`CosNewStream`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosNewStream), [`PDPageDrawContentsToWindow`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageDrawContentsToWindow), [`PDPageDrawContentsToWindowEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageDrawContentsToWindowEx) #### PDDrawCosObjWithParams ```cpp void PDDrawCosObjWithParams(CosObj cosObj, PDDrawParams params) ``` Header: `PDProcs.h:10537` Provides control over the rendering of contents, including both those parameters you would pass to PDDrawCosObjWithParams(), and an optional-content context that determines which contents are visible. **Note:** Platform: ((!MAC_PLATFORM || (MAC_PLATFORM && !AS_ARCH_64BIT))) && ((!MAC_PLATFORM)) **Parameters** - `cosObj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The object to draw. - `params` (`PDDrawParams`): The parameters with which to draw the object, including the optional-content context to use for content visibility. **Returns:** `void` **Exceptions** - `pdPErrUnableToCreateRasterPort` **See also:** [`PDDrawCosObjToWindow`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDrawCosObjToWindow), [`PDPageEnumContents`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageEnumContents) #### PDFormEnumPaintProc ```cpp void PDFormEnumPaintProc(PDXObject obj, PDGraphicEnumMonitor mon, void *clientData) ``` Header: `PDProcs.h:3994` (Obsolete, provided only for backwards compatibility) Enumerates a form's drawing operations. **Parameters** - `obj` ([`PDXObject`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXObject)): The form whose drawing operations are enumerated. - `mon` ([`PDGraphicEnumMonitor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDGraphicEnumMonitor)): A structure containing user-supplied callbacks that are called for each drawing operator on a page. Enumeration ends if any procedure returns `false`. - `clientData` (`void *`): A pointer to user-supplied data to pass to `mon` each time it is called. **Returns:** `void` **See also:** [`PDFormEnumResources`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFormEnumResources), [`PDFormEnumPaintProcWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFormEnumPaintProcWithParams) #### PDFormEnumPaintProcWithParams ```cpp void PDFormEnumPaintProcWithParams(PDXObject obj, PDGraphicEnumParams params) ``` Header: `PDProcs.h:10557` Enumerates a form's drawing operations for those contents that are visible in a given optional-content context. The parameters include both the monitor and data you would pass to PDFormEnumPaintProc(), and an optional-content context that determines which contents are visible. **Parameters** - `obj` ([`PDXObject`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXObject)): The form whose drawing operations are enumerated. - `params` (`PDGraphicEnumParams`): The parameters, including the optional-content context to use for content visibility. **Returns:** `void` **Exceptions** - `pdPErrUnableToCreateRasterPort` **See also:** [`PDFormEnumPaintProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFormEnumPaintProc), [`PDCharProcEnumWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCharProcEnumWithParams) #### PDFormEnumResources ```cpp void PDFormEnumResources(PDXObject obj, PDResourceEnumMonitor mon, void *clientData) ``` Header: `PDProcs.h:3977` (Obsolete, provided only for backwards compatibility) Enumerates the resources used by a form. **Parameters** - `obj` ([`PDXObject`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXObject)): The form whose resources are enumerated. - `mon` ([`PDResourceEnumMonitor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDResourceEnumMonitor)): A structure containing user-supplied callbacks that are called for each of the form's resources. Enumeration ends if any procedure returns `false`. - `clientData` (`void *`): A pointer to user-supplied data to pass to `mon` each time it is called. **Returns:** `void` **See also:** [`PDFormEnumPaintProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFormEnumPaintProc) #### PDFormGetBBox ```cpp void PDFormGetBBox(PDXObject obj, ASFixedRect *bboxP) ``` Header: `PDProcs.h:3938` (Obsolete, provided only for backwards compatibility) Gets a form's bounding box. **Parameters** - `obj` ([`PDXObject`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXObject)): The form whose bounding box is obtained. - `bboxP` (`ASFixedRect *`): (Filled by the method) A pointer to a rectangle containing the form's bounding box, specified in user space coordinates. **Returns:** `void` #### PDFormGetFormType ```cpp ASInt32 PDFormGetFormType(PDXObject obj) ``` Header: `PDProcs.h:3927` (Obsolete, provided only for backwards compatibility) Gets the value of a form's FormType attribute. **Parameters** - `obj` ([`PDXObject`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXObject)): The form whose type is obtained. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The form type (the value of the PDF FormType key). This value is `1` for PDF 1.0, 1.1, and 1.2. #### PDFormGetMatrix ```cpp void PDFormGetMatrix(PDXObject obj, ASFixedMatrix *matrixP) ``` Header: `PDProcs.h:3951` (Obsolete, provided only for backwards compatibility) Gets the specified form's transformation matrix. **Parameters** - `obj` ([`PDXObject`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXObject)): The form whose transformation matrix is obtained. - `matrixP` (`ASFixedMatrix *`): (Filled by the method) A pointer to a matrix containing the form's transformation matrix, which specifies the transformation from form space to user space. See Section 4.9 in the *PDF Reference*. **Returns:** `void` #### PDFormGetXUIDCosObj ```cpp CosObj PDFormGetXUIDCosObj(PDXObject obj) ``` Header: `PDProcs.h:3962` (Obsolete, provided only for backwards compatibility) Gets the array Cos object corresponding to a form's XUID. An XUID is an array of numbers that uniquely identify the form in order to allow it to be cached. **Parameters** - `obj` ([`PDXObject`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXObject)): The form whose XUID is obtained. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) The array Cos object for the form's XUID. #### PDImageColorSpaceGetIndexLookup ```cpp void PDImageColorSpaceGetIndexLookup(PDXObject xobj, ASUns8 *data, ASInt32 dataLen) ``` Header: `PDProcs.h:3917` (Obsolete, provided only for backwards compatibility) Gets the lookup table for an indexed color space. The table will contain the number of entries specified by the index size, and there will be 1 byte for each color component for each entry. The number of color components depends on the color space: Color Number of components gray 1 RGB 3 CMYK 4 Lab 3 For additional information on indexed color space, see the Special Color Spaces section in the ISO 32000-1:2008, Document Management- Portable Document Format-Part 1: PDF 1.7, section 8.6.6, page 155. You can find this document on the web store of the International Standards Organization (ISO). There is also some useful discussion in the *PostScript Language Reference Manual* under indexed color spaces. [https://www.adobe.com/jp/print/postscript/pdfs/PLRM.pdf](https://www.adobe.com/jp/print/postscript/pdfs/PLRM.pdf) **Parameters** - `xobj` ([`PDXObject`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXObject)): The image whose lookup table is obtained. - `data` ([`ASUns8 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns8)): (Filled by the method) An array for the returned color space information. - `dataLen` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The length of data in bytes. **Returns:** `void` **See also:** [`PDInlineImageColorSpaceGetIndexLookup`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDInlineImageColorSpaceGetIndexLookup) #### PDImageGetAttrs ```cpp void PDImageGetAttrs(PDXObject obj, PDImageAttrsP attrsP, ASInt32 attrsLen) ``` Header: `PDProcs.h:3881` (Obsolete, provided only for backwards compatibility. Use PDEImageGetAttrs and/or Cos-level calls instead.) Gets the attributes of an image (for example, Type, Subtype, Name, Width, Height, BitsPerComponent, ColorSpace, Decode, Interpolate, or ImageMask). **Parameters** - `obj` ([`PDXObject`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXObject)): The image whose attributes are obtained. - `attrsP` (`PDImageAttrsP`): (Filled by the method) A pointer to a `PDImageAttrs` structure containing the image attributes. - `attrsLen` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): It must be `sizeof(PDImageAttrs)`. **Returns:** `void` **See also:** [`PDInlineImageGetAttrs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDInlineImageGetAttrs) #### PDImageSelAdjustMatrix ```cpp void PDImageSelAdjustMatrix(void *callData, ASFixedMatrix newUserMatrix) ``` Header: `PDProcs.h:7636` This method is obsolete and is provided only for backwards compatibility. The method allows an image selector client to change the region of the page occupied by an image. It must only be used by image selector clients that return data for only the visible part of an image, to set the region of the page that the sub-image occupies. It must not be used otherwise. This method only has an effect while displaying on the screen. It does nothing when printing. The matrix set by this call remains in effect only for the current image. The Acrobat viewer automatically replaces it after the image has been drawn. **Parameters** - `callData` (`void *`): The value passed to the image selector as a parameter to PDImageSelectAlternate(). - `newUserMatrix` (`ASFixedMatrix`): The matrix that will replace the `imageToUserMatri` (see PDImageSelGetGeoAttr()). The `imageToDevMatrix` is automatically calculated from `newUserMatrix`. **Returns:** `void` **See also:** `PDImageSelGetGeoAttr (obsolete)`, `PDImageSelGetDeviceAttr (obsolete)`, `PDImageSelectAlternate (obsolete)` #### PDImageSelGetDeviceAttr ```cpp void PDImageSelGetDeviceAttr(void *callData, PDColorSpace *colorSpaceP, ASUns32 *bitsPerPixelP, ASAtom *deviceTypeP) ``` Header: `PDProcs.h:7608` This method is obsolete and provided only for backwards compatibility. The method gets device-related attributes for a particular image XObject. It must only be used from within an image selector client, since it returns information that is only valid in that context. This method can be used by an image selector client to obtain additional information to help the selector determine which alternate image to choose. If an image is displayed on two devices simultaneously (for example, if the window containing the image is split across two monitors in a multi-monitor system), the values returned for `colorSpaceP` and `bitsPerPixelP` are each the maximum for the devices on which the image is currently displayed. For example, if the image is currently split across the following devices: 8-bit gray scale monitor 4-bit RGB color monitor `colorSpaceP` would be `DeviceRGB`, because that is the *highest* color space on which the image is currently displayed. `bitsPerPixelP` would be `8`, because that is the highest bit depth on which the image is currently displayed. **Parameters** - `callData` (`void *`): (Filled by the method) The value passed to the image selector as a parameter to PDImageSelectAlternate(). - `colorSpaceP` ([`PDColorSpace *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDColorSpace)): (Filled by the method) The destination device's color space. It will be one of the following: ValueDescription PDDeviceGrayGrayscale device PDDeviceRGBRGB device PDDeviceCMYKCMYK device If the device has some other color space or its color space cannot be determined, PDDeviceRGB is returned. - `bitsPerPixelP` ([`ASUns32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): (Filled by the method) The number of bits used for each pixel. For example, a device with 8 bits red, 8 bits green, and 8 bits blue would have a `bitsPerPixel` of `24`. If `bitsPerPixelP` has a value of `0` (instead of the more standard `1`, `8`, or `24`), the number of bits per pixel on the output device could not be determined. Value Description `Display` A display device such as a monitor `PostScript` A PostScript printer or PostScript file `nonPostScriptPrinter` A non-PostScript printer - `deviceTypeP` ([`ASAtom *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): (Filled by the method) The output device type. It will be one of the following: **Returns:** `void` **See also:** `PDImageSelAdjustMatrix (obsolete)`, `PDImageSelGetDeviceAttr (obsolete)`, `PDImageSelectAlternate (obsolete)` #### PDImageSelGetGeoAttr ```cpp void PDImageSelGetGeoAttr(void *callData, ASFixedRect *updateBBoxP, ASFixedMatrix *imageToDefaultMatrixP, ASFixedMatrix *imageToDevMatrixP) ``` Header: `PDProcs.h:7541` This method is obsolete and provided only for backwards compatibility. The method requests geometry-related attributes of an image XObject. This method can be used by an image selector client to obtain additional information to help the selector determine which alternate image to choose. • `imageToDefaultMatrixP->a` is equal to the image horizontal size in 1/72 of an inch units. • `imageToDefaultMatrixP->b = 0` • `imageToDefaultMatrixP->c = 0` • `imageToDefaultMatrixP->d` is equal to the image vertical size in 1/72 of an inch units. • `imageToDefaultMatrixP->h` is equal to the left edge of image. • `imageToDefaultMatrixP->v` is equal to the bottom edge of the image. In other words, this matrix provides the image's height, width, and position on the page, all in units of points (compare to `imageToDefaultMatrixP`). The intersection of the rectangle obtained by transforming a 1x1 unit rectangle (the image) through `imageToDeviceMatrixP` and the `updateBBoxP` rectangle is the region of the image that is actually drawn. This is the region of the image for which data is required. **Parameters** - `callData` (`void *`): (Filled by the method) The value passed to the image selector as a parameter to PDImageSelectAlternate(). - `updateBBoxP` (`ASFixedRect *`): (Filled by the method) The rectangle bounding the region of the page to update. This is the intersection of the visible portion of the page, any update regions, and any clipping paths that have been explicitly set in the PDF file. Its coordinates are specified in default user space. - `imageToDefaultMatrixP` (`ASFixedMatrix *`): (Filled by the method) A matrix specifying the transformation from image space (the space in which all images are 1x1 units) to default user space (the space with 72 units per inch). It contains sufficient information for the image selector plug-in to determine the image's size and location on the page. For a *normal page and image* (an *upright* image on a non-rotated page), the following is true: - `imageToDevMatrixP` (`ASFixedMatrix *`): (Filled by the method) A matrix specifying the transformation from image space (the space in which all images are 1x1 unit) to device space (the space in which one unit is one pixel). This matrix provides the image's height, width, and position on the page, all in pixels (compare to `imageToDefaultMatrixP`). **Returns:** `void` **See also:** `PDImageSelAdjustMatrix (obsolete)`, `PDImageSelGetDeviceAttr (obsolete)`, `PDImageSelectAlternate (obsolete)` #### PDImageSelectAlternate ```cpp CosObj PDImageSelectAlternate(CosObj image, ASBool print, ASUns32 tickLimit, ASBool *cacheImageP, void *callData) ``` Header: `PDProcs.h:7487` This method is obsolete and never called in Acrobat 8. (Obsolete, provided only for backwards compatibility) Selects which Alternate image to use. This method can do one of three things: • Return an existing Alternate. • Create and return an image XObject. • Indicate that this XObject should be skipped. This method is called each time the Acrobat viewer draws an XObject image, regardless of whether the image XObject has an Alternates key. You can replace this method with your own version, using HFTReplaceEntry(). • If `tickLimit` is zero, the image selector must not return control to the Acrobat viewer until the selector can provide the alternate image to use. • If `tickLimit` is nonzero, the image selector does not have to provide the image XObject within `tickLimit`, but it must raise the fileErrBytesNotReady exception if it cannot. This returns control to the Acrobat viewer and informs it that the data is not ready. The Acrobat viewer then calls the image selector periodically until the image selector returns the selected image XObject. **Parameters** - `image` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The Cos object for this image XObject's base image. Under some circumstances, PDImageSelectAlternate() can be called with an XObject type other than an image; for example, a form. Because of this, your code must check the XObject's subtype (you can use CosDictGet() to read the value of the XObject's Subtype key). If the subtype is not Image, your code must not modify the XObject, but simply return the CosObj that was passed to you. - `print` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): `true` if printing, `false` if displaying. - `tickLimit` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The amount of time, in ticks, before the image selector must return control to the Acrobat viewer. This parameter is not relevant for image selectors that simply choose an existing alternate or create a new image XObject using Cos methods, but it is relevant for image selectors that create a new image XObject by calculating or reading data from a network or a slow device. - `cacheImageP` ([`ASBool *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): If `true`, the image data returned to the Acrobat viewer is cached for future use. If `false`, it is not. Pass `true` if you expect your image data to remain valid for at least several calls to your client. Pass `false` if you expect your image data to change on the next call to your client. If you create and return a Cos stream object with an external file system and the stream's data will not always be the same, you must set `cacheImageP` to `false`. If you fail to do this, the Acrobat viewer may use cached image data when it should not. - `callData` (`void *`): An opaque pointer containing data that must be passed in other image selector calls. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) The image XObject to use. Returning a `NULL` Cos object (obtained using CosNewNull) tells the Acrobat viewer to skip this XObject entirely. **Exceptions** - `fileErrBytesNotReady` **See also:** `PDImageSelGetGeoAttr (obsolete)`, `PDImageSelGetDeviceAttr (obsolete)`, `PDImageSelAdjustMatrix (obsolete)` #### PDSetHostEncoding ```cpp void PDSetHostEncoding(ASHostEncoding encoding, char *parseTable) ``` Header: `PDProcs.h:10880` For internal use only. **Parameters** - `encoding` ([`ASHostEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASHostEncoding)) - `parseTable` (`char *`) **Returns:** `void` ### Typedefs (22) #### PDCharOffset ```cpp typedef ASUns16 PDCharOffset ``` Header: `PDExpT.h:106` #### PDColorSpace ```cpp typedef ASEnum8 PDColorSpace ``` Header: `PDExpT.h:924` #### PDCount ```cpp typedef ASInt32 PDCount ``` Header: `PDExpT.h:111` A numeric count value for use in `PDImageAttrs`. #### PDEndStyle ```cpp typedef ASEnum8 PDEndStyle ``` Header: `PDExpT.h:5880` #### PDFindFlags ```cpp typedef ASEnum8 PDFindFlags ``` Header: `PDExpT.h:2218` #### PDHorizAlign ```cpp typedef ASEnum8 PDHorizAlign ``` Header: `PDExpT.h:6570` #### PDImageScalar ```cpp typedef ASInt32 PDImageScalar ``` Header: `PDExpT.h:92` A signed measurement of an image offset, for use in `PDImageAttrs`. #### PDJoinStyle ```cpp typedef ASEnum8 PDJoinStyle ``` Header: `PDExpT.h:5871` #### PDOperation ```cpp typedef ASEnum8 PDOperation ``` Header: `PDExpT.h:1020` #### PDPlacementTypes ```cpp typedef ASEnum8 PDPlacementTypes ``` Header: `PDExpT.h:5883` #### PDSaveFlags2 ```cpp typedef ASFlagBits PDSaveFlags2 ``` Header: `PDExpT.h:1652` 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. **See also:** [`PDDocSaveWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSaveWithParams), [`PDDocInsertPages`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocInsertPages), [`PDDocSaveParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSaveParams), [`PDSaveFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDSaveFlags) #### PDSmallFlagBits ```cpp typedef ASUns16 PDSmallFlagBits ``` Header: `PDExpT.h:67` A flag value for use in PDDocInsertPagesParams(). **See also:** [`PDDocInsertPages`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocInsertPages) #### PDVertAlign ```cpp typedef ASEnum8 PDVertAlign ``` Header: `PDExpT.h:6574` #### PDWatermarkDrawOption ```cpp typedef ASEnum8 PDWatermarkDrawOption ``` Header: `PDExpT.h:6642` #### PDiFontMetric ```cpp typedef ASInt16 PDiFontMetric ``` Header: `PDExpT.h:87` A font metric value (which is never negative), for use in `PDFontMetrics`. #### StdPassword ```cpp typedef char StdPassword[MAX_PWCHARS+1][MAX_PWCHARS+1] ``` Header: `PDExpT.h:4314` #### PDFindTranslateStringProc ```cpp typedef ASBool(*) PDFindTranslateStringProc(char *string, ASInt32 stringLength, PDWord pdWord, void *clientData)(char *string, ASInt32 stringLength, PDWord pdWord, void *clientData) ``` Header: `PDExpT.h:3417` PDFindTranslateStringProc() is passed to PDFindText(). #### PDLaunchActionProc ```cpp typedef ASBool(*) PDLaunchActionProc(void *fileSpecHandlerObj, PDDoc pdDoc, PDAction pdAction)(void *fileSpecHandlerObj, PDDoc pdDoc, PDAction pdAction) ``` Header: `PDExpT.h:1177` (Optional) A callback for PDFileSpecHandler. It launches a specified file. It is called when the Acrobat viewer encounters a Launch (GoTo File) action. If this callback is `NULL`, no launch action is performed. #### PDResourceEnumColorSpaceProc ```cpp typedef ASBool(*) PDResourceEnumColorSpaceProc(char *name, CosObj colorSpace, void *clientData)(char *name, CosObj colorSpace, void *clientData) ``` Header: `PDExpT.h:2734` A callback for PDResourceEnumMonitor. It is called for color space resources. **See also:** [`PDFormEnumResources`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFormEnumResources) #### PDResourceEnumFontProc ```cpp typedef ASBool(*) PDResourceEnumFontProc(PDFont font, char *name, void *clientData)(PDFont font, char *name, void *clientData) ``` Header: `PDExpT.h:2694` A callback for PDResourceEnumMonitor. It is a procedure called for font resources. **See also:** [`PDFormEnumResources`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFormEnumResources) #### PDResourceEnumProcSetProc ```cpp typedef ASBool(*) PDResourceEnumProcSetProc(char *name, void *clientData)(char *name, void *clientData) ``` Header: `PDExpT.h:2720` A callback for PDResourceEnumMonitor. It is a procedure called for ProcSet resources. **See also:** [`PDFormEnumResources`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFormEnumResources) #### PDResourceEnumXObjectProc ```cpp typedef ASBool(*) PDResourceEnumXObjectProc(PDXObject xObject, char *name, void *clientData)(PDXObject xObject, char *name, void *clientData) ``` Header: `PDExpT.h:2707` A callback for PDResourceEnumMonitor. It is a procedure called for XObject resources. **See also:** [`PDFormEnumResources`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFormEnumResources) ### Structures (5) #### PDConstColorValue ```cpp typedef const struct _t_PDColorValueRec* PDConstColorValue ``` Header: `PDExpT.h:958` #### PDContent ```cpp typedef struct _t_PDContent* PDContent ``` Header: `PDBasicExpT.h:114` A pointer to a PDContent `struct`. #### PDFind ```cpp typedef struct _t_PDFind* PDFind ``` Header: `PDExpT.h:2191` #### PDResourceEnumMonitor ```cpp typedef struct _t_PDResourceEnumMonitor* PDResourceEnumMonitor ``` Header: `PDExpT.h:2745` A data structure containing callbacks used when enumerating the resources of a form with PDFormEnumResources() or PDPageEnumResources(). **Note:** PDPageEnumResources is provided only for backwards compatibility. You should use the PDFEdit API to enumerate page resources. **See also:** [`PDFormEnumResources`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFormEnumResources) #### PDTrapPreset ```cpp typedef struct PDTrapPresetRec * PDTrapPreset ``` Header: `PDExpT.h:5904` ### Enums (15) #### GCHTextType Header: `PDExpT.h:4402` **Values** - `kGCHTTipText = 1` - `kGCHTMiniText = 2` - `kGCHTLargeText = 3` #### HSEmitFonts Header: `PDExpT.h:5909` **Values** - `kHSEmitFontNoFonts = 0`: Embed no fonts. - `kHSEmitFontEmbeddedFonts = 1`: Emit all embedded fonts. - `kHSEmitFontAllFonts = 2`: Emit all fonts. #### InkTypes Header: `PDExpT.h:5944` Ink types. **Values** - `kNormal = 0` - `kTransparent = 1` - `kOpaqueInk = 2` - `kOpaqueIgnore = 3` #### PDCharSets Header: `PDExpT.h:2329` An enumerated data type that identifies the character set of a Type 1, Multiple Master Type 1, or TrueType font. **Values** - `PDUnknownCharSet = 0`: The font does not use Adobe standard encoding. - `PDStandardRomanCharSet = 1`: The font uses Adobe standard encoding. This is determined by the `"Uses Adobe Standard Encoding"` bit in the font descriptor. - `PDAdobeExpertCharSet = 2`: Currently unused. - `PDLastCharSet = 3` #### PDColorSpaces Header: `PDExpT.h:913` An enumerated data type that specifies the color space in which a color value is specified (for example, RGB or grayscale). **Values** - `PDDeviceGray = 0`: Grayscale. It requires one value entry to specify the color. - `PDDeviceRGB = 1`: Red-Green-Blue color specification. It requires three value entries to specify the color. - `PDDeviceCMYK = 2`: Cyan-Magenta-Yellow-Black color specification. It requires four value entries to specify the color. #### PDEContentAddPageFlags Header: `PDExpT.h:6828` **Values** - `kAnnotAll = 0x0001`: Copy all annotations; do not consult annotation type list - `kDoNotMergeFonts = 0x0004`: Do not merge duplicate fonts on merge: may result in larger files when saved, but can show performance benefits when inserting a page that uses a large number of fonts. #### PDEndStyles Header: `PDExpT.h:5872` **Values** - `kPDEndMiter = 0` - `kPDEndOverlap = 1` #### PDFindFlagTypes Header: `PDExpT.h:2194` Passed to PDFindText(). **Values** - `PDFindWholeWords = 0x0001`: Find whole words only. - `PDFindCaseSens = 0x0002`: Perform a case-sensitive search. - `PDFindReverse = 0x0004`: Perform a reverse order search. - `PDFindAllOnPage = 0x0008`: Return a PDTextSelect with all found words on the page. - `PDFindIgnoreFH = 0x0100`: Do not perform a match of full-width/half-width Kana characters. - `PDFindIgnoreDiacritics = 0x0200`: Ignore diacritics. - `PDFindReset = 0x0800`: Reset to the beginning of the document. #### PDHorizAlignments Header: `PDExpT.h:6569` **Values** - `kPDHorizLeft = 0` - `kPDHorizCenter = 1` - `kPDHorizRight = 2` #### PDInsertFlags Header: `PDExpT.h:2138` Used by PDDocInsertPages(). **Values** - `PDInsertBookmarks = 0x0001`: Insert bookmarks as well as pages. - `PDInsertAll = 0x1000`: Insert all Catalog and Info dictionary values as well as pages. - `PDInsertThreads = 0x0002`: Insert articles as well. - `PDDoNotInsertOutputIntent = 0x0004`: Do not merge output Intents - `PDInsertDoNotMergeFonts = 0x0008`: Do not merge duplicate fonts when merging documents. This may result in larger files when saved, but can show performance benefits when inserting a page that uses a large number of fonts. - `PDInsertDoNotResolveInvalidStructureParentReferences = 0x0010`: This is not necessary in most cases but it can show performance benefits for a document with a complicated Structure Tree. - `PDInsertDoNotRemovePageInheritance = 0x0020`: This can slow down the performance when document has a very large page tree - `PDInsertNamedDestinations = 0x0040`: Copy named destinations to maintain link annotations **See also:** `PDDOcInsertPages` #### PDJoinStyles Header: `PDExpT.h:5860` **Values** - `kPDJoinMiter = 0` - `kPDJoinRound = 1` - `kPDJoinBevel = 2` #### PDLayoutModes Header: `PDExpT.h:2038` 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()). **Values** - `PDLayoutDontCare = 0`: (Default) Use the user preference when opening the file, as specified in the `avpPageViewLayoutMode` preference, set by AVAppSetPreference(). - `PDLayoutSinglePage = 1`: Use single-page mode. - `PDLayoutOneColumn = 2`: Use one-column continuous mode. - `PDLayoutTwoColumnLeft = 3`: Use two-column continuous mode with the first page on the left. - `PDLayoutTwoColumnRight = 4`: Use two-column continuous mode with the first page on the right. - `PDLayoutTwoPageLeft = 5` - `PDLayoutTwoPageRight = 6` **See also:** `AVDocGetViewDef`, `AVPageViewGetLayoutMode`, `AVPageViewSetLayoutMode` #### PDVertAlignments Header: `PDExpT.h:6573` **Values** - `kPDVertTop = 0` - `kPDVertCenter = 1` - `kPDVertBottom = 2` #### PlateSeparationOptions Header: `PDExpT.h:5918` **Values** - `kEmitPlate = 0` - `kDontEmitPlate = 1` - `kConvertToProcess = 2`: Represents an ink used on a page. - `kConvertToAltSpace = 3`: Can be used while doing color convert only. This is a matching flag for kColorConvToAltSpace flag in PDColorConvertActionType kConvertToProcess matches kColorConvConvert in PDColorConvertActionType kEmitPlate & kDontEmitPlate matches kColorConvPreserve in PDColorConvertActionType #### marksStyles Header: `PDExpT.h:5955` **Values** - `kPDDefaultMarkType = 0`: No flags means InDesign style printer marks. - `kPDInDesignJ1MarkType = 1` - `kPDInDesignJ2MarkType = 2` - `kPDIllustratorMarkType = 3` - `kPDIllustratorJ = 4` - `kPDQuarkXPress = 5` ### Definitions (5) #### MAX_PWCHARS Header: `PDExpT.h:4312` Value: `255` #### kPDEmitEasternTileMarks Header: `PDExpT.h:6296` Value: `0x0002` Tile marks. #### kPDEmitNoMarks Header: `PDExpT.h:6286` Value: `0` Nothing. #### kPDEmitSlug Header: `PDExpT.h:6301` Value: `0x0004` Emit information about the document, name, page number, and so on. #### kPDEmitWesternTileMarks Header: `PDExpT.h:6291` Value: `0x0001` Tile marks. ## Metadata ### Functions (4) #### PDDocGetInfo ```cpp ASInt32 PDDocGetInfo(PDDoc doc, const char *infoKey, char *buffer, ASInt32 bufSize) ``` Header: `PDProcs.h:2322` Gets the value of a key in a document's Info dictionary, or the value of this same key in the XMP metadata, whichever is later. However, it is preferable to use PDDocGetXAPMetadataProperty(), because it also allows accessing XMP properties that are not duplicated in the Info dictionary. See the description of the Document Information Dictionary in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 14.3.3, page 549. You can find this document on the web store of the International Standards Organization (ISO). All values in the Info dictionary should be strings; other data types such as numbers and booleans should not be used as values in the Info dictionary. Users may define their own Info dictionary entries. In this case, it is strongly recommended that the key have the developer's prefix assigned by the Adobe Solutions Network. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document whose Info dictionary key is obtained. - `infoKey` (`const char *`): The name of the Info dictionary key whose value is obtained. - `buffer` (`char *`): (Filled by the method) The buffer containing the value associated with `infoKey`. If `buffer` is `NULL`, the method will just return the number of bytes required. **Note:** This text is stored in either PDFDocEncoding or in Unicode. If it is stored in Unicode, a valid Byte Order Mark must be present. - `bufSize` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The maximum number of bytes that can be written into `buffer`. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) If `buffer` is `NULL`, it returns the number of bytes in the specified key's value. If `buffer` is not `NULL`, it returns the number of bytes copied into `buffer`, excluding the terminating `NULL`. You must pass at least the `length + 1` as the buffer size since the routine adds a `'\0'` terminator to the data, even though the data is not a C string (it can contain embedded `'\0'` values). **See also:** `PDDocGetXAPMetadataProperty`, [`PDDocSetInfo`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetInfo) #### PDDocGetInfoASText ```cpp void PDDocGetInfoASText(PDDoc doc, const ASText key, ASText value) ``` Header: `PDProcs.h:11514` Gets the value of a key in a document's Info dictionary, or the value of this same key in the XMP metadata, whichever is latest as an ASText object. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document whose Info dictionary key is obtained. - `key` ([`const ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): The name of the Info dictionary key whose value is obtained. - `value` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): (Filled by the method) The text object containing the value associated with `key`. The client must pass a valid ASText object value. The routine does not allocate it. **Returns:** `void` **See also:** [`PDDocGetInfo`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetInfo), `PDDocGetXAPMetadataProperty`, `PDDocSetInfoASText`, [`PDDocSetInfo`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetInfo) #### PDDocSetInfo ```cpp void PDDocSetInfo(PDDoc doc, const char *infoKey, const char *buffer, ASInt32 nBytes) ``` Header: `PDProcs.h:2358` Sets the value of a key in a document's Info dictionary. However, it is preferable to use PDDocSetXAPMetadataProperty(), because it also allows accessing XMP properties that are not duplicated in the Info dictionary. See the description of the Document Information Dictionary in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 14.3.3, page 549. You can find this document on the web store of the International Standards Organization (ISO). All values in the Info dictionary should be strings; other data types such as numbers and Boolean values should not be used as values in the Info dictionary. If an Info dictionary key is specified that is not currently in the Info dictionary, it is added to the dictionary. Users may define their own Info dictionary entries. In this case, it is strongly recommended that the key have the developer's prefix assigned by the Adobe Developers Association. @note This text is stored in either PDFDocEncoding or in Unicode. If it is stored in Unicode, a valid Byte Order Mark must be present. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document whose Info dictionary key is set. - `infoKey` (`const char *`): The name of the Info dictionary key whose value is set. - `buffer` (`const char *`): The buffer containing the value to associate with `infoKey`. - `nBytes` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The number of bytes in `buffer`. **Returns:** `void` **See also:** [`PDDocGetInfo`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetInfo), `PDDocSetXAPMetadataProperty` #### PDDocSetInfoAsASText ```cpp void PDDocSetInfoAsASText(PDDoc doc, const ASText infoKey, const ASText value) ``` Header: `PDProcs.h:11531` Sets the value of a key in a document's Info dictionary. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document whose Info dictionary key is set. - `infoKey` ([`const ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): The name of the Info dictionary key whose value is set. - `value` ([`const ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): The text object containing the value to associate with `infoKey`. **Returns:** `void` **See also:** [`PDDocSetInfo`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetInfo), [`PDDocGetInfoASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetInfoASText), [`PDDocGetInfo`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetInfo), `PDDocSetXAPMetadataProperty` ## PDAction ### Functions (16) #### PDActionCanCopy ```cpp ASBool PDActionCanCopy(PDAction action) ``` Header: `PDProcs.h:8718` Tests whether the data from an action object can be copied to a clipboard for pasting. If the action is part of an action chain, the method tests all actions in the chain, and returns `true` only if all actions in the chain can be copied. **Parameters** - `action` ([`PDAction`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAction)): The action to test. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the action object or all actions in the action chain can be copied, `false` otherwise. **See also:** [`PDActionCanPaste`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionCanPaste), [`PDActionCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionCopy), [`PDActionPaste`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionPaste), [`PDActionDestroyClipboardData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionDestroyClipboardData) #### PDActionCanPaste ```cpp ASBool PDActionCanPaste(PDDoc dest, PDActionClipboardData data) ``` Header: `PDProcs.h:8750` Tests whether data from an action object that has been copied to a clipboard can be pasted into a destination document. It tests, for example, whether pasting is allowed by document permissions. **Parameters** - `dest` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The destination document. - `data` ([`PDActionClipboardData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionClipboardData)): The action data to test. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) **See also:** [`PDActionCanCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionCanCopy), [`PDActionCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionCopy), [`PDActionPaste`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionPaste), [`PDActionDestroyClipboardData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionDestroyClipboardData) #### PDActionCopy ```cpp PDActionClipboardData PDActionCopy(PDAction action) ``` Header: `PDProcs.h:8733` Copies action object data to a clipboard structure, from which it can be pasted. When the PDActionClipboardData is no longer required, it must be explicitly freed using PDActionDestroyClipboardData(). **Parameters** - `action` ([`PDAction`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAction)): The action to copy. **Returns:** [`PDActionClipboardData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionClipboardData) The action clipboard data object. **See also:** [`PDActionCanCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionCanCopy), [`PDActionCanPaste`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionCanPaste), [`PDActionPaste`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionPaste), [`PDActionDestroyClipboardData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionDestroyClipboardData) #### PDActionDestroy ```cpp void PDActionDestroy(PDAction action) ``` Header: `PDProcs.h:122` Destroys an action object. **Parameters** - `action` ([`PDAction`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAction)): IN/OUT The action to destroy. **Returns:** `void` **See also:** [`PDActionNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionNew), [`PDActionNewFromDest`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionNewFromDest), [`PDActionNewFromFileSpec`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionNewFromFileSpec), [`PDActionFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionFromCosObj) #### PDActionDestroyClipboardData ```cpp void PDActionDestroyClipboardData(PDActionClipboardData data) ``` Header: `PDProcs.h:8788` Destroys data that has been copied from an action object into a clipboard. Use this method when the clipboard data is no longer needed. **Parameters** - `data` ([`PDActionClipboardData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionClipboardData)): The clipboard action data to destroy. **Returns:** `void` **See also:** [`PDActionCanCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionCanCopy), [`PDActionCanPaste`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionCanPaste), [`PDActionCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionCopy), [`PDActionPaste`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionPaste) #### PDActionEqual ```cpp ASBool PDActionEqual(PDAction action, PDAction action2) ``` Header: `PDProcs.h:162` Compares two actions for equality. Two actions are equal only if their Cos objects are equal (see CosObjEqual()). **Parameters** - `action` ([`PDAction`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAction)): The first actions to be compared. - `action2` ([`PDAction`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAction)): The second action to be compared. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the actions are equal, `false` otherwise. **See also:** [`CosObjEqual`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjEqual) #### PDActionFromCosObj ```cpp PDAction PDActionFromCosObj(CosObj obj) ``` Header: `PDProcs.h:222` Converts a dictionary Cos object to an action and verifies that the action is valid. This method does not copy the object, but is instead the logical equivalent of a type cast. **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The dictionary Cos object whose action is obtained. **Returns:** [`PDAction`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAction) The PDAction corresponding to `obj`. **Exceptions** - `pdErrBadAction`: is raised if the action is invalid as determined by PDActionIsValid(). **See also:** [`PDActionGetCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionGetCosObj), [`PDActionNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionNew), [`PDActionNewFromDest`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionNewFromDest), [`PDActionNewFromFileSpec`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionNewFromFileSpec) #### PDActionGetCosObj ```cpp CosObj PDActionGetCosObj(PDAction action) ``` Header: `PDProcs.h:205` Gets the Cos object corresponding to an action. This method does not copy the object, but is instead the logical equivalent of a type cast. **Parameters** - `action` ([`PDAction`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAction)): IN/OUT The action whose Cos object is obtained. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) The dictionary Cos object for the action. The contents of the dictionary can be enumerated using CosObjEnum(). **See also:** [`PDActionFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionFromCosObj) #### PDActionGetDest ```cpp PDViewDestination PDActionGetDest(PDAction action) ``` Header: `PDProcs.h:192` Gets an action's destination view. This only works for actions that contain a view destination; that is, actions whose subtype is GoTo. For named destinations, this method may return a Cos string object or a Cos name object. See the description of the Named Destinations in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 12.3.2, page 365. You can find this document on the web store of the International Standards Organization (ISO). **Note:** Since this method may not return a PDViewDestination, use the PDViewDestResolve() method on the returned value to obtain a PDViewDestination. **Parameters** - `action` ([`PDAction`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAction)): The action whose destination is obtained. **Returns:** [`PDViewDestination`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDViewDestination) The action's destination, which may be a PDViewDestination, or for named destinations, a Cos string object or a Cos name object. Use the PDViewDestResolve() method on this returned value to obtain a PDViewDestination. **See also:** [`PDActionGetFileSpec`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionGetFileSpec), [`PDViewDestResolve`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDViewDestResolve) #### PDActionGetFileSpec ```cpp PDFileSpec PDActionGetFileSpec(PDAction action) ``` Header: `PDProcs.h:241` Gets a file specification from an action. Not all types of actions have file specifications; this method only works for actions that contain a file specification. See the description of Actions in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 12.6, page 414. You can find this document on the web store of the International Standards Organization (ISO). **Parameters** - `action` ([`PDAction`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAction)): The action whose file specification is obtained. **Returns:** [`PDFileSpec`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileSpec) The action's file specification. **See also:** [`PDActionGetDest`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionGetDest) #### PDActionGetSubtype ```cpp ASAtom PDActionGetSubtype(PDAction action) ``` Header: `PDProcs.h:149` Gets an action's subtype. **Parameters** - `action` ([`PDAction`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAction)): IN/OUT The action whose subtype is obtained. **Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom) The ASAtom corresponding to the action's subtype. The ASAtom can be converted to a string using ASAtomGetString(). #### PDActionIsValid ```cpp ASBool PDActionIsValid(PDAction action) ``` Header: `PDProcs.h:140` Tests whether an action is valid. This method can be used in the following cases: • To determine whether a PDAction returned from a method is really an action. For example, calling PDLinkAnnotGetAction() returns an invalid action if no action is associated with the link annotation. • To ensure that an action has not been deleted. **Parameters** - `action` ([`PDAction`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAction)): The action whose validity is determined. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the action is valid, `false` otherwise. **See also:** [`PDActionEqual`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionEqual) #### PDActionNew ```cpp PDAction PDActionNew(PDDoc doc, ASAtom type) ``` Header: `PDProcs.h:67` Creates a new action object. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document in which the action is created. - `type` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The ASAtom corresponding to the action's subtype. The ASAtom can be obtained from a string using ASAtomFromString(). **Returns:** [`PDAction`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAction) The newly created PDAction. **See also:** [`PDActionNewFromDest`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionNewFromDest), [`PDActionNewFromFileSpec`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionNewFromFileSpec), [`PDActionFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionFromCosObj), [`PDActionDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionDestroy) #### PDActionNewFromDest ```cpp PDAction PDActionNewFromDest(PDDoc doc, PDViewDestination dest, PDDoc destDoc) ``` Header: `PDProcs.h:94` Creates a new action that takes the user to the specified destination view. This method can only be used for destinations in the same document as the source document. Cross-document links must be built up from the Cos level, populating the Action dictionary for the GotoR action. See the description of the GoToR Action in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 12.6.4, page 417. You can find this document on the web store of the International Standards Organization (ISO). **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document in which the action is created and used. - `dest` ([`PDViewDestination`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDViewDestination)): The destination view. - `destDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The destination document. `destDoc` must be the same as `doc`. **Returns:** [`PDAction`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAction) The newly created action. **See also:** [`PDActionNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionNew), [`PDActionNewFromFileSpec`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionNewFromFileSpec), [`PDActionFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionFromCosObj), [`PDActionDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionDestroy) #### PDActionNewFromFileSpec ```cpp PDAction PDActionNewFromFileSpec(PDDoc containingDoc, ASAtom type, PDFileSpec fileSpec) ``` Header: `PDProcs.h:111` Creates an action of the specified type from a file specification. **Parameters** - `containingDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document in which the action is created and used. - `type` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The type of action to create. - `fileSpec` ([`PDFileSpec`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileSpec)): The file specification that is made part of an action. **Returns:** [`PDAction`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAction) The newly created PDAction. **See also:** [`PDActionNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionNew), [`PDActionNewFromDest`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionNewFromDest), [`PDActionFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionFromCosObj), [`PDActionDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionDestroy) #### PDActionPaste ```cpp PDAction PDActionPaste(PDDoc dest, PDActionClipboardData data) ``` Header: `PDProcs.h:8775` Creates a new PDAction in the destination document, using clipboard data generated by PDActionCopy(). If the original PDAction was an action chain, the entire action chain is recreated. The returned PDAction is the first item in the chain. When the data is no longer needed, use PDActionDestroyClipboardData() to free the structure. **Parameters** - `dest` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The destination document for the paste operation. - `data` ([`PDActionClipboardData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionClipboardData)): The clipboard structure holding the copied action data. **Returns:** [`PDAction`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAction) A newly created action object (or the first such object in the action chain) associated with the specified document, containing the same data as the copied action. **See also:** [`PDActionCanCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionCanCopy), [`PDActionCanPaste`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionCanPaste), [`PDActionCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionCopy), [`PDActionDestroyClipboardData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionDestroyClipboardData) ### Typedefs (1) #### PDAction ```cpp typedef OPAQUE_64_BITS PDAction ``` Header: `PDExpT.h:133` Actions are what happens when a user clicks on a link or bookmark. In addition, the Acrobat viewer allows a document to have an action that is executed automatically when the document is opened. Applications can also support actions in custom annotation types they add. **See also:** [`PDActionNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionNew), [`PDActionNewFromDest`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionNewFromDest), [`PDActionNewFromFileSpec`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionNewFromFileSpec), [`PDLinkAnnotGetAction`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDLinkAnnotGetAction), [`PDBookmarkGetAction`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkGetAction), [`PDDocGetOpenAction`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetOpenAction), [`PDActionDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionDestroy) ### Structures (1) #### PDActionClipboardData ```cpp typedef struct _t_PDActionClipboardData* PDActionClipboardData ``` Header: `PDExpT.h:136` ## PDActionHandler ### Functions (1) #### PDRegisterActionHandler ```cpp void PDRegisterActionHandler(PDActionHandler handler) ``` Header: `PDProcs.h:8701` Registers a handler for PDAction operations. **Parameters** - `handler` ([`PDActionHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionHandler)): A pointer to a structure containing the action handler's callbacks. This structure must not be freed after this call, but must be retained. **Returns:** `void` ### Typedefs (8) #### PDActionHandlerData ```cpp typedef void* PDActionHandlerData ``` Header: `PDExpT.h:146` Used to store PDAction data for copy and paste operations. **See also:** [`PDActionHandlerCanPasteProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionHandlerCanPasteProc), [`PDActionHandlerCopyProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionHandlerCopyProc), [`PDActionHandlerDestroyDataProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionHandlerDestroyDataProc), [`PDActionHandlerPasteProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionHandlerPasteProc) #### PDActionHandlerCanCopyProc ```cpp typedef ASBool(*) PDActionHandlerCanCopyProc(PDActionHandler pdah, PDAction action)(PDActionHandler pdah, PDAction action) ``` Header: `PDExpT.h:176` (Optional) A callback for PDActionHandler. It returns `true` if the copy operation is expected to succeed. It tests, for example, whether copying is allowed by document permissions. **Note:** The handler is not expected to test other actions (if any) in the action chain. **See also:** [`PDActionHandlerCanPasteProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionHandlerCanPasteProc), [`PDActionHandlerCopyProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionHandlerCopyProc), [`PDActionHandlerDestroyDataProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionHandlerDestroyDataProc), [`PDActionHandlerPasteProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionHandlerPasteProc), [`PDActionCanCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionCanCopy), [`PDRegisterActionHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterActionHandler) #### PDActionHandlerCanPasteProc ```cpp typedef ASBool(*) PDActionHandlerCanPasteProc(PDActionHandler pdah, PDDoc dest, PDActionHandlerData data)(PDActionHandler pdah, PDDoc dest, PDActionHandlerData data) ``` Header: `PDExpT.h:215` (Optional) A callback for PDActionHandler. It returns `true` if the paste operation is expected to succeed. It tests, for example, whether pasting is allowed by document permissions. **Note:** The handler is not expect to test other actions (if any) in the action chain. **See also:** [`PDActionHandlerCanCopyProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionHandlerCanCopyProc), [`PDActionHandlerCopyProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionHandlerCopyProc), [`PDActionHandlerDestroyDataProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionHandlerDestroyDataProc), [`PDActionHandlerPasteProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionHandlerPasteProc), [`PDActionCanPaste`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionCanPaste), [`PDRegisterActionHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterActionHandler) #### PDActionHandlerCopyProc ```cpp typedef PDActionHandlerData(*) PDActionHandlerCopyProc(PDActionHandler pdah, PDAction action)(PDActionHandler pdah, PDAction action) ``` Header: `PDExpT.h:195` (Optional) A callback for PDActionHandler. It copies data from an action object to a new data structure, from which it can be pasted to a new document. The PDActionHandlerData does not store any information related to a Next action. Rebuilding the action chain is the responsibility of the caller and can be ignored by the PDActionHandler. **See also:** [`PDActionHandlerCanCopyProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionHandlerCanCopyProc), [`PDActionHandlerCanPasteProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionHandlerCanPasteProc), [`PDActionHandlerDestroyDataProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionHandlerDestroyDataProc), [`PDActionHandlerPasteProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionHandlerPasteProc), [`PDActionCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionCopy), [`PDRegisterActionHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterActionHandler) #### PDActionHandlerDestroyDataProc ```cpp typedef void(*) PDActionHandlerDestroyDataProc(PDActionHandler pdah, PDActionHandlerData data)(PDActionHandler pdah, PDActionHandlerData data) ``` Header: `PDExpT.h:251` A callback for PDActionHandler. It destroys data copied into an action clipboard data structure after it has been successfully pasted to a new document. **See also:** [`PDActionHandlerCanCopyProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionHandlerCanCopyProc), [`PDActionHandlerCanPasteProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionHandlerCanPasteProc), [`PDActionHandlerCopyProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionHandlerCopyProc), [`PDActionHandlerPasteProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionHandlerPasteProc), [`PDActionPaste`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionPaste), [`PDRegisterActionHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterActionHandler) #### PDActionHandlerDestroyProc ```cpp typedef void(*) PDActionHandlerDestroyProc(PDActionHandler pdah)(PDActionHandler pdah) ``` Header: `PDExpT.h:261` (Optional) A callback for PDActionHandler. It destroys the action handler structure when the application no longer requires it. The handler should destroy any dynamic memory stored in the `userData` field. **See also:** [`PDRegisterActionHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterActionHandler) #### PDActionHandlerGetTypeProc ```cpp typedef ASAtom(*) PDActionHandlerGetTypeProc(PDActionHandler pdah)(PDActionHandler pdah) ``` Header: `PDExpT.h:157` A callback for PDActionHandler. It returns an ASAtom indicating the action type for which the handler is responsible. Types are defined by the client when registering the action handler. **See also:** [`PDRegisterActionHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterActionHandler) #### PDActionHandlerPasteProc ```cpp typedef PDAction(*) PDActionHandlerPasteProc(PDActionHandler pdah, PDDoc dest, PDActionHandlerData data)(PDActionHandler pdah, PDDoc dest, PDActionHandlerData data) ``` Header: `PDExpT.h:235` (Optional) A callback for PDActionHandler. It creates a new PDAction in the destination document using data that was placed in a PDActionClipboardA data structure using the PDActionCopy() function, and returns the new action object. **See also:** [`PDActionHandlerCanCopyProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionHandlerCanCopyProc), [`PDActionHandlerCanPasteProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionHandlerCanPasteProc), [`PDActionHandlerCopyProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionHandlerCopyProc), [`PDActionHandlerDestroyDataProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionHandlerDestroyDataProc), [`PDActionPaste`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionPaste), [`PDRegisterActionHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterActionHandler) ### Structures (1) #### PDActionHandler ```cpp typedef struct _t_PDActionHandler* PDActionHandler ``` Header: `PDExpT.h:135` ## PDAnnot ### Functions (28) #### PDAnnotCanCopy ```cpp ASBool PDAnnotCanCopy(PDPage sourcePage, PDAnnot annot) ``` Header: `PDProcs.h:10900` Tests whether the data from an annotation on a given page can be copied to a clipboard for pasting. This depends on whether there is a PDAnnotHandler with copy and paste support for the annotation, and whether copying is allowed by document permissions. **Parameters** - `sourcePage` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page containing the annotation to test. It can be `NULL` (as when copying annotations while spawning a hidden template). - `annot` ([`PDAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnot)): The annotation to test. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the annotation object can be copied, `false` otherwise. **See also:** [`PDAnnotCanPaste`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotCanPaste), [`PDAnnotCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotCopy), [`PDAnnotDestroyClipboardData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotDestroyClipboardData), [`PDAnnotPaste`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotPaste) #### PDAnnotCanPaste ```cpp ASBool PDAnnotCanPaste(PDPage destPage, const ASFixedPoint *center, PDAnnotClipboardData data) ``` Header: `PDProcs.h:10938` Tests whether data from an annotation that has been copied to a clipboard can be pasted to a location on a page. Pasting can be disallowed by document permissions, or because the annotation cannot be accurately reproduced in the destination document. **Parameters** - `destPage` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page to which the annotation would be pasted. - `center` (`const ASFixedPoint *`): The location for the center of the annotation on the destination page, or a `NULL` pointer to center the annotation on the destination page. - `data` ([`PDAnnotClipboardData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotClipboardData)): The copied annotation data to test. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the annotation data can be pasted, `false` otherwise. **See also:** [`PDAnnotCanCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotCanCopy), [`PDAnnotCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotCopy), [`PDAnnotDestroyClipboardData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotDestroyClipboardData), [`PDAnnotPaste`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotPaste) #### PDAnnotCopy ```cpp PDAnnotClipboardData PDAnnotCopy(PDPage sourcePage, PDAnnot annot) ``` Header: `PDProcs.h:10916` Copies action object data to a clipboard structure, from which it can be pasted. **Parameters** - `sourcePage` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page containing the annotation to copy. It can be `NULL` (as when copying annotations while spawning a hidden template). - `annot` ([`PDAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnot)): The annotation to copy. **Returns:** [`PDAnnotClipboardData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotClipboardData) The annotation clipboard data object. **See also:** [`PDAnnotCanCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotCanCopy), [`PDAnnotCanPaste`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotCanPaste), [`PDAnnotDestroyClipboardData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotDestroyClipboardData), [`PDAnnotPaste`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotPaste) #### PDAnnotDestroyClipboardData ```cpp void PDAnnotDestroyClipboardData(PDAnnotClipboardData data) ``` Header: `PDProcs.h:10973` Destroys data that has been copied from an annotation object into a clipboard. Use this method after successfully pasting the data to a new document. **Parameters** - `data` ([`PDAnnotClipboardData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotClipboardData)): The clipboard annotation data to destroy. **Returns:** `void` **See also:** [`PDAnnotCanCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotCanCopy), [`PDAnnotCanPaste`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotCanPaste), [`PDAnnotCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotCopy), [`PDAnnotPaste`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotPaste) #### PDAnnotEqual ```cpp ASBool PDAnnotEqual(PDAnnot anAnnot, PDAnnot annot2) ``` Header: `PDProcs.h:393` Tests whether two annotations are identical. **Parameters** - `anAnnot` ([`PDAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnot)): The first annotation to compare. - `annot2` ([`PDAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnot)): The second annotation to compare. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the annotations are equal, `false` otherwise. Two annotations are equal only if their Cos objects are equal (see CosObjEqual()). **Exceptions** - `pdErrBadAnnotation` **See also:** [`CosObjEqual`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjEqual) #### PDAnnotFromCosObj ```cpp PDAnnot PDAnnotFromCosObj(CosObj obj) ``` Header: `PDProcs.h:566` Converts a dictionary Cos object to an annotation. This method does not copy the object, but is instead the logical equivalent of a type cast. **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The dictionary Cos object whose annotation is obtained. **Returns:** [`PDAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnot) The PDAnnot corresponding to the Cos object. **Exceptions** - `pdErrBadAnnotation`: is raised if the annotation is invalid, as determined by PDAnnotIsValid(). **See also:** [`PDAnnotGetCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotGetCosObj) #### PDAnnotGetColor ```cpp ASBool PDAnnotGetColor(PDAnnot anAnnot, PDColorValue color) ``` Header: `PDProcs.h:423` Gets a note or link annotation's color. If the annotation does not specify an explicit color, a default color is returned. Text annotations return *default yellow*; all others return black. Only RGB color specifications are currently supported. Annotation Use Closed text note The icon background color. Open, un-selected text note The bounding rectangle color. Open, selected text note The color of the annotation's title bar. Link annotation The link border color. **Parameters** - `anAnnot` ([`PDAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnot)): The note or link annotation whose color is obtained. - `color` (`PDColorValue`): (Filled by the method) The annotation's color, which is used as follows: **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the annotation specifies an explicit color, `false` if a default color was used. **See also:** [`PDAnnotSetColor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotSetColor), [`PDAnnotGetDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotGetDate), [`PDAnnotGetFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotGetFlags), [`PDAnnotGetRect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotGetRect), [`PDAnnotGetTitle`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotGetTitle) #### PDAnnotGetCosObj ```cpp CosObj PDAnnotGetCosObj(PDAnnot annot) ``` Header: `PDProcs.h:552` Gets the Cos object corresponding to an annotation. This method does not copy the object, but is instead the logical equivalent of a type cast. **Parameters** - `annot` ([`PDAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnot)): IN/OUT The annotation whose Cos object is obtained. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) The dictionary Cos object for the annotation. The contents of the dictionary can be enumerated using CosObjEnum(). It returns a `NULL` Cos object if the annotation is not valid, as determined by PDAnnotIsValid(). **See also:** [`PDAnnotFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotFromCosObj) #### PDAnnotGetDate ```cpp ASBool PDAnnotGetDate(PDAnnot anAnnot, ASTimeRecP date) ``` Header: `PDProcs.h:522` Gets an annotation's date. **Parameters** - `anAnnot` ([`PDAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnot)): The annotation whose date is obtained. - `date` (`ASTimeRecP`): (Filled by the method) The annotation's time and date. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the annotation contains a date key and the value of that key can be successfully parsed as a date string, `false` otherwise. **Exceptions** - `pdErrBadAnnotation`: is raised if the annotation is not valid or if the value of the annotation's M (ModDate) key is not a string. - `genErrBadParm`: is raised if `date` is `NULL`. **See also:** [`PDAnnotSetDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotSetDate), [`PDAnnotGetColor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotGetColor), [`PDAnnotGetFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotGetFlags), [`PDAnnotGetRect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotGetRect), [`PDAnnotGetTitle`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotGetTitle) #### PDAnnotGetFlags ```cpp ASUns32 PDAnnotGetFlags(PDAnnot anAnnot) ``` Header: `PDProcs.h:718` Gets an annotation's flags. **Parameters** - `anAnnot` ([`PDAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnot)): IN/OUT The annotation whose flags are obtained. **Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32) The flags, or `0` if the annotation does not have a flags key. **See also:** [`PDAnnotSetFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotSetFlags), [`PDAnnotGetColor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotGetColor), [`PDAnnotGetDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotGetDate), [`PDAnnotGetRect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotGetRect), [`PDAnnotGetTitle`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotGetTitle) #### PDAnnotGetOCMD ```cpp PDOCMD PDAnnotGetOCMD(PDAnnot annot) ``` Header: `PDProcs.h:9352` Gets an optional-content membership dictionary (OCMD) object associated with the annotation. **Parameters** - `annot` ([`PDAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnot)): The annotation from which the dictionary is obtained. **Returns:** [`PDOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMD) The dictionary object, or `NULL` if the annotation does not contain a dictionary. **See also:** [`PDAnnotSetOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotSetOCMD), [`PDAnnotRemoveOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotRemoveOCMD), [`PDEElementGetOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetOCMD), [`PDOCMDFindOrCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMDFindOrCreate) #### PDAnnotGetRect ```cpp void PDAnnotGetRect(PDAnnot anAnnot, ASFixedRect *boxP) ``` Header: `PDProcs.h:361` Gets the size and location of an annotation on its page. **Parameters** - `anAnnot` ([`PDAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnot)): IN/OUT The annotation whose location and size are set. - `boxP` (`ASFixedRect *`): IN/OUT (Filled by the method) A pointer to a rectangle that specifies the annotation's bounding rectangle, specified in user space coordinates. **Returns:** `void` **Exceptions** - `pdErrBadAnnotation` **See also:** [`PDAnnotSetRect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotSetRect), [`PDAnnotGetColor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotGetColor), [`PDAnnotGetDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotGetDate), [`PDAnnotGetFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotGetFlags), [`PDAnnotGetTitle`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotGetTitle) #### PDAnnotGetSubtype ```cpp ASAtom PDAnnotGetSubtype(PDAnnot anAnnot) ``` Header: `PDProcs.h:343` Gets an annotation's subtype. **Parameters** - `anAnnot` ([`PDAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnot)): The annotation whose subtype is obtained. **Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom) The ASAtom for the annotation's subtype. This can be converted to a string using ASAtomGetString(). The storage pointed to by the return value is owned by the Acrobat viewer and should be assumed to be valid only until the next call into any client API method; it should be immediately copied by the client if the client wants to reference it later. **Exceptions** - `pdErrBadAnnotation` #### PDAnnotGetTitle ```cpp ASInt32 PDAnnotGetTitle(PDAnnot anAnnot, char *buffer, ASInt32 bufSize) ``` Header: `PDProcs.h:479` Gets an annotation's label text. @since **Parameters** - `anAnnot` ([`PDAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnot)): IN/OUT The annotation whose label is obtained. - `buffer` (`char *`): IN/OUT (Filled by the method) The string into which the annotation's label string is copied. If the string is non-`NULL`, up to `bufsSize` bytes are copied into the buffer.`bufSize` bytes of the annotation label string are copied into the string and an ASCII `NULL` character is appended. The caller is expected to have allocated `bufSize + 1` bytes to allow for the `NULL`. If `buffer` is `NULL`, it copies nothing.`NULL`, it returns the number of bytes copied, not counting the trailing `NULL`. If the string is `NULL`, it returns the number of bytes that would be copied if the string were not `NULL`. **Note:** This text is stored in either PDFDocEncoding or in Unicode. If it is stored in Unicode, a valid Byte Order Mark must be present. - `bufSize` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)) **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) **Exceptions** - `pdErrBadAnnotation` **See also:** [`PDAnnotSetTitle`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotSetTitle), [`PDAnnotGetColor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotGetColor), [`PDAnnotGetDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotGetDate), [`PDAnnotGetRect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotGetRect), [`PDAnnotGetFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotGetFlags) #### PDAnnotGetTitleASText ```cpp void PDAnnotGetTitleASText(PDAnnot anAnnot, ASText title) ``` Header: `PDProcs.h:11445` Gets an annotation's label text as an ASText object. **Parameters** - `anAnnot` ([`PDAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnot)): The annotation whose label is obtained. - `title` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): (Filled by the method) The text object containing the annotation's label string. The client must pass a valid ASText object title. The routine does not allocate it. **Returns:** `void` **Exceptions** - `pdErrBadAnnotation` **See also:** [`PDAnnotGetTitle`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotGetTitle), [`PDAnnotSetTitleASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotSetTitleASText), [`PDAnnotSetTitle`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotSetTitle), [`PDAnnotGetColor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotGetColor), [`PDAnnotGetDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotGetDate), [`PDAnnotGetRect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotGetRect), [`PDAnnotGetFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotGetFlags) #### PDAnnotIsCurrentlyVisible ```cpp ASBool PDAnnotIsCurrentlyVisible(PDAnnot annot, PDOCContext ocContext) ``` Header: `PDProcs.h:9418` Tests whether an annotation with an OC entry is visible in a given optional-content context, considering the current `ON-OFF` states of the optional-content groups in the optional-content dictionary (OCMD) and the dictionary's visibility policy. **Parameters** - `annot` ([`PDAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnot)): The annotation to test. - `ocContext` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The optional-content context in which the visibility is tested. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the annotation is visible in the given context or if the annotation has no OC entry, `false` if it is hidden. **See also:** [`PDAnnotGetOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotGetOCMD) #### PDAnnotIsValid ```cpp ASBool PDAnnotIsValid(PDAnnot anAnnot) ``` Header: `PDProcs.h:326` Tests whether an annotation is valid. This is intended only to ensure that the annotation has not been deleted, not to ensure that all necessary information is present and valid. **Parameters** - `anAnnot` ([`PDAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnot)): The annotation whose validity is tested. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if `anAnnot` is a valid annotation object, `false` otherwise. An annotation is valid if it is a Cos dictionary object and has a Rect key. **See also:** [`PDAnnotEqual`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotEqual) #### PDAnnotNotifyDidChange ```cpp void PDAnnotNotifyDidChange(PDAnnot annot, ASAtom key, ASInt32 err) ``` Header: `PDProcs.h:274` Broadcasts a PDAnnotDidChange() notification. Clients must call this method after making any change to a custom annotation. **Parameters** - `annot` ([`PDAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnot)): The annotation that has changed. - `key` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The ASAtom corresponding to the name of the key in the annotation's Cos dictionary that is changing. - `err` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): An error code to pass to any method registered to receive the PDAnnotDidChange() notification. Pass zero if the annotation was changed successfully. Pass a nonzero value if an error occurred while changing the annotation. @notify PDAnnotDidChange **Returns:** `void` **See also:** [`PDAnnotNotifyWillChange`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotNotifyWillChange), `AVAppRegisterNotification` #### PDAnnotNotifyWillChange ```cpp void PDAnnotNotifyWillChange(PDAnnot annot, ASAtom key) ``` Header: `PDProcs.h:255` Broadcasts a PDAnnotWillChange() notification. Clients must call this method before making any change to a custom annotation. **Parameters** - `annot` ([`PDAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnot)): The annotation that has changed. - `key` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The ASAtom corresponding to the name of the key in the annotation's Cos dictionary that is changing. @notify PDAnnotWillChange **Returns:** `void` **See also:** [`PDAnnotNotifyDidChange`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotNotifyDidChange), `AVAppRegisterNotification` #### PDAnnotPaste ```cpp PDAnnot PDAnnotPaste(PDPage destPage, const ASFixedPoint *center, PDAnnotClipboardData data) ``` Header: `PDProcs.h:10960` Pastes copied annotation data from a clipboard structure to a new annotation object in a specified document. After successfully pasting the data, use PDAnnotDestroyClipboardData() to free the associated memory. **Parameters** - `destPage` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page to which the annotation is pasted. - `center` (`const ASFixedPoint *`): The location for the center of the annotation on the destination page, or a `NULL` pointer to center the annotation on the destination page. - `data` ([`PDAnnotClipboardData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotClipboardData)): The copied annotation data to paste. **Returns:** [`PDAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnot) A newly created annotation object associated with the specified document, containing the same data as the copied annotation. **See also:** [`PDAnnotCanCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotCanCopy), [`PDAnnotCanPaste`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotCanPaste), [`PDAnnotCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotCopy), [`PDAnnotDestroyClipboardData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotDestroyClipboardData) #### PDAnnotRemoveOCMD ```cpp void PDAnnotRemoveOCMD(PDAnnot annot) ``` Header: `PDProcs.h:9363` Dissociates any optional-content membership dictionary (OCMD) object from the annotation. **Parameters** - `annot` ([`PDAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnot)): The annotation for which to remove the dictionary. **Returns:** `void` **See also:** [`PDAnnotGetOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotGetOCMD), [`PDAnnotSetOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotSetOCMD), [`PDOCMDFindOrCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMDFindOrCreate) #### PDAnnotSetColor ```cpp void PDAnnotSetColor(PDAnnot anAnnot, const PDColorValue color) ``` Header: `PDProcs.h:449` Sets a note or link annotation's color. Only RGB color specifications are currently supported. Annotation Use Closed text note The icon background color. Open, un-selected text note The bounding rectangle color. Open, selected text note The color of the annotation's title bar. Link annotation The link border color. @notify PDAnnotWillChange @notify PDAnnotDidChange **Parameters** - `anAnnot` ([`PDAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnot)): IN/OUT The note or link annotation whose color is set. - `color` (`const PDColorValue`): IN/OUT The annotation's color, which is used as follows: **Returns:** `void` **See also:** [`PDAnnotGetColor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotGetColor), [`PDAnnotSetDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotSetDate), [`PDAnnotSetFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotSetFlags), [`PDAnnotSetRect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotSetRect), [`PDAnnotSetTitle`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotSetTitle) #### PDAnnotSetDate ```cpp void PDAnnotSetDate(PDAnnot anAnnot, const ASTimeRecP date) ``` Header: `PDProcs.h:537` Sets an annotation's date. **Parameters** - `anAnnot` ([`PDAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnot)): IN/OUT The annotation whose date is set. - `date` (`const ASTimeRecP`): IN/OUT The annotation's time and date. @notify PDAnnotWillChange @notify PDAnnotDidChange **Returns:** `void` **See also:** [`PDAnnotGetDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotGetDate), [`PDAnnotSetColor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotSetColor), [`PDAnnotSetFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotSetFlags), [`PDAnnotSetRect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotSetRect), [`PDAnnotSetTitle`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotSetTitle) #### PDAnnotSetFlags ```cpp void PDAnnotSetFlags(PDAnnot anAnnot, ASUns32 flags) ``` Header: `PDProcs.h:733` Sets an annotation's flags. **Parameters** - `anAnnot` ([`PDAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnot)): IN/OUT The annotation whose flags are set. - `flags` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): IN/OUT An `OR` of the PDAnnot Flags values. @notify PDAnnotWillChange @notify PDAnnotDidChange **Returns:** `void` **See also:** [`PDAnnotGetFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotGetFlags), [`PDAnnotSetColor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotSetColor), [`PDAnnotSetDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotSetDate), [`PDAnnotSetRect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotSetRect), [`PDAnnotSetTitle`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotSetTitle) #### PDAnnotSetOCMD ```cpp void PDAnnotSetOCMD(PDAnnot annot, PDOCMD pdocmd) ``` Header: `PDProcs.h:9337` Associates an optional-content membership dictionary (OCMD) object with the annotation, making it optionally visible according to the OCMD's visibility policy. If the annotation already has a dictionary, the method replaces it. **Parameters** - `annot` ([`PDAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnot)): The annotation for which to set the dictionary. - `pdocmd` ([`PDOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMD)): The new dictionary. **Returns:** `void` **See also:** [`PDAnnotGetOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotGetOCMD), [`PDOCMDFindOrCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMDFindOrCreate), [`PDAnnotRemoveOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotRemoveOCMD) #### PDAnnotSetRect ```cpp void PDAnnotSetRect(PDAnnot anAnnot, const ASFixedRect *newBox) ``` Header: `PDProcs.h:380` Sets the size and location of an annotation on its page. **Parameters** - `anAnnot` ([`PDAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnot)): IN/OUT The annotation whose location and size are set. - `newBox` (`const ASFixedRect *`): IN/OUT A pointer to a rectangle that specifies the annotation's bounding rectangle, specified in user space coordinates. @notify PDAnnotWillChange @notify PDAnnotDidChange **Returns:** `void` **See also:** [`PDAnnotGetRect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotGetRect), [`PDAnnotSetColor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotSetColor), [`PDAnnotSetDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotSetDate), [`PDAnnotSetFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotSetFlags), [`PDAnnotSetTitle`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotSetTitle) #### PDAnnotSetTitle ```cpp void PDAnnotSetTitle(PDAnnot anAnnot, const char *str, ASInt32 nBytes) ``` Header: `PDProcs.h:501` Sets an annotation's label text. @notify PDAnnotWillChange @notify PDAnnotDidChange **Note:** This text is stored in either PDFDocEncoding or in Unicode. If it is stored in Unicode, a valid Byte Order Mark must be present. @since **Parameters** - `anAnnot` ([`PDAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnot)): IN/OUT The annotation whose label is set. - `str` (`const char *`): IN/OUT The string containing the label to set. - `nBytes` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN/OUT The length of the label. The first `nBytes` bytes of `str` are used as the label. **Returns:** `void` **See also:** [`PDAnnotGetTitle`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotGetTitle), [`PDAnnotSetColor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotSetColor), [`PDAnnotSetDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotSetDate), [`PDAnnotSetFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotSetFlags), [`PDAnnotSetRect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotSetRect) #### PDAnnotSetTitleASText ```cpp void PDAnnotSetTitleASText(PDAnnot anAnnot, const ASText title) ``` Header: `PDProcs.h:11464` Sets an annotation's label text. @notify PDAnnotWillChange @notify PDAnnotDidChange **Parameters** - `anAnnot` ([`PDAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnot)): The annotation whose label is set. - `title` ([`const ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): The text object containing the label to set. **Returns:** `void` **See also:** [`PDAnnotSetTitle`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotSetTitle), [`PDAnnotGetTitleASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotGetTitleASText), [`PDAnnotGetTitle`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotGetTitle), [`PDAnnotSetColor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotSetColor), [`PDAnnotSetDate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotSetDate), [`PDAnnotSetFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotSetFlags), [`PDAnnotSetRect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotSetRect) ### Typedefs (3) #### PDAnnot ```cpp typedef OPAQUE_64_BITS PDAnnot ``` Header: `PDExpT.h:323` An annotation on a page in a PDF file. Acrobat viewers have two built-in annotation types: PDTextAnnot and PDLinkAnnot. Physical attributes of the annotation can be set and queried. Plug-ins add movie and Widget (form field) annotations. Developers can define new annotation subtypes by creating new annotation handlers. **See also:** `AVPageViewIsAnnotAtPoint`, [`PDAnnotFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotFromCosObj), [`PDPageAddNewAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageAddNewAnnot), [`PDPageCreateAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageCreateAnnot), [`PDPageGetAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetAnnot), [`PDPageRemoveAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageRemoveAnnot) #### PDAnnotPrintOp ```cpp typedef ASEnum16 PDAnnotPrintOp ``` Header: `PDExpT.h:564` #### PDAnnotWillPrintProc ```cpp typedef ASBool(*) PDAnnotWillPrintProc(PDAnnotHandler pdanh, PDAnnot annot)(PDAnnotHandler pdanh, PDAnnot annot) ``` Header: `PDExpT.h:661` A callback for PDAnnotHandler. This method is called to determine whether an annotation is printed. **See also:** [`PDDocWillExportAnnotProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocWillExportAnnotProc), [`PDDocWillImportAnnotProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocWillImportAnnotProc), [`PDRegisterAnnotHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterAnnotHandler) ### Structures (1) #### PDAnnotClipboardData ```cpp typedef struct _t_PDAnnotClipboardData* PDAnnotClipboardData ``` Header: `PDExpT.h:545` Used to store PDAnnot data for copy and paste operations. **See also:** [`PDAnnotCanPaste`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotCanPaste), [`PDAnnotCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotCopy), [`PDAnnotDestroyClipboardData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotDestroyClipboardData), [`PDAnnotPaste`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotPaste) ### Enums (1) #### PDAnnotPrintOps Header: `PDExpT.h:556` PDAnnotPrintOp is passed to the PDAnnotHandlerGetPrintAppearanceProc() callback to specify the type of print operation being performed. **Values** - `kPDAnnotPrintStandard = 1`: A standard print operation. - `kPDAnnotPrintVariableData = 2`: The user selected Form Fields Only. **See also:** [`PDAnnotHandlerGetPrintAppearanceProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotHandlerGetPrintAppearanceProc) ### Definitions (20) #### CastToPDAnnot Header: `PDExpT.h:431` Value: `*(PDAnnot *)&(a)` Casts a link annotation or a text annotation to a generic annotation. **See also:** [`CastToPDLinkAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#CastToPDLinkAnnot), [`CastToPDTextAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#CastToPDTextAnnot) #### PDAnnotIgnorePerms Header: `PDExpT.h:469` Value: `0x0008` Allows modifying this annotation type in a write-protected document. #### PDAnnotInfoInit Header: `PDExpT.h:517` Value: `do { \ ASmemset(x, 0, sizeof(PDAnnotInfoRec)); \ x->size = sizeof(PDAnnotInfoRec); \ x->fxLayer = fixedTwo; \ } while (0)` #### PDAnnotMaxDashes Header: `PDExpT.h:1026` Value: `10` #### PDAnnotOperationAll Header: `PDExpT.h:479` Value: `0xFFFF` All operations are allowed. #### PDAnnotOperationFilter Header: `PDExpT.h:459` Value: `0x0002` It is okay to filter annotations. #### PDAnnotOperationFlatten Header: `PDExpT.h:474` Value: `0x0010` When creating a flattened page include this annot #### PDAnnotOperationManager Header: `PDExpT.h:464` Value: `0x0004` It is okay to manage annotations. #### PDAnnotOperationSummarize Header: `PDExpT.h:454` Value: `0x0001` It is okay to summarize annotations. #### pdAnnotHidden Header: `PDExpT.h:376` Value: `0x02` The annotation is not visible and does not print. #### pdAnnotInvisible Header: `PDExpT.h:371` Value: `0x01` If there is no annotation handler, the annotation is invisible. #### pdAnnotLock Header: `PDExpT.h:407` Value: `0x80` The annotation does not move or resize with the view. Currently only form fields respect this flag. If the annotation is locked, the user cannot delete, move or change its associated form field's properties. #### pdAnnotLockContents Header: `PDExpT.h:417` Value: `0x200` If the annotation is content-locked, the user can not change its content key. #### pdAnnotNoRotate Header: `PDExpT.h:391` Value: `0x10` The annotation does not rotate with the page. #### pdAnnotNoView Header: `PDExpT.h:396` Value: `0x20` The annotation does not view but can print. #### pdAnnotNoZoom Header: `PDExpT.h:386` Value: `0x08` The annotation does not zoom with the view. #### pdAnnotPrint Header: `PDExpT.h:381` Value: `0x04` The annotation prints. #### pdAnnotReadOnly Header: `PDExpT.h:401` Value: `0x40` The annotation does not interact with the user. #### pdAnnotSequenceAdjust Header: `PDExpT.h:422` Value: `0x80000000` A place holder used only at runtime. Do not set this bit in PDF/FDF files. #### pdAnnotToggleNoView Header: `PDExpT.h:412` Value: `0x100` A mouse-over or selection causes the `noView` bit to toggle. ## PDAnnotHandler ### Functions (2) #### PDGetAnnotHandlerByName ```cpp PDAnnotHandler PDGetAnnotHandlerByName(ASAtom name) ``` Header: `PDProcs.h:6905` Gets the annotation handler that handles the specified annotation type. **Parameters** - `name` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): IN/OUT The name of the requested annotation handler. The character string for the name can be converted to an ASAtom using ASAtomFromString(). **Returns:** [`PDAnnotHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotHandler) The annotation handler that services annotations of type `name`. It returns the default annotation handler if no handler services the specified annotation type. **See also:** [`PDRegisterAnnotHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterAnnotHandler), `AVAppRegisterAnnotHandler` #### PDRegisterAnnotHandler ```cpp void PDRegisterAnnotHandler(PDAnnotHandler handler) ``` Header: `PDProcs.h:6889` Registers a handler for an annotation subtype, replacing any previous handler that had been registered for that subtype. The annotation handler is not registered if its PDAnnotHandlerGetTypeProc() returns `NULL`. To effectively use a PDAnnotHandler, the AVAnnotHandler associated with this annotation must have its AVAnnotHandlerGetInfoProc() and AVAnnotHandlerDeleteInfoProc() callbacks defined. PDF Library applications can use this method to register their annotation handlers. Link and Watermark annotations have default handlers. For other annotation types, the applications should register their own handlers. **Parameters** - `handler` ([`PDAnnotHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotHandler)): IN/OUT A pointer to a structure containing the annotation handler's callbacks. This structure must not be freed after this call, but must be retained. **Returns:** `void` **See also:** [`PDGetAnnotHandlerByName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDGetAnnotHandlerByName), `AVAppGetAnnotHandlerByName` ### Typedefs (13) #### PDAnnotHandlerClipboardData ```cpp typedef void* PDAnnotHandlerClipboardData ``` Header: `PDExpT.h:548` Opaque data used by PDAnnotHandlers. #### PDAnnotHandlerCanCopyProc ```cpp typedef ASBool(*) PDAnnotHandlerCanCopyProc(PDAnnotHandler pdanh, PDPage sourcePage, PDAnnot pdan)(PDAnnotHandler pdanh, PDPage sourcePage, PDAnnot pdan) ``` Header: `PDExpT.h:701` (Optional) A callback for PDAnnotHandler. It returns `true` if the copy operation is expected to succeed. It tests, for example, whether copying is allowed by document permissions. **See also:** [`PDAnnotHandlerCanPasteProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotHandlerCanPasteProc), [`PDAnnotHandlerCopyProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotHandlerCopyProc), [`PDAnnotHandlerPasteProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotHandlerPasteProc), [`PDAnnotHandlerDestroyDataProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotHandlerDestroyDataProc), [`PDAnnotCanCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotCanCopy), `PDRegisterAnnotHandlerCanCopy` #### PDAnnotHandlerCanPasteProc ```cpp typedef ASBool(*) PDAnnotHandlerCanPasteProc(PDAnnotHandler pdanh, PDPage destPage, const ASFixedPoint *center, PDAnnotHandlerClipboardData data)(PDAnnotHandler pdanh, PDPage destPage, const ASFixedPoint *center, PDAnnotHandlerClipboardData data) ``` Header: `PDExpT.h:750` (Optional) A callback for PDAnnotHandler. It returns `true` if the paste operation is expected to succeed. It tests whether data from an annotation that has been copied to a clipboard can be pasted to a location on a page. Pasting can be disallowed by document permissions, or because the annotation cannot be accurately reproduced in the destination document. **See also:** [`PDAnnotHandlerCanCopyProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotHandlerCanCopyProc), [`PDAnnotHandlerCopyProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotHandlerCopyProc), [`PDAnnotHandlerPasteProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotHandlerPasteProc), [`PDAnnotHandlerDestroyDataProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotHandlerDestroyDataProc), [`PDAnnotCanPaste`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotCanPaste), [`PDRegisterAnnotHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterAnnotHandler) #### PDAnnotHandlerCopyProc ```cpp typedef PDAnnotHandlerClipboardData(*) PDAnnotHandlerCopyProc(PDAnnotHandler pdanh, PDPage sourcePage, PDAnnot pdan)(PDAnnotHandler pdanh, PDPage sourcePage, PDAnnot pdan) ``` Header: `PDExpT.h:722` (Optional) A callback for PDAnnotHandler. It copies data from the annotation object to a new clipboard structure, and returns the clipboard structure. **See also:** [`PDAnnotHandlerCanCopyProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotHandlerCanCopyProc), [`PDAnnotHandlerCanPasteProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotHandlerCanPasteProc), [`PDAnnotHandlerCopyProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotHandlerCopyProc), [`PDAnnotHandlerDestroyDataProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotHandlerDestroyDataProc), [`PDAnnotHandlerPasteProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotHandlerPasteProc), [`PDAnnotCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotCopy), [`PDRegisterAnnotHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterAnnotHandler) #### PDAnnotHandlerDeleteAnnotInfoProc ```cpp typedef void(*) PDAnnotHandlerDeleteAnnotInfoProc(PDAnnotHandler pdanh, PDAnnotInfo info)(PDAnnotHandler pdanh, PDAnnotInfo info) ``` Header: `PDExpT.h:597` (Optional) A callback for PDAnnotHandler. It deletes information associated with an annotation. It frees all the memory associated with the annotation information. **See also:** `AVAnnotHandlerDeleteInfoProc`, [`PDAnnotHandlerGetAnnotInfoProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotHandlerGetAnnotInfoProc), [`PDRegisterAnnotHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterAnnotHandler) #### PDAnnotHandlerDestroyDataProc ```cpp typedef void(*) PDAnnotHandlerDestroyDataProc(PDAnnotHandler pdanh, PDAnnotHandlerClipboardData data)(PDAnnotHandler pdanh, PDAnnotHandlerClipboardData data) ``` Header: `PDExpT.h:794` (Optional) A callback for PDAnnotHandler. It destroys data from an annotation that has been copied to a clipboard. This callback may be executed regardless of how many times (if any) the annotation was pasted. **See also:** [`PDAnnotHandlerCanCopyProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotHandlerCanCopyProc), [`PDAnnotHandlerCanPasteProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotHandlerCanPasteProc), [`PDAnnotHandlerCopyProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotHandlerCopyProc), [`PDAnnotHandlerPasteProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotHandlerPasteProc), [`PDAnnotDestroyClipboardData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotDestroyClipboardData), [`PDRegisterAnnotHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterAnnotHandler) #### PDAnnotHandlerDestroyProc ```cpp typedef void(*) PDAnnotHandlerDestroyProc(PDAnnotHandler pdanh)(PDAnnotHandler pdanh) ``` Header: `PDExpT.h:805` (Optional) A callback for PDAnnotHandler. It destroys the annotation handler structure when the application no longer requires it. The handler should destroy any dynamic memory stored in the `userData` field. **See also:** [`PDRegisterAnnotHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterAnnotHandler) #### PDAnnotHandlerGetAnnotInfoFlagsProc ```cpp typedef ASFlagBits(*) PDAnnotHandlerGetAnnotInfoFlagsProc(PDAnnotHandler pdanh, PDAnnot pdan)(PDAnnotHandler pdanh, PDAnnot pdan) ``` Header: `PDExpT.h:685` A callback for PDAnnotHandler. It gets the annotation handler information flags, which indicate the operations allowed with annotations of this type. The value is an OR of the following flags: Operation Description `PDAnnotOperationSummarize` It is okay to summarize annotations. `PDAnnotOperationFilter` It is okay to filter annotations. `PDAnnotOperationManager` It is okay to manage annotations. `PDAnnotIgnorePerms` Allow modifying this annotation type in a write-protected document. `PDAnnotOperationAll` All operations are allowed. **See also:** [`PDAnnotHandlerGetAnnotInfoProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotHandlerGetAnnotInfoProc), [`PDRegisterAnnotHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterAnnotHandler) #### PDAnnotHandlerGetAnnotInfoProc ```cpp typedef PDAnnotInfo(*) PDAnnotHandlerGetAnnotInfoProc(PDAnnotHandler pdanh, PDAnnot pdan, PDPage pdpage)(PDAnnotHandler pdanh, PDAnnot pdan, PDPage pdpage) ``` Header: `PDExpT.h:582` A callback for PDAnnotHandler. It gets the annotation information for an annotation. **See also:** `AVAnnotHandlerGetInfoProc`, [`PDAnnotHandlerDeleteAnnotInfoProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotHandlerDeleteAnnotInfoProc), [`PDRegisterAnnotHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterAnnotHandler) #### PDAnnotHandlerGetHeelPointProc ```cpp typedef void(*) PDAnnotHandlerGetHeelPointProc(PDAnnotHandler pdanh, PDAnnot pdan, ASFixedPoint *point)(PDAnnotHandler pdanh, PDAnnot pdan, ASFixedPoint *point) ``` Header: `PDExpT.h:818` A callback for PDAnnotHandler. It gets the heel point (the focus or starting point) for the annotation. For a rectangular annotation, this is usually the top left corner. **See also:** [`PDRegisterAnnotHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterAnnotHandler) #### PDAnnotHandlerGetPrintAppearanceProc ```cpp typedef CosObj(*) PDAnnotHandlerGetPrintAppearanceProc(PDAnnotHandler pdanh, PDAnnot pdan, ASFixedRect *frAnnot, PDAnnotPrintOp op)(PDAnnotHandler pdanh, PDAnnot pdan, ASFixedRect *frAnnot, PDAnnotPrintOp op) ``` Header: `PDExpT.h:840` A callback for PDAnnotHandler. It is called by the host application to obtain a print appearance (a Form XObject). If this callback is not implemented, the default appearance (if any) is used. **See also:** [`PDRegisterAnnotHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterAnnotHandler) #### PDAnnotHandlerGetTypeProc ```cpp typedef ASAtom(*) PDAnnotHandlerGetTypeProc(PDAnnotHandler pdanh)(PDAnnotHandler pdanh) ``` Header: `PDExpT.h:611` A callback for PDAnnotHandler. It gets an ASAtom indicating the annotation type for which the handler is responsible. This corresponds to the annotation's Subtype key in the PDF file. **See also:** [`PDAnnotHandlerGetAnnotInfoProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotHandlerGetAnnotInfoProc), [`PDRegisterAnnotHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterAnnotHandler) #### PDAnnotHandlerPasteProc ```cpp typedef PDAnnot(*) PDAnnotHandlerPasteProc(PDAnnotHandler pdanh, PDPage destPage, const ASFixedPoint *center, PDAnnotHandlerClipboardData data)(PDAnnotHandler pdanh, PDPage destPage, const ASFixedPoint *center, PDAnnotHandlerClipboardData data) ``` Header: `PDExpT.h:775` (Optional) A callback for PDAnnotHandler. It creates a new annotation on the specified page using clipboard data generated by PDAnnotCopy(). **See also:** [`PDAnnotHandlerCanCopyProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotHandlerCanCopyProc), [`PDAnnotHandlerCanPasteProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotHandlerCanPasteProc), [`PDAnnotHandlerCopyProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotHandlerCopyProc), [`PDAnnotHandlerDestroyDataProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotHandlerDestroyDataProc), [`PDAnnotCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotCopy), [`PDAnnotPaste`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotPaste), [`PDRegisterAnnotHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterAnnotHandler) ### Structures (1) #### PDAnnotHandler ```cpp typedef struct _t_PDAnnotHandler* PDAnnotHandler ``` Header: `PDExpT.h:535` A data structure containing callbacks that implement an annotation manager. The callbacks implement the annotation manager functions (for example, view, delete, or export the annotations of a document as a list, sorted by type, author, or date). To fully use a PDAnnotHandler, the AVAnnotHandler associated with this annotation must have its AVAnnotHandlerGetInfoProc() and AVAnnotHandlerDeleteInfoProc() callbacks defined. **See also:** [`PDRegisterAnnotHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterAnnotHandler) ## PDBead ### Functions (15) #### PDBeadAcquirePage ```cpp PDPage PDBeadAcquirePage(PDBead bead, PDDoc pdDoc) ``` Header: `PDProcs.h:4263` Acquires the page on which a bead is located. **Parameters** - `bead` ([`PDBead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBead)): IN/OUT The bead whose page is acquired. - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The document in which bead is located. **Returns:** [`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage) The page on which the bead resides. The acquired page must be freed using PDPageRelease() when it is no longer needed. **See also:** [`PDPageRelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageRelease) #### PDBeadDestroy ```cpp void PDBeadDestroy(PDBead bead) ``` Header: `PDProcs.h:4208` Destroys a bead. **Parameters** - `bead` ([`PDBead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBead)): IN/OUT The bead to destroy. **Returns:** `void` **Exceptions** - `pdErrBadBead` **See also:** [`PDBeadNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBeadNew), [`PDBeadFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBeadFromCosObj) #### PDBeadEqual ```cpp ASBool PDBeadEqual(PDBead bead, PDBead bead2) ``` Header: `PDProcs.h:4348` Tests two beads for equality. This method is useful to detect the end of a thread since the last bead in a thread points to the first. **Parameters** - `bead` ([`PDBead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBead)): The first bead to compare. - `bead2` ([`PDBead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBead)): The second bead to compare. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the two beads are identical, `false` otherwise. Two beads are equal only if their Cos objects are equal (see CosObjEqual()). **See also:** [`CosObjEqual`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjEqual) #### PDBeadFromCosObj ```cpp PDBead PDBeadFromCosObj(CosObj obj) ``` Header: `PDProcs.h:4375` Gets the PDBead corresponding to a Cos object, after checking the bead's validity. This method does not copy the object, but is instead the logical equivalent of a type cast. **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The dictionary Cos object whose bead is obtained. **Returns:** [`PDBead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBead) The PDBead object for the bead. **Exceptions** - `pdErrBadBead`: is raised if the bead is not valid, as determined by PDBeadIsValid(). **See also:** [`PDBeadGetCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBeadGetCosObj) #### PDBeadGetCosObj ```cpp CosObj PDBeadGetCosObj(PDBead bead) ``` Header: `PDProcs.h:4362` Gets the Cos object corresponding to a bead. This method does not copy the object, but is instead the logical equivalent of a type cast. **Parameters** - `bead` ([`PDBead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBead)): IN/OUT The bead whose Cos object is obtained. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) The dictionary Cos object for the bead. The contents of the dictionary can be enumerated using CosObjEnum(). It returns a `NULL` Cos object if `PDBeadIsValid(bead)` returns `false`. **See also:** [`PDBeadFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBeadFromCosObj) #### PDBeadGetIndex ```cpp ASInt32 PDBeadGetIndex(PDBead bead) ``` Header: `PDProcs.h:4334` Gets the index of a bead in its thread. **Parameters** - `bead` ([`PDBead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBead)): IN/OUT The bead whose index is obtained. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The index of the bead in its thread. The first bead in a thread has an index of zero. #### PDBeadGetNext ```cpp PDBead PDBeadGetNext(PDBead bead) ``` Header: `PDProcs.h:4223` Gets the next bead in a thread. **Parameters** - `bead` ([`PDBead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBead)): IN/OUT The bead for which the next bead is obtained. **Returns:** [`PDBead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBead) The next bead, or a `NULL` Cos object (cast to a PDBead using PDBeadFromCosObj()). On the last bead, PDBeadGetNext() returns the first bead. **See also:** [`PDBeadGetPrev`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBeadGetPrev), [`PDThreadGetFirstBead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThreadGetFirstBead), [`PDBeadEqual`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBeadEqual) #### PDBeadGetPrev ```cpp PDBead PDBeadGetPrev(PDBead bead) ``` Header: `PDProcs.h:4238` Gets the previous bead in a thread. **Parameters** - `bead` ([`PDBead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBead)): IN/OUT The bead for which the previous bead is obtained. **Returns:** [`PDBead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBead) The previous bead, or a `NULL` Cos object (cast to a PDBead using PDBeadFromCosObj()) if this is the first bead in the thread. **See also:** [`PDBeadGetNext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBeadGetNext), [`PDThreadGetFirstBead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThreadGetFirstBead), [`PDBeadEqual`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBeadEqual) #### PDBeadGetRect ```cpp void PDBeadGetRect(PDBead bead, ASFixedRectP rectP) ``` Header: `PDProcs.h:4286` Gets a bead's bounding rectangle. **Parameters** - `bead` ([`PDBead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBead)): IN/OUT The bead whose bounding rectangle is obtained. - `rectP` (`ASFixedRectP`): IN/OUT (Filled by the method) A pointer to a `ASFixedRect` specifying the bead's bounding rectangle, specified in user space coordinates. **Returns:** `void` #### PDBeadGetThread ```cpp PDThread PDBeadGetThread(PDBead bead) ``` Header: `PDProcs.h:4324` Gets the thread containing the specified bead. **Parameters** - `bead` ([`PDBead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBead)): IN/OUT The bead whose thread is obtained. **Returns:** [`PDThread`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThread) The bead's thread, or a `NULL` Cos object if the bead does not belong to a thread. **See also:** [`PDBeadGetRect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBeadGetRect), [`PDBeadGetIndex`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBeadGetIndex), [`PDBeadGetNext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBeadGetNext), [`PDBeadGetPrev`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBeadGetPrev) #### PDBeadInsert ```cpp void PDBeadInsert(PDBead bead, PDBead newNext) ``` Header: `PDProcs.h:4250` Inserts a bead after the specified bead. **Parameters** - `bead` ([`PDBead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBead)): IN/OUT The bead after which newNext will be inserted. - `newNext` ([`PDBead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBead)): IN/OUT The bead to insert. **Returns:** `void` **See also:** [`PDBeadNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBeadNew), [`PDThreadSetFirstBead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThreadSetFirstBead) #### PDBeadIsValid ```cpp ASBool PDBeadIsValid(PDBead bead) ``` Header: `PDProcs.h:4310` Tests a bead's validity. This is intended only to ensure that the bead has not been deleted, not to ensure that all necessary information is present and valid. **Parameters** - `bead` ([`PDBead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBead)): The bead whose validity is tested. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the bead is valid, `false` otherwise. **See also:** [`PDBeadEqual`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBeadEqual) #### PDBeadNew ```cpp PDBead PDBeadNew(PDPage page, const ASFixedRectP destRect) ``` Header: `PDProcs.h:4197` Creates a new bead on the specified page. The newly created bead is not linked to a thread or another bead. Use PDThreadSetFirstBead() to make the bead the first bead in a thread. Use PDBeadInsert() to link it to another bead. **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page on which the bead is created. - `destRect` (`const ASFixedRectP`): A pointer to a `ASFixedRect` specifying the bead's bounding rectangle, specified in user space coordinates. **Returns:** [`PDBead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBead) The newly created bead. **See also:** [`PDThreadSetFirstBead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThreadSetFirstBead), [`PDBeadInsert`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBeadInsert), [`PDBeadFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBeadFromCosObj), [`PDBeadDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBeadDestroy) #### PDBeadSetPage ```cpp void PDBeadSetPage(PDBead bead, PDPage newPage) ``` Header: `PDProcs.h:4274` Sets the page for a bead. **Parameters** - `bead` ([`PDBead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBead)): IN/OUT The bead whose page is set. - `newPage` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): IN/OUT The page on which bead is located. **Returns:** `void` **Exceptions** - `pdErrBadBead` **See also:** [`PDBeadSetRect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBeadSetRect) #### PDBeadSetRect ```cpp void PDBeadSetRect(PDBead bead, const ASFixedRectP newDestRect) ``` Header: `PDProcs.h:4299` Sets a bead's bounding rectangle. **Parameters** - `bead` ([`PDBead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBead)): IN/OUT The bead whose bounding rectangle is set. - `newDestRect` (`const ASFixedRectP`): IN/OUT A pointer to a `ASFixedRect` specifying the bead's bounding rectangle, specified in user space coordinates. **Returns:** `void` **See also:** [`PDBeadGetRect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBeadGetRect), [`PDBeadSetPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBeadSetPage) ### Typedefs (1) #### PDBead ```cpp typedef OPAQUE_64_BITS PDBead ``` Header: `PDExpT.h:3244` A single rectangle in an article thread. (Article threads are known simply as articles in the Acrobat viewer's user interface). A bead remains valid as long as a thread is *current* and *active*. **See also:** `AVPageViewGetActiveBead`, `AVPageViewIsBeadAtPoint`, [`PDBeadNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBeadNew), [`PDBeadGetNext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBeadGetNext), [`PDBeadGetPrev`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBeadGetPrev), [`PDThreadGetFirstBead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThreadGetFirstBead), [`PDBeadDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBeadDestroy) ## PDBookmark ### Functions (38) #### PDBookmarkAddChild ```cpp void PDBookmarkAddChild(PDBookmark parent, PDBookmark aBookmark) ``` Header: `PDProcs.h:905` Adds `aBookmark` as the last child of `parent`, adjusting the tree containing `parent` appropriately. If `parent` previously had no children, it is open after the child is added. **Parameters** - `parent` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): The parent of the bookmark being added. - `aBookmark` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): The bookmark that will become the last child of `aBookmark`. `aBookmark` must have been previously unlinked. @notify PDBookmarkDidChangePosition **Returns:** `void` **See also:** [`PDBookmarkAddNewSibling`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddNewSibling), [`PDBookmarkAddNewChild`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddNewChild), [`PDBookmarkAddSubtree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddSubtree), [`PDBookmarkAddPrev`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddPrev), [`PDBookmarkAddNext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddNext), [`PDBookmarkUnlink`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkUnlink) #### PDBookmarkAddNewChild ```cpp PDBookmark PDBookmarkAddNewChild(PDBookmark aBookmark, const char *initialText) ``` Header: `PDProcs.h:773` Adds a new bookmark to the tree containing `aBookmark`, as the new last child of `aBookmark`. If `aBookmark` previously had no children, it will be open after the child is added. **Parameters** - `aBookmark` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): The bookmark to which a new last child is added. - `initialText` (`const char *`): The new bookmark's title. **Returns:** [`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark) The newly created bookmark. @notify PDBookmarkDidChangePosition @notify PDBookmarkWasCreated **See also:** [`PDBookmarkAddNewSibling`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddNewSibling), [`PDBookmarkAddSubtree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddSubtree), [`PDBookmarkAddPrev`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddPrev), [`PDBookmarkAddNext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddNext), [`PDBookmarkAddChild`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddChild), [`PDBookmarkUnlink`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkUnlink) #### PDBookmarkAddNewChildASText ```cpp PDBookmark PDBookmarkAddNewChildASText(PDBookmark aBookmark, const ASText initialText) ``` Header: `PDProcs.h:11616` Adds a new bookmark to the tree containing `aBookmark`, as the new last child of aBookmark. If `aBookmark` previously had no children, it will be open after the child is added. @notify PDBookmarkDidChangePosition @notify PDBookmarkWasCreated **Parameters** - `aBookmark` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): The bookmark to which a new last child is added. - `initialText` ([`const ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): The text object containing the new bookmark's title. **Returns:** [`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark) The newly created bookmark. **See also:** [`PDBookmarkAddNewChild`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddNewChild), [`PDBookmarkAddNewSiblingASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddNewSiblingASText), [`PDBookmarkAddNewSibling`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddNewSibling), [`PDBookmarkAddSubtreeASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddSubtreeASText), [`PDBookmarkAddSubtree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddSubtree), [`PDBookmarkAddPrev`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddPrev), [`PDBookmarkAddNext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddNext), [`PDBookmarkAddChild`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddChild), [`PDBookmarkUnlink`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkUnlink) #### PDBookmarkAddNewSibling ```cpp PDBookmark PDBookmarkAddNewSibling(PDBookmark aBookmark, char *initialText) ``` Header: `PDProcs.h:752` Adds a new bookmark to the tree containing `aBookmark`, as the new right sibling. **Parameters** - `aBookmark` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): The bookmark that will be the left sibling of the new bookmark. - `initialText` (`char *`): The new bookmark's title. **Returns:** [`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark) The newly created bookmark. @notify PDBookmarkDidChangePosition @notify PDBookmarkWasCreated **See also:** [`PDBookmarkAddChild`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddChild), [`PDBookmarkAddNewChild`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddNewChild), [`PDBookmarkAddNext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddNext), [`PDBookmarkAddPrev`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddPrev), [`PDBookmarkAddSubtree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddSubtree), [`PDBookmarkUnlink`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkUnlink) #### PDBookmarkAddNewSiblingASText ```cpp PDBookmark PDBookmarkAddNewSiblingASText(PDBookmark aBookmark, const ASText initialText) ``` Header: `PDProcs.h:11590` Adds a new bookmark to the tree containing `aBookmark`, as the new right sibling. @notify PDBookmarkDidChangePosition @notify PDBookmarkWasCreated **Parameters** - `aBookmark` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): The bookmark that will be the left sibling of the new bookmark. - `initialText` ([`const ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): The text object containing the new bookmark's title. **Returns:** [`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark) The newly created bookmark. **See also:** [`PDBookmarkAddNewSibling`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddNewSibling), [`PDBookmarkAddChild`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddChild), [`PDBookmarkAddNewChildASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddNewChildASText), [`PDBookmarkAddNewChild`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddNewChild), [`PDBookmarkAddNext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddNext), [`PDBookmarkAddPrev`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddPrev), [`PDBookmarkAddSubtreeASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddSubtreeASText), [`PDBookmarkAddSubtree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddSubtree), [`PDBookmarkUnlink`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkUnlink) #### PDBookmarkAddNext ```cpp void PDBookmarkAddNext(PDBookmark aBookmark, PDBookmark newNext) ``` Header: `PDProcs.h:885` Adds `newNext` as the new right sibling to `aBookmark`. @notify PDBookmarkDidChangePosition **Parameters** - `aBookmark` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): IN/OUT The bookmark that will receive a new right sibling. - `newNext` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): IN/OUT The bookmark to become the new right sibling of `aBookmark`. `newNext` must have been previously unlinked. **Returns:** `void` **See also:** [`PDBookmarkAddNewSibling`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddNewSibling), [`PDBookmarkAddChild`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddChild), [`PDBookmarkAddSubtree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddSubtree), [`PDBookmarkAddPrev`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddPrev), [`PDBookmarkAddNewChild`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddNewChild), [`PDBookmarkUnlink`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkUnlink) #### PDBookmarkAddPrev ```cpp void PDBookmarkAddPrev(PDBookmark aBookmark, PDBookmark newPrev) ``` Header: `PDProcs.h:867` Adds `newPrev` as the new left sibling to `aBookmark`, adjusting the tree containing `aBookmark` appropriately. **Parameters** - `aBookmark` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): The bookmark that will receive a new left sibling `newPrev`. - `newPrev` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): The bookmark to become the new left sibling of `aBookmark`. `newPrev` must have been previously unlinked. @notify PDBookmarkDidChangePosition **Returns:** `void` **See also:** [`PDBookmarkAddNewSibling`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddNewSibling), [`PDBookmarkAddNewChild`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddNewChild), [`PDBookmarkAddSubtree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddSubtree), [`PDBookmarkAddNext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddNext), [`PDBookmarkAddChild`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddChild), [`PDBookmarkUnlink`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkUnlink) #### PDBookmarkAddSubtree ```cpp void PDBookmarkAddSubtree(PDBookmark aBookmark, PDBookmark source, char *sourceTitle) ``` Header: `PDProcs.h:797` Adds a copy of the bookmark subtree source to `aBookmark`, as a new last child of `aBookmark`. This new item will have the text value `sourceTitle`, will be open, and will have no destination attribute. `source` must have been previously unlinked. If `aBookmark` previously had no children, it will be open after the subtree is added. **Parameters** - `aBookmark` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): IN/OUT The bookmark to which the subtree source will be added as a new last child. - `source` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): IN/OUT The bookmark subtree to add. - `sourceTitle` (`char *`): IN/OUT The new bookmark's title. @notify PDBookmarkWillChange @notify PDBookmarkDidChange @notify PDBookmarkDidChangePosition **Returns:** `void` **See also:** [`PDBookmarkAddNewSibling`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddNewSibling), [`PDBookmarkAddNewChild`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddNewChild), [`PDBookmarkAddPrev`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddPrev), [`PDBookmarkAddNext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddNext), [`PDBookmarkAddChild`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddChild), [`PDBookmarkUnlink`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkUnlink) #### PDBookmarkAddSubtreeASText ```cpp void PDBookmarkAddSubtreeASText(PDBookmark aBookmark, PDBookmark source, const ASText sourceTitle) ``` Header: `PDProcs.h:11645` Adds a copy of the bookmark subtree source to `aBookmark`, as a new last child of `aBookmark`. This new item will have the text value `sourceTitle`, will be open, and will have no destination attribute. `source` must have been previously unlinked. If `aBookmark` previously had no children, it will be open after the subtree is added. @notify PDBookmarkWillChange @notify PDBookmarkDidChange @notify PDBookmarkDidChangePosition **Parameters** - `aBookmark` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): The bookmark to which the subtree source will be added as a new last child. - `source` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): The bookmark subtree to add. - `sourceTitle` ([`const ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): The text object containing the new bookmark's title. **Returns:** `void` **See also:** [`PDBookmarkAddSubtree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddSubtree), [`PDBookmarkAddNewSiblingASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddNewSiblingASText), [`PDBookmarkAddNewSibling`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddNewSibling), [`PDBookmarkAddNewChildASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddNewChildASText), [`PDBookmarkAddNewChild`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddNewChild), [`PDBookmarkAddPrev`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddPrev), [`PDBookmarkAddNext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddNext), [`PDBookmarkAddChild`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddChild), [`PDBookmarkUnlink`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkUnlink) #### PDBookmarkDestroy ```cpp void PDBookmarkDestroy(PDBookmark aBookmark) ``` Header: `PDProcs.h:812` Removes a bookmark subtree from the bookmark tree containing it. @notify PDBookmarkWillDestroy @notify PDBookmarkDidDestroy **Parameters** - `aBookmark` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): IN/OUT The root bookmark of the subtree to remove. **Returns:** `void` **See also:** [`PDBookmarkAddNewChild`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddNewChild), [`PDBookmarkAddNewSibling`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddNewSibling), [`PDBookmarkFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkFromCosObj), [`PDBookmarkUnlink`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkUnlink) #### PDBookmarkEqual ```cpp ASBool PDBookmarkEqual(PDBookmark aBookmark, PDBookmark bookmark2) ``` Header: `PDProcs.h:1128` Tests whether two bookmarks are equal. Two bookmarks are equal only if their Cos objects are equal (see CosObjEqual()). **Parameters** - `aBookmark` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): The first bookmark to compare. - `bookmark2` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): The second bookmark to compare. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the bookmarks are equal, `false` otherwise. **See also:** [`CosObjEqual`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjEqual) #### PDBookmarkFromCosObj ```cpp PDBookmark PDBookmarkFromCosObj(CosObj obj) ``` Header: `PDProcs.h:1157` Converts a Cos dictionary object to a bookmark and checks the validity of the bookmark. This method does not copy the object, but is instead the logical equivalent of a type cast. **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The dictionary Cos object whose bookmark is obtained. **Returns:** [`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark) The bookmark corresponding to the Cos object. **Exceptions** - `pdErrBadBookmark`: is raised if the bookmark is not valid as determined by PDBookmarkIsValid(). **See also:** [`PDBookmarkGetCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkGetCosObj) #### PDBookmarkGetAction ```cpp PDAction PDBookmarkGetAction(PDBookmark aBookmark) ``` Header: `PDProcs.h:1104` Gets a bookmark's action. After you obtain the action, you can execute it with AVDocPerformAction(). **Parameters** - `aBookmark` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): IN/OUT The bookmark whose action is obtained. **Returns:** [`PDAction`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAction) The bookmark's action. **See also:** `AVDocPerformAction`, [`PDBookmarkSetAction`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkSetAction), [`PDLinkAnnotGetAction`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDLinkAnnotGetAction) #### PDBookmarkGetByTitle ```cpp PDBookmark PDBookmarkGetByTitle(PDBookmark aBookmark, const char *aname, ASInt32 nameLen, ASInt32 maxdepth) ``` Header: `PDProcs.h:838` Gets the first bookmark whose title is `aName`. Value Description `0` Only look at `aBookmark`, not at any of its children. `1` Check `aBookmark` and its children, but not any grandchildren or great grandchildren, and so on. `-1` Check the entire subtree. **Note:** This text is stored in either PDFDocEncoding or in Unicode. If it is stored in Unicode, a valid Byte Order Mark must be present. **Parameters** - `aBookmark` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): IN/OUT The root of the bookmark subtree to search. - `aname` (`const char *`): IN/OUT The text value to search for. Character codes in `aName` are interpreted using the `PDFDocEncoding`. - `nameLen` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN/OUT The length of `aName`. - `maxdepth` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN/OUT The number of subtree levels to search, not counting the root level: **Returns:** [`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark) The bookmark with the specified title, or a `NULL` Cos object if there is no such bookmark. #### PDBookmarkGetByTitleASText ```cpp PDBookmark PDBookmarkGetByTitleASText(PDBookmark aBookmark, const ASText title, ASInt32 maxDepth) ``` Header: `PDProcs.h:11668` Gets the first bookmark whose title is set in passed the ASText object. **Parameters** - `aBookmark` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): The root of the bookmark subtree to search. - `title` ([`const ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): The text object containing the title value to search for. - `maxDepth` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The number of subtree levels to search, not counting the root level. ValueDescription `0`Only look at `aBookmark`, not at any of its children. `1`Check `aBookmark` and its children, but not any grandchildren or great grandchildren, and so on. `-1`Check the entire subtree.`NULL` Cos object if there is no such bookmark. **Returns:** [`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark) **See also:** [`PDBookmarkGetByTitle`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkGetByTitle) #### PDBookmarkGetColor ```cpp ASBool PDBookmarkGetColor(PDBookmark bm, PDColorValue pdcvOut) ``` Header: `PDProcs.h:8064` Retrieves the color of the specified bookmark. An exception is thrown if the bookmark is invalid or the existing color is malformed in the PDF file. **Parameters** - `bm` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): The bookmark in question. - `pdcvOut` (`PDColorValue`): (Filled by the method) The color of the bookmark in PDColorValue format. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the color was specified, `false` otherwise (the default color is returned in `pdcvOut`). **See also:** [`PDBookmarkSetColor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkSetColor) #### PDBookmarkGetCosObj ```cpp CosObj PDBookmarkGetCosObj(PDBookmark aBookmark) ``` Header: `PDProcs.h:1142` Gets the Cos object for a bookmark. This method does not copy the object, but is instead the logical equivalent of a type cast. **Parameters** - `aBookmark` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): IN/OUT The bookmark whose Cos object is obtained. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) The dictionary Cos object for the bookmark. The contents of the dictionary can be enumerated using CosObjEnum(). **See also:** [`PDBookmarkFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkFromCosObj), [`CosObjEnum`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjEnum) #### PDBookmarkGetCount ```cpp ASInt32 PDBookmarkGetCount(PDBookmark aBookmark) ``` Header: `PDProcs.h:849` Gets the number of open bookmarks in a subtree. **Parameters** - `aBookmark` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): The root bookmark of a subtree to count. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The number of open bookmarks in the subtree (not including `aBookmark`). **See also:** [`PDBookmarkGetIndent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkGetIndent), [`PDBookmarkHasChildren`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkHasChildren) #### PDBookmarkGetFirstChild ```cpp PDBookmark PDBookmarkGetFirstChild(PDBookmark aBookmark) ``` Header: `PDProcs.h:955` Gets a bookmark's first child. **Parameters** - `aBookmark` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): IN/OUT The bookmark whose first child is obtained. **Returns:** [`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark) **See also:** [`PDBookmarkGetParent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkGetParent), [`PDBookmarkGetLastChild`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkGetLastChild), [`PDBookmarkHasChildren`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkHasChildren), [`PDBookmarkGetNext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkGetNext), [`PDBookmarkGetPrev`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkGetPrev) #### PDBookmarkGetFlags ```cpp ASInt32 PDBookmarkGetFlags(PDBookmark bm) ``` Header: `PDProcs.h:8090` Retrieves the flags of the specified bookmark. An exception is thrown if the bookmark is invalid or the existing style is malformed in the PDF file. **Parameters** - `bm` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): The bookmark whose flags are obtained. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The bookmark's flags. Bit 1 (the least significant bit) indicates an italic font; bit 2 indicates a bold font. **See also:** [`PDBookmarkSetFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkSetFlags) #### PDBookmarkGetIndent ```cpp ASInt32 PDBookmarkGetIndent(PDBookmark aBookmark) ``` Header: `PDProcs.h:1009` Returns the indentation level of a bookmark in its containing tree. **Parameters** - `aBookmark` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): IN/OUT The bookmark whose indentation level is obtained. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The indentation level of `aBookmark` in its containing tree. The root and its direct children have an indentation level of zero. #### PDBookmarkGetLastChild ```cpp PDBookmark PDBookmarkGetLastChild(PDBookmark aBookmark) ``` Header: `PDProcs.h:969` Gets a bookmark's last child. **Parameters** - `aBookmark` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): IN/OUT The bookmark whose last child is obtained. **Returns:** [`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark) **See also:** [`PDBookmarkGetParent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkGetParent), [`PDBookmarkGetFirstChild`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkGetFirstChild), [`PDBookmarkGetNext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkGetNext), [`PDBookmarkGetPrev`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkGetPrev) #### PDBookmarkGetNext ```cpp PDBookmark PDBookmarkGetNext(PDBookmark aBookmark) ``` Header: `PDProcs.h:983` Gets a bookmark's next (right) sibling. **Parameters** - `aBookmark` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): The bookmark whose right sibling is obtained. **Returns:** [`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark) **See also:** [`PDBookmarkGetParent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkGetParent), [`PDBookmarkGetFirstChild`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkGetFirstChild), [`PDBookmarkGetLastChild`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkGetLastChild), [`PDBookmarkGetPrev`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkGetPrev) #### PDBookmarkGetParent ```cpp PDBookmark PDBookmarkGetParent(PDBookmark aBookmark) ``` Header: `PDProcs.h:940` Gets a bookmark's parent bookmark. **Parameters** - `aBookmark` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): The bookmark whose parent is obtained. **Returns:** [`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark) **See also:** [`PDBookmarkGetFirstChild`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkGetFirstChild), [`PDBookmarkGetLastChild`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkGetLastChild), [`PDBookmarkGetNext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkGetNext), [`PDBookmarkGetPrev`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkGetPrev) #### PDBookmarkGetPrev ```cpp PDBookmark PDBookmarkGetPrev(PDBookmark aBookmark) ``` Header: `PDProcs.h:998` Returns a bookmark's previous (left) sibling. **Parameters** - `aBookmark` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): IN/OUT The bookmark whose left sibling is obtained. **Returns:** [`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark) Previous (left) sibling of `aBookmark`, or a `NULL` Cos object if `aBookmark` has no previous sibling (it is its parent's first child). **See also:** [`PDBookmarkGetParent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkGetParent), [`PDBookmarkGetFirstChild`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkGetFirstChild), [`PDBookmarkGetLastChild`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkGetLastChild), [`PDBookmarkGetNext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkGetNext) #### PDBookmarkGetTitle ```cpp ASInt32 PDBookmarkGetTitle(PDBookmark aBookmark, char *buffer, ASInt32 bufSize) ``` Header: `PDProcs.h:1036` Gets a bookmark's title. @since **Parameters** - `aBookmark` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): The bookmark whose title is obtained. - `buffer` (`char *`): (Filled by the method) The buffer into which the title will be written. If `buffer` is non-`NULL`, its length is assumed to be `bufSize + 1`, because a `NULL` byte is appended to the title. The returned text remains valid only until the next PDModel method call. The text may be converted to a platform's native encoding using PDXlateToHost() or PDXlateToHostEx(). - `bufSize` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The size of the buffer.`buffer`, not counting the trailing `NULL` byte. If `buffer` is `NULL`, the number of bytes in the bookmark is returned. **Note:** This text is stored in either PDFDocEncoding or in Unicode. If it is stored in Unicode, a valid Byte Order Mark must be present. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) **See also:** [`PDBookmarkSetTitle`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkSetTitle), [`PDXlateToHost`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXlateToHost), [`PDXlateToHostEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXlateToHostEx) #### PDBookmarkGetTitleASText ```cpp void PDBookmarkGetTitleASText(PDBookmark aBookmark, ASText title) ``` Header: `PDProcs.h:11548` Gets a bookmark's title as an ASText object. **Parameters** - `aBookmark` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): The bookmark whose title is obtained. - `title` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): (Filled by the method) The text object containing the title. The client must pass a valid ASText object title. The routine does not allocate it. **Returns:** `void` **See also:** [`PDBookmarkGetTitle`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkGetTitle), [`PDBookmarkSetTitleASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkSetTitleASText), [`PDBookmarkSetTitle`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkSetTitle), [`PDXlateToHost`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXlateToHost), [`PDXlateToHostEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXlateToHostEx) #### PDBookmarkHasChildren ```cpp ASBool PDBookmarkHasChildren(PDBookmark aBookmark) ``` Header: `PDProcs.h:1068` Tests whether a bookmark has children. **Parameters** - `aBookmark` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): The bookmark to test. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if `aBookmark` has any children, `false` otherwise. #### PDBookmarkIsOpen ```cpp ASBool PDBookmarkIsOpen(PDBookmark aBookmark) ``` Header: `PDProcs.h:1078` Tests whether a bookmark is open. An open bookmark shows all its children. **Parameters** - `aBookmark` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): The bookmark to test. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the bookmark is open, `false` otherwise. **See also:** [`PDBookmarkSetOpen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkSetOpen) #### PDBookmarkIsValid ```cpp ASBool PDBookmarkIsValid(PDBookmark aBookmark) ``` Header: `PDProcs.h:927` Tests whether a bookmark is valid. This is intended only to ensure that the bookmark has not been deleted, not to ensure that all necessary information is present and valid. **Parameters** - `aBookmark` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): The bookmark whose validity is tested. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the bookmark is valid, `false` otherwise. **See also:** [`PDBookmarkEqual`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkEqual) #### PDBookmarkRemoveAction ```cpp void PDBookmarkRemoveAction(PDBookmark aBookmark) ``` Header: `PDProcs.h:7928` Removes a bookmark's action. **Parameters** - `aBookmark` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): The bookmark whose action is removed. **Returns:** `void` **Exceptions** - `pdErrBadAction`: @notify PDBookmarkDidChange @notify PDBookmarkWillChange #### PDBookmarkSetAction ```cpp void PDBookmarkSetAction(PDBookmark aBookmark, PDAction action) ``` Header: `PDProcs.h:1115` Sets a bookmark's action. **Parameters** - `aBookmark` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): IN/OUT The bookmark whose action is set. - `action` ([`PDAction`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAction)): IN/OUT The bookmark's action. @notify PDBookmarkWillChange @notify PDBookmarkDidChange **Returns:** `void` **See also:** [`PDBookmarkGetAction`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkGetAction) #### PDBookmarkSetColor ```cpp void PDBookmarkSetColor(PDBookmark bm, PDColorValue pdcvIn) ``` Header: `PDProcs.h:8077` Sets the color of the specified bookmark. @notify PDBookmarkWillChange with C as the key. @notify PDBookmarkDidChange with C as the key. **Parameters** - `bm` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): The bookmark whose color is set. - `pdcvIn` (`PDColorValue`): The new color. It must be in `DeviceRGB`. **Returns:** `void` **Exceptions** - `If`: color is `NULL` or not in `DeviceRGB`, the bookmark is invalid or the existing bookmark color is malformed. **See also:** [`PDBookmarkGetColor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkGetColor) #### PDBookmarkSetFlags ```cpp void PDBookmarkSetFlags(PDBookmark bm, ASInt32 nFlags) ``` Header: `PDProcs.h:8105` Sets the flags of the specified bookmark. An exception is thrown if the bookmark is invalid or the existing style is malformed in the PDF file. **Parameters** - `bm` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): The bookmark whose flags are set. - `nFlags` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The new bookmark flags. Bit 1 (the least significant bit) indicates an italic font; bit 2 indicates a bold font. @notify PDBookmarkWillChange with F as the key. @notify PDBookmarkDidChange with F as the key **Returns:** `void` **See also:** [`PDBookmarkGetFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkGetFlags) #### PDBookmarkSetOpen ```cpp void PDBookmarkSetOpen(PDBookmark aBookmark, ASBool isOpen) ``` Header: `PDProcs.h:1091` Opens or closes a bookmark. An open bookmark shows its children, while a closed bookmark does not. **Parameters** - `aBookmark` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): IN/OUT The bookmark to open or close. - `isOpen` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): IN/OUT `true` if the bookmark is opened, `false` if the bookmark is closed. @notify PDBookmarkWillChange @notify PDBookmarkDidChange **Returns:** `void` **See also:** [`PDBookmarkIsOpen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkIsOpen) #### PDBookmarkSetTitle ```cpp void PDBookmarkSetTitle(PDBookmark aBookmark, const char *str, ASInt32 nBytes) ``` Header: `PDProcs.h:1059` Sets a bookmark's title. @notify PDBookmarkWillChange @notify PDBookmarkDidChange @note This text is stored in either PDFDocEncoding or in Unicode. If it is stored in Unicode, a valid Byte Order Mark must be present. @since **Parameters** - `aBookmark` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): The bookmark whose title is set. - `str` (`const char *`): A read-only string containing the bookmark's new title. The text must be encoded using `PDFDocEncoding`. Strings encoded using a platform's native encoding can be converted to `PDFDocEncoding` using PDXlateToPDFDocEnc() or PDXlateToPDFDocEncEx().`str` to copy. - `nBytes` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)) **Returns:** `void` **Exceptions** - `pdErrBookmarksError`: is raised if there is an error setting the title. **See also:** [`PDBookmarkGetTitle`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkGetTitle) #### PDBookmarkSetTitleASText ```cpp void PDBookmarkSetTitleASText(PDBookmark aBookmark, const ASText title) ``` Header: `PDProcs.h:11566` Sets a bookmark's title. @notify PDBookmarkWillChange @notify PDBookmarkDidChange **Parameters** - `aBookmark` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): The bookmark whose title is set. - `title` ([`const ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): The text object containing the bookmark's new title. **Returns:** `void` **Exceptions** - `pdErrBookmarksError`: is raised if there is an error setting the title. **See also:** [`PDBookmarkSetTitle`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkSetTitle), [`PDBookmarkGetTitleASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkGetTitleASText), [`PDBookmarkGetTitle`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkGetTitle) #### PDBookmarkUnlink ```cpp void PDBookmarkUnlink(PDBookmark aBookmark) ``` Header: `PDProcs.h:914` Unlinks a bookmark from the bookmark tree that contains it, and adjusts the tree appropriately. **Parameters** - `aBookmark` ([`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark)): IN/OUT The bookmark to unlink. **Returns:** `void` **See also:** [`PDBookmarkDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkDestroy) ### Typedefs (2) #### PDBookmark ```cpp typedef OPAQUE_64_BITS PDBookmark ``` Header: `PDExpT.h:1088` A bookmark on a page in a PDF file. Each bookmark has a title that appears on screen, and an action that specifies what happens when a user clicks on the bookmark. Bookmarks can either be created interactively by the user through the Acrobat viewer's user interface or programmatically generated. The typical action for a user-created bookmark is to move to another location in the current document, although any action (see PDAction) can be specified. **See also:** [`PDDocGetBookmarkRoot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetBookmarkRoot), [`PDBookmarkAddNewSibling`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddNewSibling), [`PDBookmarkAddNewChild`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkAddNewChild), [`PDBookmarkFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkFromCosObj), [`PDBookmarkGetByTitle`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkGetByTitle), [`PDBookmarkGetParent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkGetParent), [`PDBookmarkGetFirstChild`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkGetFirstChild), [`PDBookmarkGetLastChild`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkGetLastChild), [`PDBookmarkGetNext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkGetNext), [`PDBookmarkGetPrev`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkGetPrev), [`PDBookmarkDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkDestroy), [`PDBookmarkUnlink`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmarkUnlink) #### PDBookmarkFlags ```cpp typedef ASEnum8 PDBookmarkFlags ``` Header: `PDExpT.h:1100` ## PDCharProc ### Functions (2) #### PDCharProcEnum ```cpp void PDCharProcEnum(PDCharProc obj, PDGraphicEnumMonitor mon, void *clientData) ``` Header: `PDProcs.h:4037` Enumerates the graphic description of a single character procedure for a Type 3 font. To enumerate all the character procedures in a Type 3 font (but not their graphic descriptions), use PDFontEnumCharProcs(). **Parameters** - `obj` ([`PDCharProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCharProc)): The character procedure whose graphic description is enumerated. - `mon` ([`PDGraphicEnumMonitor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDGraphicEnumMonitor)): A pointer to a structure containing user-supplied callbacks that are called for each drawing operator on a page. Enumeration halts if any procedure returns `false`. - `clientData` (`void *`): A pointer to user-supplied data to pass to each monitor routine that is called. **Returns:** `void` **See also:** [`PDCharProcEnumWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCharProcEnumWithParams), [`PDFontEnumCharProcs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontEnumCharProcs), [`PDDocEnumFonts`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocEnumFonts), [`PDDocEnumLoadedFonts`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocEnumLoadedFonts) #### PDCharProcGetCosObj ```cpp CosObj PDCharProcGetCosObj(PDCharProc obj) ``` Header: `PDProcs.h:4051` Get the stream Cos object associated with the PDCharProc. This method does not copy the object, but is instead the logical equivalent of a type cast. **Parameters** - `obj` ([`PDCharProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCharProc)): IN/OUT The character procedure whose Cos object is obtained. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) The character procedure's stream Cos object. **See also:** [`PDFontEnumCharProcs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontEnumCharProcs), [`PDCharProcEnum`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCharProcEnum) ## PDCollection ### Functions (16) #### PDCollectionCreateFolder ```cpp PDFolder PDCollectionCreateFolder(PDCollection collection, ASConstText path) ``` Header: `PDProcs.h:12432` Creates a new folder. `/ \ : ? * " < > |` and may not end with a `.` (period). @iverbatim Please note that a folder name cannot consist entirely of spaces. To specify the root folder itself, assign a value of `"/"`. **Parameters** - `collection` ([`PDCollection`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCollection)): The collection that will be associated with the new folder. - `path` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): The path and name of the folder. The path syntax for folders takes the form `[parent/]folder`, where the mandatory `parent/` section may be repeated as necessary to provide a complete path to the new folder. The path is always interpreted as being relative to the root level of the folder hierarchy. Paths that specify simply a new folder name are located in the root folder. The character set for folder names is limited. Folders may not contain any of the characters in the set **Returns:** [`PDFolder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFolder) The new folder object. #### PDCollectionGetFolder ```cpp PDFolder PDCollectionGetFolder(PDCollection collection, ASConstText path) ``` Header: `PDProcs.h:12450` Gets an existing folder. **Parameters** - `collection` ([`PDCollection`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCollection)): The collection associated with the folder to be obtained. - `path` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): The path to the folder. To specify the root folder itself, assign a value of `"/"`. The path syntax for folders takes the form `[parent/]folder`, where the mandatory `parent/` section may be repeated as necessary to provide a complete path to the new folder. **Returns:** [`PDFolder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFolder) The specified folder. If the folder does not exist, the returned folder is invalid. #### PDCollectionGetInitialStyle ```cpp ASBool PDCollectionGetInitialStyle(PDCollection collection, ASCab style) ``` Header: `PDProcs.h:12463` Gets the initial style dictionary for the collection. **Parameters** - `collection` ([`PDCollection`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCollection)): The collection object. - `style` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)): Dictionary to set **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) true if the dictionary is present, if false the passed cabinet is unchanged #### PDCollectionGetSortOrder ```cpp ASArraySize PDCollectionGetSortOrder(PDCollection collection, PDCollectionSchemaSortPairRec *pairs, ASArraySize arrayLen) ``` Header: `PDProcs.h:12343` Gets the contents of the collection sort dictionary. **Parameters** - `collection` ([`PDCollection`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCollection)): The collection object. - `pairs` (`PDCollectionSchemaSortPairRec *`): The array of pairs. It may be `NULL`. - `arrayLen` ([`ASArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASArraySize)): The length of the pairs array. **Returns:** [`ASArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASArraySize) If `pairs` is `NULL`, the number of items in the collection sort dictionary is returned; otherwise, the number of items stored in the `pairs` array is returned. #### PDCollectionGetViewData ```cpp void PDCollectionGetViewData(PDCollection collection, PDCollectionViewDataRec *data) ``` Header: `PDProcs.h:12356` Gets the view data for the collection. **Parameters** - `collection` ([`PDCollection`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCollection)): The collection object. - `data` (`PDCollectionViewDataRec *`): The collection view data. **Returns:** `void` #### PDCollectionIsValid ```cpp ASBool PDCollectionIsValid(PDCollection collection) ``` Header: `PDProcs.h:12316` Determines if a collection is valid. **Parameters** - `collection` ([`PDCollection`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCollection)): The collection **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the collection is valid, `false` otherwise. #### PDCollectionRemoveFolder ```cpp void PDCollectionRemoveFolder(PDCollection collection, ASConstText path) ``` Header: `PDProcs.h:12440` Removes a folder and its descendant folders and associated file attachments. **Parameters** - `collection` ([`PDCollection`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCollection)): The collection associated with the folder that will be removed. - `path` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): The path to the folder. **Returns:** `void` `0` if the folder hierarchy was successfully removed; otherwise an error code identifying the failure condition is returned. #### PDCollectionRemoveInitialStyle ```cpp void PDCollectionRemoveInitialStyle(PDCollection collection) ``` Header: `PDProcs.h:12468` Removes the initial style dictionary from a collect, if present **Parameters** - `collection` ([`PDCollection`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCollection)): The collection object. **Returns:** `void` #### PDCollectionSchemaDestroy ```cpp void PDCollectionSchemaDestroy(PDCollectionSchema schema) ``` Header: `PDProcs.h:12374` Destroys a `PDCollectionSchema` object. **Parameters** - `schema` ([`PDCollectionSchema`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCollectionSchema)) **Returns:** `void` The collection object. #### PDCollectionSchemaGetField ```cpp ASBool PDCollectionSchemaGetField(PDCollectionSchema schema, PDCollectionFieldRec *field) ``` Header: `PDProcs.h:12392` Gets a field by name or position. The caller must set `field.size` to `sizeof(PDCollectionFieldRec)`. To look up a field by name, set `field.fieldName` to the appropriate name. To look up a field by position, set `field.fieldName` to `ASAtomNull`, and set `field.index` to the position. The caller owns (and must destroy) `field.fieldText` if it is not `NULL`. **Parameters** - `schema` ([`PDCollectionSchema`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCollectionSchema)): The collection schema object. - `field` (`PDCollectionFieldRec *`): The field to be obtained. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the field was found, `false` otherwise. #### PDCollectionSchemaGetLength ```cpp ASArraySize PDCollectionSchemaGetLength(PDCollectionSchema schema) ``` Header: `PDProcs.h:12380` Gets the number of fields in the schema. **Parameters** - `schema` ([`PDCollectionSchema`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCollectionSchema)) **Returns:** [`ASArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASArraySize) The number of fields in the schema. #### PDCollectionSchemaRemoveField ```cpp void PDCollectionSchemaRemoveField(PDCollectionSchema schema, ASAtom fieldName) ``` Header: `PDProcs.h:12410` Removes a field from the collection schema. **Parameters** - `schema` ([`PDCollectionSchema`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCollectionSchema)): The collection schema. - `fieldName` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The name of the field to remove from the collection schema. **Returns:** `void` #### PDCollectionSchemaSetField ```cpp void PDCollectionSchemaSetField(PDCollectionSchema schema, const PDCollectionFieldRec *field) ``` Header: `PDProcs.h:12404` Sets a field with new values. The target field is identified by the `field.fieldName` member. If the target field exists, it is overwritten; otherwise a new field is added. The caller must set `field.size` to `sizeof(PDCollectionFieldRec)`. Specifying a new value for `field.index` will affect other field values as necessary to maintain the correct overall ordering. See `PDCollectionSchema` for information about ordering. **Parameters** - `schema` ([`PDCollectionSchema`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCollectionSchema)): The collection schema object. - `field` (`const PDCollectionFieldRec *`): The field to add or modify in the collection schema. **Returns:** `void` **See also:** [`PDCollectionSchema`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCollectionSchema) #### PDCollectionSetInitialStyle ```cpp void PDCollectionSetInitialStyle(PDCollection collection, ASConstCab style) ``` Header: `PDProcs.h:12456` Sets the initial style dictionary for the collection. **Parameters** - `collection` ([`PDCollection`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCollection)): The collection object. - `style` ([`ASConstCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstCab)): Dictionary to fill **Returns:** `void` #### PDCollectionSetSortOrder ```cpp void PDCollectionSetSortOrder(PDCollection collection, const PDCollectionSchemaSortPairRec *pairs, ASArraySize arrayLen) ``` Header: `PDProcs.h:12350` Set the contents of the collection sort dictionary. **Parameters** - `collection` ([`PDCollection`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCollection)): The collection object. - `pairs` (`const PDCollectionSchemaSortPairRec *`): The array of pairs. If it is `NULL`, the collection sort dictionary is removed. - `arrayLen` ([`ASArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASArraySize)): The length of the `pairs` array. **Returns:** `void` #### PDCollectionSetViewData ```cpp void PDCollectionSetViewData(PDCollection collection, const PDCollectionViewDataRec *data) ``` Header: `PDProcs.h:12362` Set the view data for the collection. **Parameters** - `collection` ([`PDCollection`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCollection)): The collection object. - `data` (`const PDCollectionViewDataRec *`): The collection view data. **Returns:** `void` ### Typedefs (4) #### PDCollection ```cpp typedef OPAQUE_64_BITS PDCollection ``` Header: `PDExpT.h:7023` A `PDCollection` represents a collection dictionary in a PDF file. Collection view types and split types are unusual. A straight mapping of the View key and the Split key would result in the key/value of `/View/H` being part of the view type enumeration, but that would result in ambiguity when setting View to H and Split to N (`/View/H` maps to "preview" in Acrobat 8, but `/Split/N` is documented to map to "no split, show navigator" in Acrobat 9. Because of this, and the fact that `/View/H` is really interpreted as a kind of split rather than a style of navigator, Preview was moved to the split type enumeration in the API. This interacts with the underlying file as follows: when a `/View/H` value is read it is mapped to "Tile" and "Preview" for the navigator style and split position. When the Tile/Preview combination is written out, it is recorded back to `/View/H` for consistency with Acrobat 8. **See also:** [`PDDocGetPDCollection`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetPDCollection), [`PDDocCreatePDCollection`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreatePDCollection), [`PDDocDeleteCollection`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocDeleteCollection) #### PDCollectionSplitType ```cpp typedef ASUns16 PDCollectionSplitType ``` Header: `PDExpT.h:7058` #### PDCollectionViewType ```cpp typedef ASUns16 PDCollectionViewType ``` Header: `PDExpT.h:7043` #### PDNavigator ```cpp typedef OPAQUE_64_BITS PDNavigator ``` Header: `PDExpT.h:7032` Opaque object representing a collection navigator dictionary. ### Enums (2) #### PDCollectionSplitTypes Header: `PDExpT.h:7046` Collection split types. **Values** - `kCollectionSplitDefault = 0x2000`: Default split based on view. - `kCollectionSplitHorizontal = 8193`: Split vertical. - `kCollectionSplitVertical = 8194`: Split horizontal. - `kCollectionSplitNone = 8195`: No split; show the navigator. - `kCollectionSplitPreview = 8196`: No split; show the preview. #### PDCollectionViewTypes Header: `PDExpT.h:7035` Collection view types. **Values** - `kCollectionViewTile = 0x1000`: Tile navigator. - `kCollectionViewDetails = 4097`: Details navigator. - `kCollectionViewCustom = 4098`: Custom navigator. ## PDCollectionSchema ### Functions (1) #### PDCollectionSchemaAcquire ```cpp PDCollectionSchema PDCollectionSchemaAcquire(PDCollection collection) ``` Header: `PDProcs.h:12368` Acquires the `PDCollectionSchema` object for a collection. **Parameters** - `collection` ([`PDCollection`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCollection)): The collection object. **Returns:** [`PDCollectionSchema`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCollectionSchema) The collection object. ### Structures (1) #### PDCollectionSchema ```cpp typedef struct CPDCollectionSchema* PDCollectionSchema ``` Header: `PDExpT.h:7088` An opaque pointer to a collection schema object. A `PDCollectionSchema` is ordered with the following considerations. The `PDCollectionSchema` has characteristics of both a collection of named fields and an array. Field names are guaranteed to be unique. Indexing is guaranteed to be 0-based, in ascending order, with no gaps. When repositioning a field by changing its index, the schema will be re-indexed as necessary to conform to this convention. If a field is assigned an out-of-bound index, the index is adjusted to be in bounds rather than raising an error. ## PDCrypt ### Functions (3) #### PDCryptAuthorizeFilterAccess ```cpp ASBool PDCryptAuthorizeFilterAccess(PDDoc doc, ASAtom handlerName, ASAtom filterName, ASBool bEncrypt) ``` Header: `PDProcs.h:10841` Gets authorization to encrypt or decrypt an embedded file, where that file's cryptographic filter is not the one used to open the document in which the file is embedded. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document containing the embedded file whose filter access is requested. - `handlerName` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The security handler containing the Authorize() callback procedure to run. - `filterName` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The ASAtom corresponding to the name of the security filter used by the embedded file. - `bEncrypt` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): When `true`, the access is required for an encryption operation. When `false`, it is a decryption operation. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the authorization succeeds, `false` otherwise. **Exceptions** - `pdErrNoCryptHandler`: is raised if there is no security handler registered for the document. **See also:** [`PDDocSetNewCryptFilterData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetNewCryptFilterData), [`PDDocSetNewCryptFilterMethod`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetNewCryptFilterMethod), [`PDDocSetNewDefaultFilters`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetNewDefaultFilters) #### PDRegisterCryptHandler ```cpp void PDRegisterCryptHandler(PDCryptHandler handler, const char *pdfName, const char *userName) ``` Header: `PDProcs.h:2594` Registers a new security handler with the Acrobat viewer. **Parameters** - `handler` ([`PDCryptHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCryptHandler)): A pointer to a structure that contains the security handler's callback functions. This structure must not be freed after calling PDRegisterCryptHandler(). - `pdfName` (`const char *`): The name of the security handler as it will appear in the PDF file. This name is also used by PDDocSetNewCryptHandler(). Storage for this name can be freed after PDRegisterCryptHandler() has been called. - `userName` (`const char *`): The name of the security handler as it will be shown in menus. This name can be localized into different languages. Storage for this name can be freed after PDRegisterCryptHandler() has been called. **Returns:** `void` **Exceptions** - `genErrBadParm`: is raised if the security handler's size field is incorrect. - `ErrSysPDSEdit`: is raised if either `pdfName` or `userName` are already in use by a registered security handler. - `genErrNoMemory`: is raised is memory is exhausted. Other exceptions may be raised as well. **See also:** [`PDDocGetNewCryptHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetNewCryptHandler), [`PDDocPermRequest`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocPermRequest), [`PDDocSetNewCryptHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetNewCryptHandler), [`PDDocSetNewCryptHandlerEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetNewCryptHandlerEx), [`PDRegisterCryptHandlerEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterCryptHandlerEx) #### PDRegisterCryptHandlerEx ```cpp void PDRegisterCryptHandlerEx(PDCryptHandler handler, const char *pdfName, const char *userName, void *clientData) ``` Header: `PDProcs.h:6103` Registers a new security handler with the Acrobat viewer. It is the same as PDRegisterCryptHandler() except that it accepts a client data parameter. **Parameters** - `handler` ([`PDCryptHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCryptHandler)): A pointer to a structure that contains the security handler's callback functions. This structure must not be freed after calling PDRegisterCryptHandlerEx(). - `pdfName` (`const char *`): The name of the security handler as it will appear in the PDF file. This name is also used by PDDocSetNewCryptHandler(). Storage for this name can be freed after PDRegisterCryptHandlerEx() has been called. - `userName` (`const char *`): The name of the security handler as it will be shown in menus. This name can be localized to different languages. Storage for this name can be freed after PDRegisterCryptHandlerEx() has been called. - `clientData` (`void *`): A pointer to user-supplied data to store with the handler. **Returns:** `void` **Exceptions** - `genErrBadParm`: is raised if the security handler's size field is incorrect. - `ErrSysPDSEdit`: is raised if either pdfName or userName are already in use by a registered security handler. - `genErrNoMemory`: is raised is memory is exhausted. **See also:** [`PDDocSetNewCryptHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetNewCryptHandler), [`PDDocPermRequest`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocPermRequest), [`PDRegisterCryptHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterCryptHandler) ### Typedefs (34) #### PDCryptAuthorizeExProc ```cpp typedef PDPermReqStatus(*) PDCryptAuthorizeExProc(PDDoc pdDoc, PDPermReqObj reqObj, PDPermReqOpr reqOpr, void *authData)(PDDoc pdDoc, PDPermReqObj reqObj, PDPermReqOpr reqOpr, void *authData) ``` Header: `PDExpT.h:4783` Replaces PDCryptAuthorizeProc. PDPerms are obsolete, but Acrobat still supports old security handlers. It is called whenever Acrobat needs to get authorization data and/or check permissions for operations. **See also:** [`PDCryptAuthorizeProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCryptAuthorizeProc), [`PDDocPermRequest`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocPermRequest) #### PDCryptAuthorizeProc ```cpp typedef PDPerms(*) PDCryptAuthorizeProc(PDDoc pdDoc, void *authData, PDPerms permWanted)(PDDoc pdDoc, void *authData, PDPerms permWanted) ``` Header: `PDExpT.h:4461` A callback for PDCryptHandler. It is called by PDDocAuthorize() when a user tries to set security for an encrypted document and by a PDAuthProc() when a user tries to open a file. It must decide, based on the contents of the authorization data structure, whether the user is permitted to open the file, and what permissions the user has for this file. The authorization data structure is available for making this decision. Alternate implementations may not require authorization data and may, for example, make authorization decisions based on data contained in the security data structure (use PDCryptNewSecurityDataProc()). This callback must not obtain the authorization data (for example, by displaying a user interface into which a user can type a password). Obtaining authorization data is handled by the security handler's PDCryptGetAuthDataProc(), which must be called before this callback. Instead, PDCryptAuthorizeProc() must work with whatever authorization data is passed to it. It is legitimate for this callback to be called with `NULL` authorization data; the Acrobat viewer's built-in `authProc` does this in order to support authorization methods that do not require authorization data. When this callback is invoked to determine whether a user is permitted to open a file, `permWanted` is set to `pdPermOpen`. In this case, the file's contents are not yet decrypted (since this callback is being asked to permit decryption), and some calls must be avoided. For example, a call that causes a page to be parsed results in an error, since the encrypted contents are parsed. In general, it is safe to obtain information about the presence or absence of things, or the number of things, and to examine any part of a document at the Cos level. **Parameters** - `pdDoc`: The document for which authorized permissions are being requested. - `authData`: Authorization data. Its format is security handler-specific; each handler can select its own authorization data format. - `permWanted`: The permissions being requested. It is either `pdPermOpen` (if the file is being opened) or `pdPermSecure` (if a request is being made to change the document's security settings).`authData`. For opening, the permissions returned usually should be `pdPermOpen` and some or all of `pdPermPrint`, `pdPermEdit`, and `pdPermCopy`. For setting security, permissions returned should be `pdPermAll`. However, if authorization fails, `0` should be returned. **See also:** [`PDCryptAuthorizeExProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCryptAuthorizeExProc), [`PDCryptAuthorizeFilterAccess`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCryptAuthorizeFilterAccess), [`PDDocAuthorize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocAuthorize), [`PDDocOpen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocOpen), [`PDDocOpenEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocOpenEx) #### PDCryptBatchAuthorizeProc ```cpp typedef PDPermReqStatus(*) PDCryptBatchAuthorizeProc(PDDoc pdDoc, PDPermReqObj reqObj, PDPermReqOpr reqOpr, void *authData)(PDDoc pdDoc, PDPermReqObj reqObj, PDPermReqOpr reqOpr, void *authData) ``` Header: `PDExpT.h:5011` A callback for PDCryptBatchHandler. It is called when a PDF file is opened. It is first called with `NULL` `authData` for the case without a user password. It is called again with authorization data provided for the security handler that matches the one used in the PDF file. **Note:** This function is called a batch operation and therefore should not display any user interface. During a batch operation, a file will first be opened with the `pdPermSecure` bit set. It will then be opened with the `pdPermOpen` bit set. #### PDCryptBatchFreeAuthDataProc ```cpp typedef void(*) PDCryptBatchFreeAuthDataProc(void *authData)(void *authData) ``` Header: `PDExpT.h:5023` A callback for PDCryptBatchHandler. If provided, it must be used to free `authData` acquired via BatchGetAuthData() or BatchNewAuthData(). If no BatchFreeAuthData() function is provided, a default one will be used which calls ASfree() on the `authData` if it is non-`NULL`. #### PDCryptBatchNewAuthDataProc ```cpp typedef void *(*) PDCryptBatchNewAuthDataProc(void)(void) ``` Header: `PDExpT.h:4989` A callback for PDCryptBatchHandler. It is different from the regular PDCryptHandler `NewAuthData` function. It creates and returns a `void*` which is the authorization data for the batch security handler. This data should be used to batch both open files and secure files. Therefore, make sure to provide password information for both the `pdPermOpen` and `pdPermSecure` cases. This data will be passed to the PDCryptBatchAuthorizeProc() callback and eventually to PDCryptBatchFreeAuthDataProc() to free the data. This authorization data is collected before any files are opened in the batch sequence. It is permitted to display a user interface at this point since the batch operation has not started yet. The data applies to all files, and therefore could represent one or more passwords which can be enumerated in the `BatchAuthorize` function which receives the batch authorization data. #### PDCryptBatchParamDescProc ```cpp typedef void(*) PDCryptBatchParamDescProc(const ASCab settings, ASCab paramDesc)(const ASCab settings, ASCab paramDesc) ``` Header: `PDExpT.h:4970` A callback for PDCryptBatchHandler. The developer should provide information about the current batch settings for the security handler. Batch settings are provided as a read-only ASCab that is passed to the function. A writable ASCab is also provided, which should be used to store parameter information about the security handler. The description information should be stored starting in the `paramDesc` ASCab using ASText objects starting with key `" 1"`. **Example key=" 1", value="Title: API Reference" (ASText object)** #### PDCryptBatchPostSequenceProc ```cpp typedef void(*) PDCryptBatchPostSequenceProc(ASCab settings)(ASCab settings) ``` Header: `PDExpT.h:5051` A callback for PDCryptBatchHandler. This function is called at the end of a batch sequence after all files have been processed. Any memory that was allocated in the BatchPreSequence() call should be cleaned up in this callback. #### PDCryptBatchPreSequenceProc ```cpp typedef ASBool(*) PDCryptBatchPreSequenceProc(ASCab settings)(ASCab settings) ``` Header: `PDExpT.h:5042` A callback for PDCryptBatchHandler. This function is called at the beginning of a batch sequence before any files have been opened. This allows a security handler to be called back with the ASCab of settings that were filled out by the BatchShowDialog() function, or by an ASCab that was read in from disk. Pointers of security information are not serialized to disk, and therefore a security information structure may need to be regenerated based on other security information in the ASCab. It is permitted for the BatchPreSequence() callback to put up a user interface asking the user for more information since the batch sequence has not started yet. If this function returns `false`, the viewer will assume that the command cannot be executed and will cancel the sequence. #### PDCryptBatchShowDialogProc ```cpp typedef ASBool(*) PDCryptBatchShowDialogProc(ASCab settings)(ASCab settings) ``` Header: `PDExpT.h:4955` A callback for PDCryptBatchHandler. This callback puts up a dialog box that allows a user to enter data that will be used to batch secure a series of files. The data is stored in an ASCab which is part of a batch sequence file. The actual security data, including password(s), should be stored as a pointer in the ASCab so that password information is not serialized to disk. Pointers are not serialized from ASCab objects, but ASText objects, ASInt32 objects, and ASBool objects are serialized. #### PDCryptBatchUpdateSecurityDataProc ```cpp typedef ASBool(*) PDCryptBatchUpdateSecurityDataProc(PDDoc pdDoc, ASCab settings, ASAtom *cryptHandler, void **secDataP)(PDDoc pdDoc, ASCab settings, ASAtom *cryptHandler, void **secDataP) ``` Header: `PDExpT.h:5069` A callback for PDCryptBatchHandler. This function should update the crypt handler's security data without bringing up a dialog. This data is provided by a PDCryptBatchShowDialogProc(). The current security data can be obtained by calling PDDocGetNewSecurityData(). **Note:** This function is called a batch operation and therefore should not display any user interface. #### PDCryptCanParseEncryptDictProc ```cpp typedef ASBool(*) PDCryptCanParseEncryptDictProc(PDDoc pdDoc, CosObj encryptDict)(PDDoc pdDoc, CosObj encryptDict) ``` Header: `PDExpT.h:4870` (Optional) This call is used to provide PDCrypt handler interoperability. When an encrypted document is being opened and the security handler specified in the encryption dictionary is not present, this callback is used to determine if one of the registered security handlers can be used to open the document. #### PDCryptDisplaySecurityDataProc ```cpp typedef ASBool(*) PDCryptDisplaySecurityDataProc(PDDoc pdDoc, ASAtom cryptHandler)(PDDoc pdDoc, ASAtom cryptHandler) ``` Header: `PDExpT.h:4850` Called when the security handler should bring up a document (security) information dialog box with the current settings. It also should return `true` when the user wants to change the settings. If this callback is not supplied, the default information dialog is displayed with PDPerms bits information (an Acrobat 4.x-equivalent dialog). #### PDCryptEncryptDocMetadata ```cpp typedef ASBool(*) PDCryptEncryptDocMetadata(PDDoc pdDoc)(PDDoc pdDoc) ``` Header: `PDExpT.h:4914` (Optional) A callback for PDCryptHandler. It determines whether a document's metadata will be encrypted. If this call is not implemented, the metadata is always encrypted. Note that documents with plain text metadata can be opened only by Acrobat versions 6.0 and later. #### PDCryptFillEncryptDictProc ```cpp typedef void(*) PDCryptFillEncryptDictProc(PDDoc pdDoc, CosObj encryptDict)(PDDoc pdDoc, CosObj encryptDict) ``` Header: `PDExpT.h:4673` A callback for PDCryptHandler. It is called when an encrypted document is saved. It fills the document's Encryption dictionary with whatever information the security handler wants to store in the document. Normally this callback is called after PDCryptUpdateSecurityDataProc(). The security data structure can be obtained with a call to PDDocGetNewSecurityData(), and `encryptDict` is filled based on this data. The sequencing of events that the viewer performs during creation of the encryptDict is as follows: • The viewer creates the `encryptDict`. • The viewer adds the Filter attribute to the dictionary. • The viewer calls this PDCryptFillEncryptDictProc() to allow the security handler to add its own attributes to the dictionary. • The viewer calls the PDCryptNewCryptDataExProc() (the PDCryptNewCryptDataProc() if unsuccessful) to get the algorithm version, key, and key length. • The viewer checks if the V attribute has been added to the dictionary and, if not, it sets V to the algorithm version. • The viewer sets the Length attribute if V is `2` or greater. • The viewer adds the encryptDict to the document. **See also:** [`PDDocSave`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSave) #### PDCryptFilterAuthorizeProc ```cpp typedef ASBool(*) PDCryptFilterAuthorizeProc(CosDoc dP, ASAtom filterName, CosObj encryptDict, ASBool bEncrypt, ASBool bUIAllowed)(CosDoc dP, ASAtom filterName, CosObj encryptDict, ASBool bEncrypt, ASBool bUIAllowed) ``` Header: `PDExpT.h:5129` (Optional) A callback for PDCryptFilterHandler. Acrobat's security mechanism calls this method to determine whether the user should have access to this filter. **See also:** [`PDCryptFilterGetDataProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCryptFilterGetDataProc), [`PDCryptFilterStreamProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCryptFilterStreamProc), [`PDCryptFilterStringProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCryptFilterStringProc), [`PDCryptAuthorizeFilterAccess`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCryptAuthorizeFilterAccess), [`PDDocSetNewCryptFilterMethod`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetNewCryptFilterMethod), [`PDDocSetNewDefaultFilters`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetNewDefaultFilters) #### PDCryptFilterGetDataProc ```cpp typedef ASInt32(*) PDCryptFilterGetDataProc(CosDoc dP, ASAtom filterName, char **key, ASBool bNewKey, ASBool bUIAllowed)(CosDoc dP, ASAtom filterName, char **key, ASBool bNewKey, ASBool bUIAllowed) ``` Header: `PDExpT.h:5152` (Optional) A callback for PDCryptFilterHandler. Acrobat's security mechanism calls this method to retrieve the encryption/decryption key for this filter. It is called only when the filter's encryption method is V2. **See also:** [`PDCryptFilterAuthorizeProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCryptFilterAuthorizeProc), [`PDCryptFilterStreamProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCryptFilterStreamProc), [`PDCryptFilterStringProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCryptFilterStringProc), [`PDDocSetNewCryptFilterData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetNewCryptFilterData), [`PDDocSetNewCryptFilterMethod`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetNewCryptFilterMethod), [`PDDocSetNewDefaultFilters`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetNewDefaultFilters) #### PDCryptFilterStreamProc ```cpp typedef void(*) PDCryptFilterStreamProc(CosDoc dP, ASAtom filterName, ASCryptStm stm, ASBool handOff, CosObj params, ASInt32 stmLength)(CosDoc dP, ASAtom filterName, ASCryptStm stm, ASBool handOff, CosObj params, ASInt32 stmLength) ``` Header: `PDExpT.h:5104` (Optional) A callback for PDCryptFilterHandler. Callbacks that conform to this prototype are called to encrypt or decrypt streams from a document. The first call to a procedure of this type must fill out an `ASCryptStmRec` structure with pointers to callback routines for various types of stream access; see `ASCryptStmProcs()`. **See also:** [`PDCryptFilterAuthorizeProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCryptFilterAuthorizeProc), [`PDCryptFilterGetDataProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCryptFilterGetDataProc), [`PDCryptFilterStringProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCryptFilterStringProc), [`PDDocSetNewCryptFilterData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetNewCryptFilterData), [`PDDocSetNewCryptFilterMethod`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetNewCryptFilterMethod), [`PDDocSetNewDefaultFilters`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetNewDefaultFilters) #### PDCryptFreeAuthDataProc ```cpp typedef void(*) PDCryptFreeAuthDataProc(PDDoc pdDoc, void *authData)(PDDoc pdDoc, void *authData) ``` Header: `PDExpT.h:4724` (Optional) A callback for PDCryptHandler. It is used to free authorization data acquired via PDCryptNewAuthDataProc(). If this callback is omitted, the viewer defaults to freeing the data using ASfree(). **See also:** [`PDCryptNewAuthDataProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCryptNewAuthDataProc), [`PDDocGetNewSecurityInfo`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetNewSecurityInfo) #### PDCryptFreeCryptDataProc ```cpp typedef void(*) PDCryptFreeCryptDataProc(PDDoc pdDoc, char *cryptData)(PDDoc pdDoc, char *cryptData) ``` Header: `PDExpT.h:4738` (Optional) A callback for PDCryptHandler. It is used to free authorization data acquired via PDCryptNewCryptDataProc(). If this callback is omitted, the viewer defaults to freeing the data using ASfree(). **See also:** [`PDCryptNewCryptDataProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCryptNewCryptDataProc), [`PDDocGetNewSecurityInfo`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetNewSecurityInfo) #### PDCryptFreeSecurityDataProc ```cpp typedef void(*) PDCryptFreeSecurityDataProc(PDDoc pdDoc, void *secData)(PDDoc pdDoc, void *secData) ``` Header: `PDExpT.h:4710` (Optional) A callback for PDCryptHandler. It is used to free security data acquired via PDCryptNewSecurityDataProc(). If this callback is omitted, the viewer defaults to freeing the data using ASfree(). **See also:** [`PDCryptNewSecurityDataProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCryptNewSecurityDataProc), [`PDDocGetNewSecurityInfo`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetNewSecurityInfo) #### PDCryptGetAuthDataExProc ```cpp typedef ASBool(*) PDCryptGetAuthDataExProc(PDDoc pdDoc, PDPermReqObj reqObj, PDPermReqOpr reqOpr, void **authDataP)(PDDoc pdDoc, PDPermReqObj reqObj, PDPermReqOpr reqOpr, void **authDataP) ``` Header: `PDExpT.h:4806` Replaces PDCryptGetAuthDataProc(). It is called whenever Acrobat needs to get authorization data and/or check permissions for operations. PDPerms are obsolete. Acrobat provides permission controls, but Acrobat still supports old security handlers. **See also:** [`PDCryptGetAuthDataProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCryptGetAuthDataProc) #### PDCryptGetAuthDataProc ```cpp typedef ASBool(*) PDCryptGetAuthDataProc(PDDoc pdDoc, PDPerms permWanted, void **authDataP)(PDDoc pdDoc, PDPerms permWanted, void **authDataP) ``` Header: `PDExpT.h:4515` A callback for PDCryptHandler. This callback is called from a PDAuthProc when a file is opened after PDCryptNewSecurityDataProc() is called. The callback must determine the user's authorization properties for the document by obtaining authorization data, such as a user interface log in or password entry. It populates an authorization data structure with this data. This callback may call the security handler's PDCryptNewAuthDataProc() to allocate the authorization data structure. The use of an authorization data structure is optional (an implementation may wish to contain authorization data within the security data structure). The authorization data structure is subsequently used by the security handler's PDCryptAuthorizeProc() to determine whether the user is authorized to open the file. A security handler can specify the standard password dialog box by using AVCryptGetPassword(). In this case, `authData` is a `char*`. **See also:** [`PDCryptGetAuthDataExProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCryptGetAuthDataExProc), [`PDCryptNewAuthDataProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCryptNewAuthDataProc), [`PDDocOpen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocOpen), [`PDDocOpenEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocOpenEx) #### PDCryptGetDocPermsProc ```cpp typedef void(*) PDCryptGetDocPermsProc(PDDoc pdDoc, ASBool perms[PDPermReqObjLast][PDPermReqOprLast], ASInt16 *version)(PDDoc pdDoc, ASBool perms[PDPermReqObjLast][PDPermReqOprLast], ASInt16 *version) ``` Header: `PDExpT.h:4899` A callback for PDCryptHandler. This function should extract and return information about the document permissions to display for the user: whether the user can print, edit, copy text and graphics, edit notes and do form fill in and signing. The permissions returned are logically AND-ed with the document permissions returned by any other permissions handlers, and displayed to the user. All crypt handlers should implement this call so that consolidated permissions can be displayed. To display your own crypt handler's permissions, implement PDCryptDisplaySecurityDataProc(). If this callback is absent, Acrobat assumes that all the operations on the document are allowed. **See also:** [`PDDocPermRequest`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocPermRequest) #### PDCryptGetInfoTextProc ```cpp typedef ASText(*) PDCryptGetInfoTextProc(PDDoc pdDoc, GCHTextType textType)(PDDoc pdDoc, GCHTextType textType) ``` Header: `PDExpT.h:4934` (Optional) A callback for PDCryptHandler. It provides information for display about document security settings. Value Description `kGCHTTipText` Text used for a security tool tip. It should be short. Its default is `"This document is secured."` `kGCHTMiniText` Text used for a security hover. It should be medium length. Its default is `"This document has been encrypted and may use..."` `kGCHTLargeText` Text use for Toast on Windows. It can have a longer length. There is no default. #### PDCryptGetSecurityInfoProc ```cpp typedef void(*) PDCryptGetSecurityInfoProc(PDDoc pdDoc, ASUns32 *secInfo)(PDDoc pdDoc, ASUns32 *secInfo) ``` Header: `PDExpT.h:4696` (Optional) A callback for PDCryptHandler. It is called by PDDocGetNewSecurityInfo(). It extracts the security information from the security data structure, and returns the security information. This function is also used after a Save As... to reset the permissions according to the current document. A default set of permissions is used if this callback is absent: `pdInfoCanPrint|pdInfoCanEdit|pdInfoCanCopy|pdInfoCanEditNotes` See PDPerms. **See also:** [`PDDocGetNewSecurityInfo`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetNewSecurityInfo) #### PDCryptNewAuthDataProc ```cpp typedef void *(*) PDCryptNewAuthDataProc(PDDoc pdDoc)(PDDoc pdDoc) ``` Header: `PDExpT.h:4478` (Optional) A callback for PDCryptHandler. It creates a new empty authorization data structure. This structure is subsequently filled by PDCryptGetAuthDataProc(), then passed to PDCryptAuthorizeProc() and eventually to ASfree(). This callback is not called by the Acrobat viewer, but a security handler may use it if it wishes. The Acrobat viewer's standard security handler does not use this method. **See also:** [`PDCryptFreeAuthDataProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCryptFreeAuthDataProc), [`PDCryptGetAuthDataProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCryptGetAuthDataProc) #### PDCryptNewCryptDataExProc ```cpp typedef void(*) PDCryptNewCryptDataExProc(PDDoc pdDoc, char **cryptData, ASInt32 *cryptDataLen, ASInt32 *cryptVersion)(PDDoc pdDoc, char **cryptData, ASInt32 *cryptDataLen, ASInt32 *cryptVersion) ``` Header: `PDExpT.h:4761` A callback for PDCryptHandler. It sets up the key to be passed to initialize the RC4 cipher for encryption and decryption of a PDF file. It is called when an encrypted document is opened or saved. The key is truncated when the length is greater than the viewer currently supports. Data is freed by PDCryptFreeCryptDataProc() if provided. Otherwise, ASfree() is used. **Parameters** - `pdDoc`: IN/OUT The document for which the key is set. - `cryptData`: IN/OUT (Filled by the callback) The key. `cryptData` must be allocated by ASmalloc() because the Acrobat viewer will free it using ASfree(). - `cryptDataLen`: IN/OUT (Filled by the callback) The number of bytes in `cryptData`. It cannot be greater than `5` bytes. - `cryptVersion`: IN/OUT The Cos crypt version, which is the version of the algorithm that is used to encrypt and decrypt document data. `cryptVersion` equal to `0` is treated as `cryptVersion` equal to `1` to maintain backward compatibility. **See also:** [`PDCryptFreeCryptDataProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCryptFreeCryptDataProc) #### PDCryptNewCryptDataProc ```cpp typedef void(*) PDCryptNewCryptDataProc(PDDoc pdDoc, char **cryptData, ASInt32 *cryptDataLen)(PDDoc pdDoc, char **cryptData, ASInt32 *cryptDataLen) ``` Header: `PDExpT.h:4635` A callback for PDCryptHandler. It sets up the key to be passed to initialize the RC4 cipher for encryption and decryption of a PDF file. It is called when an encrypted document is opened or saved. **See also:** [`PDCryptNewAuthDataProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCryptNewAuthDataProc) #### PDCryptNewSecurityDataFromOriginalDocProc ```cpp typedef ASBool(*) PDCryptNewSecurityDataFromOriginalDocProc(PDDoc pdDoc, CosObj encryptDict, PDDoc alreadyOpenedDoc, CosObj openedEncryptDict, void **authDataP)(PDDoc pdDoc, CosObj encryptDict, PDDoc alreadyOpenedDoc, CosObj openedEncryptDict, void **authDataP) ``` Header: `PDExpT.h:4834` Called when the application needs to open a rolled back portion of the original document. A *rolled back* document is the original portion of the document when it is digitally signed. This functionality is used for document modification detection. A rolled back document still requires authorization data which should be identical to the original document's. However, the `authDataP` structure is unique to each security handler; therefore, it cannot be duplicated by the application. This callback is intended for opening a rolled back document silently by asking the security handler to provide authorization data for it. The security handler should be able to duplicate the security data associated with the original document and supply for the rolled back document. The callee is expected to authorize subsequent callbacks, including Crypt Filters. If this callback is not provided, the security handler is asked for authorization data via a normal call such as PDCryptGetAuthDataExProc(). The side effect might include the security handler's prompting for a password for the rolled back document. #### PDCryptNewSecurityDataProc ```cpp typedef void *(*) PDCryptNewSecurityDataProc(PDDoc pdDoc, CosObj encryptDict)(PDDoc pdDoc, CosObj encryptDict) ``` Header: `PDExpT.h:4558` (Optional) A callback for PDCryptHandler. It creates and populates a new structure that contains whatever security-related information the security handler requires (for example, permissions, whether the file has owner and/or user passwords, owner and/or user passwords, or other data used internally by the security handler). If `encryptDict` is not `NULL`, the structure should be populated based on the `encryptDict` parameter's contents. This method is intended only to initialize the security data structure. This callback is called under two circumstances: • When a document is opened, it is called with encryptDict set to the document's Encryption dictionary. The handler should then populate the new security data structure with data that is obtained from the Encryption dictionary. • When the user chooses a new encryption method, it is called without an encryptDict. The handler should return a security data structure with default values. If a security handler does not have this callback, the document's `newSecurityData` field is set to `NULL`. If a file is to be saved, then PDCryptUpdateSecurityDataProc() is subsequently called to allow user interface modification of the contents. Security data is freed using PDCryptFreeSecurityDataProc(). If PDCryptFreeSecurityDataProc() is not defined, ASfree() is used. **See also:** [`PDCryptFreeSecurityDataProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCryptFreeSecurityDataProc) #### PDCryptReservedProc ```cpp typedef void *(*) PDCryptReservedProc(void)(void) ``` Header: `PDExpT.h:4856` (Optional) A callback for PDCryptHandler. It is used by the Acrobat WebBuy proprietary method of passing crypt data. #### PDCryptReservedProc2 ```cpp typedef void *(*) PDCryptReservedProc2(PDDoc pdDoc, ASCab settings)(PDDoc pdDoc, ASCab settings) ``` Header: `PDExpT.h:4939` (Optional) Used by Acrobat for Automated Permission Testing. #### PDCryptUpdateSecurityDataProc ```cpp typedef ASBool(*) PDCryptUpdateSecurityDataProc(PDDoc pdDoc, ASAtom *cryptHandler, void **secDataP)(PDDoc pdDoc, ASAtom *cryptHandler, void **secDataP) ``` Header: `PDExpT.h:4619` A callback for PDCryptHandler. It updates the security data structure that was created by PDCryptNewSecurityDataProc(). This structure can be obtained by calling PDDocGetNewSecurityData(). The security data structure of the previously saved file can be obtained with a call to PDDocGetSecurityData(). The security data structure should be updated to reflect the encryption parameters that will be used when saving the file (this information is usually obtained via dialogs). The encryption parameters are transferred to the Encrypt dictionary by a subsequent callback to PDCryptFillEncryptDictProc(). The security data should be allocated by ASmalloc() or a related function. Security data is freed using PDCryptFreeSecurityDataProc(). If PDCryptFreeSecurityDataProc() is not defined, ASfree() is used. The callback can also update the security handler itself. For example, the standard encryption handler switches to no encryption if no passwords or permissions are set in the security dialog box. Return ASAtomNull in `cryptHandler` if no encryption is used in the saved file. **See also:** [`PDCryptValidateSecurityDataProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCryptValidateSecurityDataProc), [`PDDocGetSecurityData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetSecurityData) #### PDCryptValidateSecurityDataProc ```cpp typedef void(*) PDCryptValidateSecurityDataProc(PDDoc pdDoc, void *secData)(PDDoc pdDoc, void *secData) ``` Header: `PDExpT.h:4582` (Optional) A callback for PDCryptHandler. It validates the security data structure, which specifies the user's permissions. This callback may modify the security data structure (for example, because the user is not authorized to change the security as they requested). A client may have called PDDocNewSecurityData() to obtain a new security data structure, then modified it, and then called PDDocSetNewSecurityData() to change the document security. This callback should be called before actually setting the document's security data. This callback is not called automatically by the Acrobat viewer. It must be called, if desired, by the security handler's PDCryptUpdateSecurityDataProc(). **See also:** [`PDCryptUpdateSecurityDataProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCryptUpdateSecurityDataProc), [`PDDocNewSecurityData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocNewSecurityData), [`PDDocSetNewSecurityData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetNewSecurityData) ### Structures (3) #### PDCryptBatchHandler ```cpp typedef struct _t_PDCryptBatchHandler* PDCryptBatchHandler ``` Header: `PDExpT.h:5288` #### PDCryptFilterHandler ```cpp typedef struct _t_PDCryptFilterHandler* PDCryptFilterHandler ``` Header: `PDExpT.h:5192` #### PDCryptHandler ```cpp typedef struct _t_PDCryptHandler* PDCryptHandler ``` Header: `PDExpT.h:5519` ### Definitions (1) #### PDCryptFilterStringProc Header: `PDExpT.h:5155` Value: `CosCryptStringProc` ## PDDoc ### Functions (121) #### PDDocAcquire ```cpp void PDDocAcquire(PDDoc doc) ``` Header: `PDProcs.h:1394` Increments a document's reference count. The document will not be closed until the reference count is zero, or the application terminates. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The document whose reference count is incremented. **Returns:** `void` **See also:** [`PDDocRelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocRelease) #### PDDocAcquirePage ```cpp PDPage PDDocAcquirePage(PDDoc doc, ASInt32 pageNum) ``` Header: `PDProcs.h:1565` 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. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document containing the page to acquire. - `pageNum` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The page number of the page to acquire. The first page is `0`. **Returns:** [`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage) The acquired page. **Exceptions** - `genErrBadParm` **See also:** `CSmartPDPage`, [`PDPageRelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageRelease) #### PDDocAddJobID ```cpp void PDDocAddJobID(PDDoc doc, ASInt32 jobId) ``` Header: `PDProcs.h:12839` Adds a print job identifier, or JobId, from the print job to the PDDoc's list of associated jobIds. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document whose jobId is being set. - `jobId` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The job Id being added to the document's list of job ids. **Returns:** `void` #### PDDocAddThread ```cpp void PDDocAddThread(PDDoc doc, ASInt32 addAfterIndex, PDThread thread) ``` Header: `PDProcs.h:1865` Adds an article thread to a document after the specified thread index. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): 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` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN/OUT The index of the thread after which `thread` is added. - `thread` ([`PDThread`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThread)): IN/OUT The thread to add. @notify PDDocDidAddThread **Returns:** `void` **See also:** [`PDThreadNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThreadNew), [`PDThreadFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThreadFromCosObj), [`PDDocRemoveThread`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocRemoveThread) #### PDDocAddWatermarkFromPDPage ```cpp void PDDocAddWatermarkFromPDPage(PDDoc pdDoc, PDPage pdPage, PDDocAddWatermarkParamsRec *pParams) ``` Header: `PDProcs.h:11313` Adds a PDPage as a watermark to a page range in the given document. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document onto which the watermark will be added. - `pdPage` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page to be added as a watermark. - `pParams` (`PDDocAddWatermarkParamsRec *`): Structure specifying how the watermark should be added to the document. **Returns:** `void` #### PDDocAddWatermarkFromText ```cpp void PDDocAddWatermarkFromText(PDDoc pdDoc, PDDocWatermarkTextParamsRec *pTextParams, PDDocAddWatermarkParamsRec *pParams) ``` Header: `PDProcs.h:11321` Adds a text-based watermark to a page range in the given document. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document onto which the watermark will be added. - `pTextParams` (`PDDocWatermarkTextParamsRec *`): Structure describing the text-based watermark to be added. - `pParams` (`PDDocAddWatermarkParamsRec *`): Structure specifying how the watermark should be added to the document. **Returns:** `void` #### PDDocApplyRedactions ```cpp ASBool PDDocApplyRedactions(PDDoc pdDoc, PDApplyRedactionParams applyParams) ``` Header: `PDProcs.h:11937` Applies a set of redaction marks to the document, permanently removing the affected document content and the marks themselves. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The document to which the redaction marks should be applied. - `applyParams` (`PDApplyRedactionParams`): 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:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the document's content was changed, `false` otherwise. **Exceptions** - `pdErrBadAnnotation`: is raised if any specified redaction marks are invalid **See also:** [`PDDocCreateRedaction`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateRedaction), [`PDRedactionGetProps`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRedactionGetProps), [`PDRedactionSetProps`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRedactionSetProps) #### PDDocAuthorize ```cpp PDPerms PDDocAuthorize(PDDoc pdDoc, PDPerms permsWanted, void *authData) ``` Header: `PDProcs.h:2433` 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. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document for which new permissions are requested. - `permsWanted` ([`PDPerms`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPerms)): The new permissions being requested. It must be an `OR` of the PDPerms values. - `authData` (`void *`): A pointer to data to pass to the PDCryptAuthorizeProc() callback of the document's security handler. For the Acrobat viewer's built-in security handler, `authData` is a `char*` containing the password.`OR` of the previous value of the document's permissions field, and the permissions granted by the PDCryptAuthorizeProc() callback of the document's security handler. The result will be an `OR` of the PDPerms values. **Returns:** [`PDPerms`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPerms) **Exceptions** - `pdErrNeedCryptHandler`: is raised if no security handler is associated with `pdDoc`. It also raises whatever exceptions are raised by the security handler's PDCryptAuthorizeProc() callback. **See also:** [`PDDocGetNewCryptHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetNewCryptHandler), `PDDocGetPermissions (obsolete)`, [`PDDocPermRequest`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocPermRequest), [`PDDocSetNewCryptHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetNewCryptHandler), [`PDDocSetNewCryptHandlerEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetNewCryptHandlerEx), [`PDRegisterCryptHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterCryptHandler), [`PDRegisterCryptHandlerEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterCryptHandlerEx) #### PDDocClearErrors ```cpp void PDDocClearErrors(PDDoc doc) ``` Header: `PDProcs.h:12732` Clears all the non-fatal errors encountered since the document was opened, or `PDDocClearErrors` was called. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document in which the non-fatal errors have occurred. **Returns:** `void` #### PDDocClearFlags ```cpp void PDDocClearFlags(PDDoc doc, ASInt32 flags) ``` Header: `PDProcs.h:5435` 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. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The document whose flags are cleared. - `flags` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN/OUT The flags to clear. It must be an `OR` of the PDDocFlags values. **Returns:** `void` **See also:** [`PDDocSave`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSave), [`PDDocClose`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocClose), [`PDDocGetFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetFlags), [`PDDocSetFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetFlags) #### PDDocClose ```cpp void PDDocClose(PDDoc doc) ``` Header: `PDProcs.h:1383` 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(). **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document to close. **Returns:** `void` **Exceptions** - `pdErrUnableToCloseDueToRefs`: 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). - `genErrBadUnlock`: is raised if the document's open count is less than one. **See also:** [`PDDocSave`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSave), [`PDDocOpen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocOpen), [`PDDocCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreate), [`PDDocClearFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocClearFlags), [`PDDocSetFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetFlags) #### PDDocCopyToFile ```cpp void PDDocCopyToFile(PDDoc pdDoc, PDDocCopyParams params) ``` Header: `PDProcs.h:7821` 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. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document to copy. - `params` (`PDDocCopyParams`): A structure that defines how the PDF file is copied. **Returns:** `void` **Exceptions** - `genErrBadParm`: is raised if an invalid argument is passed in params. - `pdErrAlreadyOpen`: is raised if the target and source files are the same. - `fileErrDiskFull`: is raised if there is no space for the copy. - `pdErrCancelSave`: is raised if the save was canceled (`cancelProc` in `params` returned `true`). - `pdErrUnableToRead`: is raised if a read error occurred on the source. - `pdErrUnableToWrite`: is raised if a write error occurred on the destination. #### PDDocCreate ```cpp PDDoc PDDocCreate(void) ``` Header: `PDProcs.h:1283` 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(). **Parameters** - (unnamed) (`void`) **Returns:** [`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc) The newly created document. **See also:** [`PDDocClose`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocClose), [`PDDocOpen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocOpen), [`PDDocSave`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSave), [`PDDocCreatePage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreatePage), [`PDDocInsertPages`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocInsertPages) #### PDDocCreateNameTree ```cpp PDNameTree PDDocCreateNameTree(PDDoc thePDDoc, ASAtom theTree) ``` Header: `PDProcs.h:7081` Retrieves the name tree inside the Names dictionary with the specified key name, or creates it if it does not exist. **Parameters** - `thePDDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document in which the name tree is created. - `theTree` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The name of the name tree to create. A string can be converted to an ASAtom using ASAtomFromString(). **Returns:** [`PDNameTree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTree) 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(). **See also:** [`PDNameTreeIsValid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTreeIsValid), [`PDDocGetNameTree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetNameTree), [`PDDocRemoveNameTree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocRemoveNameTree) #### PDDocCreatePDCollection ```cpp PDCollection PDDocCreatePDCollection(PDDoc pdDoc) ``` Header: `PDProcs.h:12329` Creates a collection in a document. It replaces any existing collection. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document that will host the new collection. **Returns:** [`PDCollection`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCollection) The new collection object. #### PDDocCreatePage ```cpp PDPage PDDocCreatePage(PDDoc doc, ASInt32 afterPageNum, ASFixedRect mediaBox) ``` Header: `PDProcs.h:1590` 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. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document in which the page is created. - `afterPageNum` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): 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` (`ASFixedRect`): A rectangle specifying the page's media box, specified in user space coordinates. **Returns:** [`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage) The newly created page. @notify PDDocWillInsertPages @notify PDDocDidInsertPages @notify PDDocDidChangePages @notify PDDocDidChangeThumbs **See also:** [`PDPageRelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageRelease), [`PDDocDeletePages`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocDeletePages), [`PDDocInsertPages`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocInsertPages), [`PDDocReplacePages`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocReplacePages) #### PDDocCreateRedaction ```cpp PDAnnot PDDocCreateRedaction(PDDoc pdDoc, PDRedactParams redactionProps) ``` Header: `PDProcs.h:11952` 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. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The document for which the new redaction mark should be created. - `redactionProps` (`PDRedactParams`): IN A set of properties to be used for the new redaction mark. **Returns:** [`PDAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnot) The new annotation representing the redaction mark. **Exceptions** - `genErrBadParm`: is raised if `redactionProps` is `NULL` or if contains an invalid page number or an empty list of quads. **See also:** [`PDDocApplyRedactions`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocApplyRedactions), [`PDRedactionGetProps`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRedactionGetProps), [`PDRedactionSetProps`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRedactionSetProps) #### PDDocCreateTextSelect ```cpp PDTextSelect PDDocCreateTextSelect(PDDoc doc, ASInt32 pageNum, ASFixedRect *boundingRect) ``` Header: `PDProcs.h:2277` 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`. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document in which a text selection is created. - `pageNum` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The page number on which the text selection is created. - `boundingRect` (`ASFixedRect *`): A pointer to a rectangle specifying the text selection's bounding rectangle, specified in user space coordinates. **Returns:** [`PDTextSelect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelect) The newly created text selection. **See also:** [`PDTextSelectDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectDestroy), `AVDocSetSelection`, [`PDTextSelectEnumQuads`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectEnumQuads), [`PDTextSelectEnumText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectEnumText), [`PDWordCreateTextSelect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordCreateTextSelect) #### PDDocCreateTextSelectUCS ```cpp PDTextSelect PDDocCreateTextSelectUCS(PDDoc doc, ASInt32 pageNum, ASFixedRect *fxBoundingRectP) ``` Header: `PDProcs.h:12898` 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`. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document in which a text selection is created. - `pageNum` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The page number on which the text selection is created. - `fxBoundingRectP` (`ASFixedRect *`) **Returns:** [`PDTextSelect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelect) The newly created text selection. **See also:** [`PDTextSelectDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectDestroy), `AVDocSetSelection`, [`PDTextSelectEnumQuads`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectEnumQuads), [`PDTextSelectEnumText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectEnumText), [`PDWordCreateTextSelect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordCreateTextSelect) #### PDDocCreateThumbs ```cpp 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) ``` Header: `PDProcs.h:2005` 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. • `sizeof(ASUns8)` • `3`, where the `3` arises because an RGB color space has three color components. @notify PDDocDidChangeThumbs **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The document for which thumbnail images are created. - `firstPage` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN/OUT The page number of the first page for which thumbnails are created. The first page is `0`. - `lastPage` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): 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` ([`PDThumbCreationServer`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThumbCreationServer)): 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` (`void *`): IN/OUT User-supplied data to pass to the thumbnail creation server. - `colorSpace` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): 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` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN/OUT The number of bits per color component in the thumbnail image's data. `8` is the only valid value. - `hiVal` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): 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` (`char *`): 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)`: - `progMon` ([`ProgressMonitor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ProgressMonitor)): 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` (`void *`): IN/OUT A user-supplied data to pass to `progMon` each time it is called. It should be `NULL` if `progMon` is `NULL`. - `cancelProc` ([`CancelProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#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` (`void *`): IN/OUT A user-supplied data to pass to `cancelProc` each time it is called. It should be `NULL` if `cancelProc` is `NULL`. **Returns:** `void` **See also:** [`PDDocDeleteThumbs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocDeleteThumbs) #### PDDocCreateWordFinder ```cpp PDWordFinder PDDocCreateWordFinder(PDDoc doc, ASUns16 *outEncInfo, char **outEncVec, char **ligatureTbl, ASInt16 algVersion, ASUns16 rdFlags, void *clientData) ``` Header: `PDProcs.h:2199` 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](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](https://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5014.CIDFont_Spec.pdf) [https://www.adobe.com/jp/print/postscript/pdfs/PLRM.pdf](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. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document on which the word finder is used. - `outEncInfo` ([`ASUns16 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASUns16)): 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` (`char **`): 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*. - `ligatureTbl` (`char **`): 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` ([`ASInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16)): The version of the word-finding algorithm to use (see PDExpT.h), as follows (pass `0` if your client does not care): Version Description `WF_LATEST_VERSION` To obtain the latest available version. `WF_VERSION_2` Version used for Acrobat 3.x, 4.x. `WF_VERSION_3` Available in Acrobat 5.0 without accessibility enabled. Includes some improved word-piecing algorithms. `WF_VERSION_4` For Acrobat 5.0 with accessibility enabled. Includes advanced word-ordering algorithms in addition to improved word-piecing algorithms. **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). GlyphNames CharacterTypeCodes WordFinderSortOrderFlags - `rdFlags` ([`ASUns16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASUns16)): 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` (`void *`): A pointer to user-supplied data to pass to the newly created word finder. **Returns:** [`PDWordFinder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinder) The newly created word finder. **See also:** [`PDDocCreateWordFinderUCS`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateWordFinderUCS), [`PDWordFinderEnumWords`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinderEnumWords), [`PDWordFinderAcquireWordList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinderAcquireWordList), [`PDWordFinderDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinderDestroy), [`PDWordFilterWord`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFilterWord) #### PDDocCreateWordFinderEx ```cpp PDWordFinder PDDocCreateWordFinderEx(PDDoc doc, ASInt16 algVersion, ASBool outUnicode, PDWordFinderConfig wbConfig) ``` Header: `PDProcs.h:8412` 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(). Annotation Use WF_LATEST_VERSION To obtain latest available version. WF_VERSION_2 Version used for Acrobat 3.x, 4.x. WF_VERSION_3 Available in Acrobat 5.0 and 6.0 without Tagged PDF support. WF_VERSION_4 For Acrobat 5.0 and 6.0 with Tagged PDF support. **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). **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document on which the word finder is used. - `algVersion` ([`ASInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16)): The version of the word-finding algorithm to use (see `PDExpT.h`), as follows (pass `0` if your client does not care): - `outUnicode` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): 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` (`PDWordFinderConfig`): 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:** [`PDWordFinder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinder) The newly created word finder object. **See also:** [`PDDocCreateWordFinder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateWordFinder), [`PDDocCreateWordFinderUCS`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateWordFinderUCS), [`PDWordFinderEnumWords`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinderEnumWords), [`PDWordFinderAcquireWordList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinderAcquireWordList), [`PDWordFinderDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinderDestroy), [`PDWordFilterWord`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFilterWord), [`PDWordGetCharOffsetEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordGetCharOffsetEx) #### PDDocCreateWordFinderUCS ```cpp PDWordFinder PDDocCreateWordFinderUCS(PDDoc doc, ASInt16 algVersion, ASUns16 rdFlags, void *clientData) ``` Header: `PDProcs.h:6621` 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](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](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. WordFinderSortOrderFlags **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document on which the word finder is used. - `algVersion` ([`ASInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16)): 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` ([`ASUns16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASUns16)): 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` (`void *`): A pointer to user-supplied data to pass to the newly created word finder. **Returns:** [`PDWordFinder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinder) The newly created word finder. **See also:** [`PDDocCreateWordFinder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateWordFinder), [`PDWordFinderEnumWords`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinderEnumWords), [`PDWordFinderAcquireWordList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinderAcquireWordList), [`PDWordFinderDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinderDestroy), [`PDWordFilterWord`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFilterWord) #### PDDocDeleteCollection ```cpp void PDDocDeleteCollection(PDDoc pdDoc) ``` Header: `PDProcs.h:12334` Removes a collection dictionary from a document. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document whose collection dictionary is to be removed. **Returns:** `void` #### PDDocDeletePages ```cpp void PDDocDeletePages(PDDoc doc, ASInt32 firstPage, ASInt32 lastPage, ProgressMonitor progMon, void *progMonClientData) ``` Header: `PDProcs.h:1615` Deletes the specified pages. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document from which pages are deleted. - `firstPage` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The page number of the first page to delete. The first page is `0`. - `lastPage` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The page number of the last page to delete. - `progMon` ([`ProgressMonitor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ProgressMonitor)): A progress monitor. Use AVAppGetDocProgressMonitor() to obtain the default progress monitor. `NULL` may be passed, in which case no progress monitor is used. - `progMonClientData` (`void *`): A pointer to user-supplied data passed to `progMon` each time it is called. It should be `NULL` if progMon is `NULL`. @notify PDDocWillChangePages @notify PDDocWillDeletePages @notify PDDocDidDeletePages @notify PDDocDidChangePages **Returns:** `void` **See also:** [`PDDocInsertPages`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocInsertPages), [`PDDocReplacePages`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocReplacePages), [`PDDocMovePage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocMovePage) #### PDDocDeleteThumbs ```cpp void PDDocDeleteThumbs(PDDoc doc, ASInt32 firstPage, ASInt32 lastPage, ProgressMonitor progMon, void *progMonClientData) ``` Header: `PDProcs.h:2028` Deletes thumbnail images for a range of pages in a document. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The document from which thumbnail images are deleted. - `firstPage` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN/OUT The page number of the first page in `doc` whose thumbnail image is deleted. The first page is `0`. - `lastPage` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN/OUT The page number of the last page in `doc` whose thumbnail image is deleted. - `progMon` ([`ProgressMonitor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ProgressMonitor)): IN/OUT A monitor to call to display thumbnail deletion progress. Use AVAppGetDocProgressMonitor() to obtain the standard progress monitor to pass for this parameter. `NULL` may be passed, in which case no progress monitor is used. - `progMonClientData` (`void *`): IN/OUT A pointer to user-supplied data to pass to `progMon`. It should be `NULL` if `progMon` is `NULL`. @notify PDDocDidChangeThumbs **Returns:** `void` **See also:** [`PDDocCreateThumbs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateThumbs) #### PDDocEnumFonts ```cpp void PDDocEnumFonts(PDDoc doc, ASInt32 firstPage, ASInt32 lastPage, PDFontEnumProc eproc, void *clientData, ProgressMonitor progMon, void *progMonClientData) ``` Header: `PDProcs.h:1907` Enumerates all the fonts in the specified page range. This may take a considerable amount of time for a large page range. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document whose fonts are enumerated. - `firstPage` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The page number of the first page for which fonts are enumerated. The first page is `0`. - `lastPage` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The page number of the last page for which fonts are enumerated. - `eproc` ([`PDFontEnumProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontEnumProc)): A user-supplied callback to call for each font. Enumeration terminates if `eproc` returns `false`. - `clientData` (`void *`): A pointer to user-supplied data to pass to `eproc` each time it is called. - `progMon` ([`ProgressMonitor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ProgressMonitor)): A progress monitor. Use AVAppGetDocProgressMonitor() to obtain the standard progress monitor. `NULL` may be passed, in which case no progress monitor is used. - `progMonClientData` (`void *`): A pointer to user-supplied data to pass to `progMon` each time it is called. It should be `NULL` if `progMon` is `NULL`. **Returns:** `void` **See also:** [`PDDocEnumLoadedFonts`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocEnumLoadedFonts), [`PDFontEnumCharProcs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontEnumCharProcs) #### PDDocEnumLoadedFonts ```cpp void PDDocEnumLoadedFonts(PDDoc doc, PDFontEnumProc proc, void *clientData) ``` Header: `PDProcs.h:1926` 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. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The document whose loaded fonts are enumerated. - `proc` ([`PDFontEnumProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontEnumProc)): IN/OUT A user-supplied callback to call for each loaded font. Enumeration terminates if `proc` returns `false`. - `clientData` (`void *`): IN/OUT A pointer to user-supplied data to pass to `proc` each time it is called. **Returns:** `void` **See also:** [`PDDocEnumFonts`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocEnumFonts), [`PDFontEnumCharProcs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontEnumCharProcs) #### PDDocEnumOCConfigs ```cpp void PDDocEnumOCConfigs(PDDoc pdDoc, PDOCConfigEnumProc enumProc, void *clientData) ``` Header: `PDProcs.h:10305` 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. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document whose configurations are enumerated. - `enumProc` ([`PDOCConfigEnumProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfigEnumProc)): A user-supplied callback to call for each configuration. Enumeration terminates if `enumProc` returns `false`. - `clientData` (`void *`): A pointer to user-supplied data to pass to `proc` each time it is called. **Returns:** `void` **See also:** [`PDDocGetOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetOCConfig), [`PDDocEnumOCGs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocEnumOCGs) #### PDDocEnumOCGs ```cpp void PDDocEnumOCGs(PDDoc pdDoc, PDOCGEnumProc enumProc, void *clientData) ``` Header: `PDProcs.h:9195` 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. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document whose groups are enumerated. - `enumProc` ([`PDOCGEnumProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGEnumProc)): A user-supplied callback to call for each group. Enumeration terminates if `enumProc` returns `false`. - `clientData` (`void *`): A pointer to user-supplied data to pass to `enumProc` each time it is called. **Returns:** `void` **See also:** [`PDDocGetOCGs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetOCGs), [`PDDocEnumOCConfigs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocEnumOCConfigs), [`PDPageEnumOCGs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageEnumOCGs) #### PDDocEnumResources ```cpp void PDDocEnumResources(PDDoc pdDoc, ASInt32 startPage, ASInt32 endPage, ASAtom resourceType, CosObjEnumProc enumProc, void *clientData) ``` Header: `PDProcs.h:6783` 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. You can find this document on the web store of the International Standards Organization (ISO). Pass ASAtomNull to enumerate all resource types. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The document whose resources are enumerated. - `startPage` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN/OUT The first page whose resources are enumerated. The first page in a document is `0`. - `endPage` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN/OUT The last page whose resources are enumerated. - `resourceType` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): 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. - `enumProc` ([`CosObjEnumProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjEnumProc)): 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` (`void *`): IN/OUT User-supplied data to pass to `enumProc` each time it is called. **Returns:** `void` **Exceptions** - `genErrBadParm` - `pdErrOpNotPermitted` **See also:** [`PDDocEnumFonts`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocEnumFonts), [`PDEEnumElements`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEEnumElements), [`PDELogDump`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDELogDump), [`PDEObjectDump`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEObjectDump) #### PDDocExportNotes ```cpp CosDoc PDDocExportNotes(PDDoc doc, ASFileSys unused1, ASPathName unused2, void *unused3, void *unused4, PDDocWillExportAnnotCallback exportFilter, ASInt32 *numNotesP) ``` Header: `PDProcs.h:6840` Creates a document containing empty pages plus text annotations (notes) from `sourceDoc`. It does not create a new document if `sourceDoc` contains no notes. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document from which notes are exported. - `unused1` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): Currently unused. - `unused2` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): Currently unused. - `unused3` (`void *`): Currently unused. - `unused4` (`void *`): Currently unused. - `exportFilter` ([`PDDocWillExportAnnotCallback`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocWillExportAnnotCallback)): A user-supplied routine that selects which notes to export. - `numNotesP` ([`ASInt32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): If non-`NULL`, the number of notes exported. **Returns:** [`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc) The CosDoc of the document created to hold the exported notes. @notify PDDocWillExportAnnots @notify PDDocDidExportAnnots **See also:** [`PDDocImportCosDocNotes`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocImportCosDocNotes), [`PDDocImportNotes`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocImportNotes), [`PDDocExportSomeNotes`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocExportSomeNotes) #### PDDocExportSomeNotes ```cpp CosDoc PDDocExportSomeNotes(PDDoc doc, ASFileSys unused1, ASPathName unused2, void *unused3, void *unused4, PDDocWillExportAnnotCallback exportFilter, PDAnnotArray pdanArray, ASInt32 *numNotesP) ``` Header: `PDProcs.h:8136` 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. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document from which notes are exported. - `unused1` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): Currently unused. - `unused2` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): Currently unused. - `unused3` (`void *`): Currently unused. - `unused4` (`void *`): Currently unused. - `exportFilter` ([`PDDocWillExportAnnotCallback`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocWillExportAnnotCallback)): A user-supplied routine that selects which notes to export. - `pdanArray` (`PDAnnotArray`): An array of `PDAnnotArrayRec` objects; the number of items in the arrray is the number of pages in `doc`. - `numNotesP` ([`ASInt32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): (Filled by the method) If non-`NULL`, the number of notes exported. **Returns:** [`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc) The CosDoc of the document created to hold the exported notes. @notify PDDocWillExportAnnots @notify PDDocDidExportAnnots **See also:** `PDDocGetXAPMetadata`, [`PDDocImportNotes`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocImportNotes), [`PDDocExportNotes`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocExportNotes) #### PDDocFindPageNumForLabel ```cpp ASInt32 PDDocFindPageNumForLabel(PDDoc pdDoc, const char *labelStr, ASInt32 labelLen) ``` Header: `PDProcs.h:7387` Superseded by PDDocFindPageNumForLabelEx() in Acrobat 6.0. Finds the first page in the document with a specified label. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document to search for the page named in `labelStr`. - `labelStr` (`const char *`): The label of the page to find. - `labelLen` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The length of `labelStr`. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The page number of the first page with the specified label, or `-1` if no such page exists. **See also:** [`PDDocGetLabelForPageNum`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetLabelForPageNum), [`PDDocGetPageLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetPageLabel), [`PDDocRemovePageLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocRemovePageLabel), [`PDDocSetPageLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetPageLabel), [`PDPageLabelNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageLabelNew) #### PDDocFindPageNumForLabelEx ```cpp ASInt32 PDDocFindPageNumForLabelEx(PDDoc pdDoc, ASConstText labelText) ``` Header: `PDProcs.h:11099` Supersedes PDDocFindPageNumForLabel in Acrobat 6.0. Finds the first page in the document with a specified label. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document to search for the page named in `labelStr`. - `labelText` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): The label of the page to find. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The page number of the first page with the specified label, or `-1` if no such page exists. **See also:** [`PDDocGetLabelForPageNumEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetLabelForPageNumEx), [`PDDocGetPageLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetPageLabel), [`PDDocRemovePageLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocRemovePageLabel), [`PDDocSetPageLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetPageLabel), [`PDPageLabelNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageLabelNew) #### PDDocFlattenOC ```cpp ASBool PDDocFlattenOC(PDDoc pdDoc, PDOCContext context) ``` Header: `PDProcs.h:10491` 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. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document to be modified. - `context` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The optional-content context in which content is checked for visibility. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the operation is successful, `false` otherwise. **See also:** [`PDPageFlattenOC`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageFlattenOC), [`PDEContentFlattenOC`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentFlattenOC) #### PDDocFromCosDoc ```cpp PDDoc PDDocFromCosDoc(CosDoc cosDoc) ``` Header: `PDProcs.h:6743` Gets the PDDoc associated with a CosDoc. **Parameters** - `cosDoc` ([`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc)): The Cos-level document object for which a PDDoc is obtained. This object represents the PDF. **Returns:** [`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc) The PDDoc associated with cosDoc. **Exceptions** - `genErrBadParm`: is raised if the CosDoc is not valid. - `pdErrNoPDDocForCosDoc`: is raised if there is no PDDoc associated with this CosDoc. **See also:** `AVDocGetPDDoc`, [`PDPageGetDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetDoc), [`PDDocGetCosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetCosDoc) #### PDDocGetAdobePDFVersion ```cpp AdobePDFVersion PDDocGetAdobePDFVersion(PDDoc doc) ``` Header: `PDProcs.h:12805` PDDocGetAdobePDFVersion() returns the current version of the document in the AdobePDFVersion define in CosExp.T **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The document whose version is obtained. **Returns:** [`AdobePDFVersion`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#AdobePDFVersion) current version of document. #### PDDocGetBookmarkRoot ```cpp PDBookmark PDDocGetBookmarkRoot(PDDoc pdDoc) ``` Header: `PDProcs.h:1535` 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). **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT Document whose root bookmark is obtained. **Returns:** [`PDBookmark`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBookmark) The document's root bookmark. #### PDDocGetCosDoc ```cpp CosDoc PDDocGetCosDoc(PDDoc doc) ``` Header: `PDProcs.h:1467` Gets a document's Cos-level document object. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document whose CosDoc is obtained. **Returns:** [`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc) The document's CosDoc. **See also:** [`CosObjGetDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjGetDoc) #### PDDocGetCryptHandler ```cpp ASAtom PDDocGetCryptHandler(PDDoc doc) ``` Header: `PDProcs.h:11360` Gets the specified document's current security handler (that is, the security handler that was used to open the document). **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document whose new security handler is obtained. **Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom) 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. **See also:** [`PDDocPermRequest`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocPermRequest), [`PDDocGetSecurityData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetSecurityData), [`PDDocSetNewCryptHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetNewCryptHandler), [`PDDocSetNewCryptHandlerEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetNewCryptHandlerEx), [`PDRegisterCryptHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterCryptHandler), [`PDRegisterCryptHandlerEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterCryptHandlerEx) #### PDDocGetCryptHandlerClientData ```cpp void * PDDocGetCryptHandlerClientData(PDDoc pdDoc) ``` Header: `PDProcs.h:6117` Gets the client data for the encryption handler associated with the PDDoc. This is the client data provided as a parameter in PDRegisterCryptHandlerEx(). **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document whose encryption handler client data is obtained. **Returns:** `void *` 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. **See also:** [`PDRegisterCryptHandlerEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterCryptHandlerEx) #### PDDocGetCryptRevision ```cpp ASInt32 PDDocGetCryptRevision(PDDoc pdDoc) ``` Header: `PDProcs.h:12725` 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. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The Crypt Revision retreived from the Security handler or encrypt dict or 0 if not found or not encrypted #### PDDocGetCryptVersion ```cpp ASInt32 PDDocGetCryptVersion(PDDoc pdDoc) ``` Header: `PDProcs.h:12717` 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. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The Crypt Version retreived from the Security handler or encrypt dict or 0 if not found or not encrypted #### PDDocGetFile ```cpp ASFile PDDocGetFile(PDDoc doc) ``` Header: `PDProcs.h:1475` Gets the file object for a document. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document whose ASFile is obtained. **Returns:** [`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile) The document's ASFile. #### PDDocGetFlags ```cpp ASInt32 PDDocGetFlags(PDDoc doc) ``` Header: `PDProcs.h:1418` Gets information about the document's file and its state. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The document whose flags are obtained. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) Flags field, containing an `OR` of the PDDocFlags values. **See also:** [`PDDocSetFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetFlags), [`PDDocClearFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocClearFlags) #### PDDocGetFullScreen ```cpp ASBool PDDocGetFullScreen(PDDoc pdDoc) ``` Header: `PDProcs.h:6129` Tests whether the document will open in full-screen mode. This provides an alternative to calling PDDocGetPageMode() to test for PDFullScreen. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document to test. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the PDDoc is in full-screen mode, `false` otherwise. **See also:** [`PDDocSetFullScreen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetFullScreen) #### PDDocGetID ```cpp ASInt32 PDDocGetID(PDDoc doc, ASInt32 nElemNum, ASUns8 *buffer, ASInt32 bufferSize) ``` Header: `PDProcs.h:1501` 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). Value Description `0` The permanent ID. `1` The permanent ID. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document whose file ID is obtained. - `nElemNum` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The element number to get from the document's file ID. It must be one of the following: - `buffer` ([`ASUns8 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns8)): (Filled by the method) If `buffer` is non-`NULL`, then up to `bufferSize` bytes of the ID will be written to the buffer. - `bufferSize` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The length of `buffer` in bytes. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The number of bytes in the ID element. #### PDDocGetLabelForPageNum ```cpp ASInt32 PDDocGetLabelForPageNum(PDDoc pdDoc, ASInt32 pageNum, char *buffer, ASInt32 bufferLen) ``` Header: `PDProcs.h:7367` 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. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document containing the page for which a label is requested. - `pageNum` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The number of the page whose label is requested. - `buffer` (`char *`): If a label exists for `pageNum`, it will be placed in this buffer. - `bufferLen` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The length of the label (`NULL`-terminated). **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The length of the resulting label. If no such page number exists, the resulting string will be the ASCII representation of `pageNum + 1`. **See also:** [`PDDocGetLabelForPageNumEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetLabelForPageNumEx), [`PDDocFindPageNumForLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocFindPageNumForLabel), [`PDDocGetPageLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetPageLabel), [`PDDocRemovePageLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocRemovePageLabel), [`PDDocSetPageLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetPageLabel), [`PDPageLabelNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageLabelNew) #### PDDocGetLabelForPageNumEx ```cpp void PDDocGetLabelForPageNumEx(PDDoc pdDoc, ASInt32 pageNum, ASText text) ``` Header: `PDProcs.h:11080` 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. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document containing the page for which a label is requested. - `pageNum` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The number of the page whose label is requested. - `text` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): If a label exists for `pageNum`, it is returned in this object. **Returns:** `void` **See also:** [`PDDocFindPageNumForLabelEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocFindPageNumForLabelEx), [`PDDocGetPageLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetPageLabel), [`PDDocRemovePageLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocRemovePageLabel), [`PDDocSetPageLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetPageLabel), [`PDPageLabelNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageLabelNew) #### PDDocGetLayoutMode ```cpp PDLayoutMode PDDocGetLayoutMode(PDDoc doc) ``` Header: `PDProcs.h:11341` Gets the value of the PageLayout key in the Catalog dictionary. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN The document whose layout mode is obtained. **Returns:** [`PDLayoutMode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDLayoutMode) Layout mode value from the PDF Catalog dictionary. **See also:** [`PDDocSetLayoutMode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetLayoutMode) #### PDDocGetNameTree ```cpp PDNameTree PDDocGetNameTree(PDDoc thePDDoc, ASAtom theTree) ``` Header: `PDProcs.h:7063` Retrieves a name tree, with the key name specified in `theTree`, from the Names dictionary of `thePDDoc`. **Parameters** - `thePDDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The document containing the name tree desired. - `theTree` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): IN/OUT The name of the tree requested. This can be created by passing a string to the ASAtomFromString() method. **Returns:** [`PDNameTree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTree) The PDNameTree requested. **See also:** [`PDNameTreeIsValid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTreeIsValid), [`PDDocCreateNameTree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateNameTree), [`PDDocRemoveNameTree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocRemoveNameTree) #### PDDocGetNewCryptHandler ```cpp ASAtom PDDocGetNewCryptHandler(PDDoc doc) ``` Header: `PDProcs.h:2529` 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. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document whose new security handler is obtained. **Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom) 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. **See also:** [`PDDocPermRequest`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocPermRequest), [`PDDocSetNewCryptHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetNewCryptHandler), [`PDDocSetNewCryptHandlerEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetNewCryptHandlerEx), [`PDRegisterCryptHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterCryptHandler), [`PDRegisterCryptHandlerEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterCryptHandlerEx) #### PDDocGetNewSecurityData ```cpp void * PDDocGetNewSecurityData(PDDoc doc) ``` Header: `PDProcs.h:2394` 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. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document whose new security data structure is obtained. **Returns:** `void *` The security data structure for the document's new security handler. **See also:** [`PDDocGetSecurityData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetSecurityData), [`PDDocNewSecurityData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocNewSecurityData), [`PDDocGetNewCryptHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetNewCryptHandler), [`PDDocSetNewCryptHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetNewCryptHandler), [`PDDocSetNewSecurityData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetNewSecurityData), [`PDDocPermRequest`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocPermRequest) #### PDDocGetNewSecurityInfo ```cpp void PDDocGetNewSecurityInfo(PDDoc pdDoc, ASUns32 *secInfo) ``` Header: `PDProcs.h:2550` 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. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The document whose new security information is obtained. - `secInfo` ([`ASUns32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): 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. **Returns:** `void` **See also:** [`PDRegisterCryptHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterCryptHandler) #### PDDocGetNthError ```cpp ASInt32 PDDocGetNthError(PDDoc doc, ASInt32 errNumber, ASInt32 *errorP, char *buffer, ASInt32 bufSize) ``` Header: `PDProcs.h:12007` Returns the error code and format argument string for the Nth non-fatal error encountered since the document was opened, or `PDDocClearErrors` was called. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document in which the error has occurred. - `errNumber` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): This is the index of the non-fatal error to be returned, PDDocGetNumErrors() returns how many errors there are. - `errorP` ([`ASInt32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The error code. Use `ASGetErrorString()` to get the error message associated with it (which may contain a format specifier). - `buffer` (`char *`): If there is a format argument string associated with this error, it's copied to this buffer. The buffer must be non-`NULL` and `NULL`-terminated. - `bufSize` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The maximum number of bytes that will be written to the buffer. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) If there is a format argument string associated with this error, the length of it is returned. If a problem occurs looking up the error number, the return value is zero. #### PDDocGetNumErrors ```cpp ASInt32 PDDocGetNumErrors(PDDoc doc) ``` Header: `PDProcs.h:11992` Return the number of non-fatal errors encountered since the document was opened, or `PDDocClearErrors` was called. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document in which the non-fatal errors have occurred. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) #### PDDocGetNumOCGs ```cpp ASUns32 PDDocGetNumOCGs(PDDoc pdDoc) ``` Header: `PDProcs.h:10337` 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. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document whose groups are counted. **Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32) The number of OCGs for the document. **See also:** [`PDDocHasOC`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocHasOC), [`PDDocGetOCGs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetOCGs), [`PDDocReplaceOCG`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocReplaceOCG), [`PDDocEnumOCGs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocEnumOCGs), [`PDDocGetOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetOCConfig), [`PDDocGetOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetOCContext) #### PDDocGetNumPages ```cpp ASInt32 PDDocGetNumPages(PDDoc doc) ``` Header: `PDProcs.h:1546` Gets the number of pages in a document. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The document for which the number of pages is obtained. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) 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 ```cpp ASInt32 PDDocGetNumThreads(PDDoc doc) ``` Header: `PDProcs.h:1824` Gets the number of article threads in a document. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The document whose article thread count is obtained. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The number of article threads in the document. #### PDDocGetOCConfig ```cpp PDOCConfig PDDocGetOCConfig(PDDoc pdDoc) ``` Header: `PDProcs.h:10023` Gets the built-in default optional-content configuration for the document from the OCProperties D entry. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document whose configuration is obtained. **Returns:** [`PDOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfig) The document's current optional-content configuration. **See also:** [`PDDocGetOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetOCContext), [`PDDocGetOCGs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetOCGs), [`PDDocEnumOCGs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocEnumOCGs), [`PDDocEnumOCConfigs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocEnumOCConfigs), [`PDOCConfigGetPDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfigGetPDDoc) #### PDDocGetOCContext ```cpp PDOCContext PDDocGetOCContext(PDDoc pdDoc) ``` Header: `PDProcs.h:9495` 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. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document whose context is obtained. **Returns:** [`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext) The document's current optional-content context. **See also:** [`PDDocGetOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetOCConfig), [`PDDocGetOCGs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetOCGs), [`PDOCContextGetPDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextGetPDDoc) #### PDDocGetOCGs ```cpp PDOCG * PDDocGetOCGs(PDDoc pdDoc) ``` Header: `PDProcs.h:10357` 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()). **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document whose OCGs are obtained. **Returns:** [`PDOCG *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG) A `NULL`-terminated array of PDOCG objects. The client is responsible for freeing the array using ASfree(). **See also:** [`PDDocHasOC`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocHasOC), [`PDDocReplaceOCG`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocReplaceOCG), [`PDDocEnumOCGs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocEnumOCGs), [`PDDocGetNumOCGs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetNumOCGs), [`PDDocGetOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetOCConfig), [`PDDocGetOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetOCContext), [`PDOCGGetPDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGGetPDDoc), [`PDOCMDGetPDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMDGetPDDoc) #### PDDocGetOpenAction ```cpp PDAction PDDocGetOpenAction(PDDoc doc) ``` Header: `PDProcs.h:1244` 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(). **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The document whose open action is obtained. **Returns:** [`PDAction`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAction) The document's open action. It is invalid if there is no OpenAction key in the Catalog dictionary (this can be tested with PDActionIsValid()). **See also:** `AVDocPerformAction`, [`PDDocSetOpenAction`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetOpenAction) #### PDDocGetPDCollection ```cpp PDCollection PDDocGetPDCollection(PDDoc pdDoc) ``` Header: `PDProcs.h:12323` Gets the collection object in a document. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document. **Returns:** [`PDCollection`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCollection) The collection. If the document does not have a collection, the returned collection is invalid. #### PDDocGetPageLabel ```cpp PDPageLabel PDDocGetPageLabel(PDDoc pdDoc, ASInt32 pageNum, ASInt32 *firstPage, ASInt32 *lastPage) ``` Header: `PDProcs.h:7230` Returns the label that is in effect for the given page. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document for which a page label is desired. - `pageNum` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The page number of the page for which a label is requested. - `firstPage` ([`ASInt32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): (Filled by the method) If non-`NULL`, it is the number of the first page that the page label is attached to. - `lastPage` ([`ASInt32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): (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:** [`PDPageLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageLabel) 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`. **See also:** [`PDDocFindPageNumForLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocFindPageNumForLabel), [`PDDocGetLabelForPageNum`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetLabelForPageNum), [`PDDocRemovePageLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocRemovePageLabel), [`PDDocSetPageLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetPageLabel), [`PDPageLabelNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageLabelNew) #### PDDocGetPageMode ```cpp PDPageMode PDDocGetPageMode(PDDoc doc) ``` Header: `PDProcs.h:1447` 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. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The document whose page mode is obtained. **Returns:** [`PDPageMode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageMode) Page mode value from PDF Catalog dictionary. **See also:** [`PDDocSetPageMode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetPageMode), `AVDocSetViewMode` #### PDDocGetPageObjByNum ```cpp CosObj PDDocGetPageObjByNum(PDDoc pdd, ASInt32 nPage) ``` Header: `PDProcs.h:7980` Returns the page Cos object corresponding to the given page number. **Parameters** - `pdd` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The PDDoc containing the given page. - `nPage` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The page number. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) A Cos object representing the page, or an object of type CosNull if the page does not exist. **Exceptions** - `genErrBadParm` - `pdErrBadPageObj` #### PDDocGetPermissions ```cpp PDPerms PDDocGetPermissions(PDDoc doc) ``` Header: `PDProcs.h:2566` Deprecated in Acrobat 5.0. Use PDDocPermRequest() instead. Gets the permissions for the specified document. You can set permissions with PDDocAuthorize(). **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document whose permissions are obtained. **Returns:** [`PDPerms`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPerms) A bit field indicating the document's permissions. It is an `OR` of the PDPerms values. **See also:** [`PDDocAuthorize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocAuthorize), [`PDDocGetSecurityData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetSecurityData), [`PDDocPermRequest`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocPermRequest) #### PDDocGetSecurityData ```cpp void * PDDocGetSecurityData(PDDoc doc) ``` Header: `PDProcs.h:2375` 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. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document whose security data structure is obtained. **Returns:** `void *` A pointer to the document's current security data structure. **See also:** [`PDDocGetNewSecurityData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetNewSecurityData), [`PDDocGetCryptHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetCryptHandler) #### PDDocGetThread ```cpp PDThread PDDocGetThread(PDDoc doc, ASInt32 index) ``` Header: `PDProcs.h:1838` Gets an article thread having the specified index. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The document containing the article thread. - `index` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN/OUT The index of the article thread to obtain. **Returns:** [`PDThread`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThread) The specified article thread. **See also:** [`PDDocAddThread`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocAddThread), [`PDDocRemoveThread`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocRemoveThread), [`PDThreadIsValid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThreadIsValid) #### PDDocGetThreadIndex ```cpp ASInt32 PDDocGetThreadIndex(PDDoc doc, PDThread thread) ``` Header: `PDProcs.h:1848` Gets the index of the specified article thread. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The document containing the thread. - `thread` ([`PDThread`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThread)): IN/OUT The thread whose index is obtained. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The index of thread in doc. It returns `-1` if `thread` is not in `doc`. #### PDDocGetTrapped ```cpp ASAtom PDDocGetTrapped(PDDoc pdDoc) ``` Header: `PDProcs.h:11039` Gets the value of the Trapped key in the Info dictionary. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document whose Trapped key value is obtained. **Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom) 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. **See also:** [`PDDocSetTrapped`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetTrapped) #### PDDocGetVersion ```cpp void PDDocGetVersion(PDDoc doc, ASInt16 *majorP, ASInt16 *minorP) ``` Header: `PDProcs.h:1523` 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). **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The document whose version is obtained. - `majorP` ([`ASInt16 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16)): IN/OUT (Filled by the method) The major version number. - `minorP` ([`ASInt16 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16)): IN/OUT (Filled by the method) The minor version number. **Returns:** `void` #### PDDocGetVersionEx ```cpp void PDDocGetVersionEx(PDDoc doc, ASUns32 *majorP, ASUns32 *minorP, CosObj *adbeExtensionBaseP, ASUns32 *adbeExtensionLevelP) ``` Header: `PDProcs.h:12039` 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 **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The document whose version is obtained. - `majorP` ([`ASUns32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): IN/OUT (Filled by the method) The major version number. - `minorP` ([`ASUns32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): IN/OUT (Filled by the method) The minor version number. - `adbeExtensionBaseP` ([`CosObj *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): 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` ([`ASUns32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): 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. **Returns:** `void` #### PDDocGetWordFinder ```cpp PDWordFinder PDDocGetWordFinder(PDDoc docP, ASInt16 WXEVersion) ``` Header: `PDProcs.h:2046` Gets the word finder associated with a document. It is not necessary to destroy the word finder returned by this method. **Parameters** - `docP` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document whose word finder is obtained. - `WXEVersion` ([`ASInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16)): The version of the word finder to get. **Returns:** [`PDWordFinder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinder) 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** - `genErrBadParm`: is thrown if an invalid version number is passed. **See also:** [`PDDocCreateWordFinder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateWordFinder), [`PDDocCreateWordFinderUCS`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateWordFinderUCS) #### PDDocHasISOExtensions ```cpp ASBool PDDocHasISOExtensions(PDDoc doc) ``` Header: `PDProcs.h:12058` 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 @since **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The document tested for ISO extensions. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) #### PDDocHasOC ```cpp ASBool PDDocHasOC(PDDoc pdDoc) ``` Header: `PDProcs.h:10321` 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. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document whose OC status is obtained. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the document has optional content, `false` otherwise. **See also:** [`PDDocGetOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetOCConfig), [`PDDocGetOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetOCContext), [`PDDocGetOCGs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetOCGs) #### PDDocImportCosDocNotes ```cpp ASInt32 PDDocImportCosDocNotes(PDDoc doc, CosDoc src, const char *noteTitle, ASInt32 noteTitleLen, PDColorValue color, void *progMon, void *monClientData, PDDocWillImportAnnotCallback importFilter) ``` Header: `PDProcs.h:6815` 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. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document that will receive the imported annotations. - `src` ([`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc)): The document from which the annotations will be imported. - `noteTitle` (`const char *`): Not currently used. - `noteTitleLen` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): Not currently used. - `color` (`PDColorValue`): If non-`NULL`, the color attribute of imported annotations. `color` indicates the color space (PDDeviceGray, PDDeviceRGB, PDDeviceCMYK), and color values for the annotation. - `progMon` (`void *`): If supplied, it is a procedure to call regularly to update a progress bar for the user. - `monClientData` (`void *`): If supplied, it is a pointer to the private data buffer used by `progMon`. - `importFilter` ([`PDDocWillImportAnnotCallback`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocWillImportAnnotCallback)): A user-supplied procedure that will be called to provide a filtering process, allowing only desired annotations to import. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The number of notes imported. @notify PDDocDidImportAnnots @notify PDDocWillImportAnnots **See also:** [`PDDocImportNotes`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocImportNotes), [`PDDocExportNotes`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocExportNotes) #### PDDocImportNotes ```cpp ASInt32 PDDocImportNotes(PDDoc doc, PDDoc sourceDoc, void *progMon, void *monClientData, PDDocWillImportAnnotCallback importFilter) ``` Header: `PDProcs.h:7411` 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. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document to which the notes are exported. - `sourceDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document from which the notes are exported. - `progMon` (`void *`): A user-supplied progress monitor. - `monClientData` (`void *`): Data supplied by the monitoring routine. - `importFilter` ([`PDDocWillImportAnnotCallback`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocWillImportAnnotCallback)): A user-supplied filter which determines what type of notes will be exported. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The number of notes imported. @notify PDDocDidImportAnnots @notify PDDocWillImportAnnots **See also:** [`PDDocExportNotes`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocExportNotes), [`PDDocImportCosDocNotes`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocImportCosDocNotes) #### PDDocInsertPages ```cpp void PDDocInsertPages(PDDoc doc, ASInt32 mergeAfterThisPage, PDDoc doc2, ASInt32 startPage, ASInt32 numPages, ASUns16 insertFlags, ProgressMonitor progMon, void *progMonClientData, CancelProc cancelProc, void *cancelProcClientData) ``` Header: `PDProcs.h:1753` 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`. Constant Description PDInsertBookmarks 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`. PDInsertThreads Inserts threads as well as pages. PDInsertAll Inserts document data from pages. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document into which pages are inserted. This document must have at least one page. - `mergeAfterThisPage` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): 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` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document containing the pages that are inserted into `doc`. - `startPage` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): 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` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The number of pages in `doc2` to insert into `doc`. Use PDAllPages to insert all pages from `startPage` of `doc2` into `doc`. - `insertFlags` ([`ASUns16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASUns16)): Flags that determine what additional information is copied from `doc2` into `doc`. It is an `OR` of the following constants (see `PDExpT.h`): - `progMon` ([`ProgressMonitor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ProgressMonitor)): A progress monitor. Use AVAppGetDocProgressMonitor() to obtain the default progress monitor. `NULL` may be passed, in which case no progress monitor is used. - `progMonClientData` (`void *`): A pointer to user-supplied data to pass to `progMon` each time it is called. It should be `NULL` if `progMon` is `NULL`. - `cancelProc` ([`CancelProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#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` (`void *`): A pointer to user-supplied data to pass to `cancelProc` each time it is called. It should be `NULL` if `cancelProc` is `NULL`. **Returns:** `void` **Exceptions** - `pdErrOpNotPermitted`: is raised unless `doc` is editable and `doc2` is not encrypted or the owner opened it. - `pdErrCantUseNewVersion`: is raised if `doc2` is a newer major version than the Acrobat viewer understands. - `pdErrTooManyPagesForInsert`: is raised if the insertion would result in a document with too many pages. - `genErrBadParm`: is raised if `mergeAfterThisPage` is an invalid page number or `doc` has no pages. - `genErrNoMemory`: is raised if there is insufficient memory to perform the insertion. - `pdErrWhileRecoverInsertPages`: is raised if an error occurs while trying to recover from an error during inserting. @notify PDDocWillInsertPages @notify PDDocDidInsertPages @notify PDDocDidChangePages @notify PDDocPrintingTiledPage @notify PDDocDidChangeThumbs @notify PDDocDidAddThread **See also:** `AVAppGetCancelProc`, `AVAppGetDocProgressMonitor`, [`PDDocCreatePage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreatePage), [`PDDocDeletePages`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocDeletePages), [`PDDocMovePage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocMovePage), [`PDDocReplacePages`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocReplacePages) #### PDDocMovePage ```cpp void PDDocMovePage(PDDoc doc, ASInt32 moveToAfterThisPage, ASInt32 pageToMove) ``` Header: `PDProcs.h:1635` Moves one page in a document. @notify PDDocWillMovePages @notify PDDocDidMovePages @notify PDDocDidChangePages @notify PDDocWillChangePages **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document in which the page is moved. - `moveToAfterThisPage` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): 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` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The page number of the page to move. **Returns:** `void` **Exceptions** - `genErrBadParm`: is raised if `moveAfterThisPage` or `pageToMove` is invalid. Other exceptions may be raised as well. **See also:** [`PDDocInsertPages`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocInsertPages), [`PDDocReplacePages`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocReplacePages), [`PDDocDeletePages`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocDeletePages) #### PDDocNewSecurityData ```cpp void * PDDocNewSecurityData(PDDoc doc) ``` Header: `PDProcs.h:2456` 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(). **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document for which a security data structure is created. **Returns:** `void *` The newly created security data structure. **Exceptions** - `pdErrOpNotPermitted`: is raised if pdPermSecure (see PDPerms) has not been granted for `doc`. - `pdErrNeedCryptHandler`: is raised if the document does not have a new security handler. **See also:** [`PDDocSetNewCryptHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetNewCryptHandler), [`PDDocSetNewSecurityData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetNewSecurityData) #### PDDocOpen ```cpp PDDoc PDDocOpen(ASPathName fileName, ASFileSys fileSys, PDAuthProc authProc, ASBool doRepair) ``` Header: `PDProcs.h:1228` 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. **Parameters** - `fileName` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): A path name to the file, specified in whatever format is correct for `fileSys`. - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): 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` ([`PDAuthProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAuthProc)): 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` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): 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:** [`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc) The newly-opened document. **Exceptions** - `pdErrNeedPassword`: or other errors are raised if the file is encrypted and `authProc` is `NULL` or returns `false`. - `pdErrNotEnoughMemoryToOpenDoc`: or genErrNoMemory is raised if there is insufficient memory to open the document. - `pdErrNeedRebuild`: is raised if the document needs to be rebuilt and `doRepair` is `false`. - `pdErrBadOutlineObj`: 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). - `pdErrBadRootObj`: is raised if the Catalog object (as returned by CosDocGetRoot()) is not a dictionary. - `pdErrBadBaseObj`: 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). - `pdErrTooManyPagesForOpen`: is raised if the document contains too many pages. - `cosSynErrNoHeader`: is raised if the document's header appears to be bad. - `cosSynErrNoStartXRef`: is raised if no end-of-file line can be located. - `cosErrRebuildFailed`: is raised if `doRepair` is `true` and rebuild failed. **See also:** [`PDDocClose`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocClose), [`PDDocCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreate), [`PDDocPermRequest`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocPermRequest), [`PDDocOpenEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocOpenEx), [`PDDocOpenFromASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocOpenFromASFile), [`PDDocOpenFromASFileEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocOpenFromASFileEx) #### PDDocOpenEx ```cpp PDDoc PDDocOpenEx(ASPathName fileName, ASFileSys fileSys, PDAuthProcEx authProcEx, void *authProcClientData, ASBool doRepair) ``` Header: `PDProcs.h:6033` 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. **Parameters** - `fileName` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): A path name to the file, specified in whatever format is correct for `fileSys`. - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): A pointer to an `ASFileSysRec` containing the file system in which the file resides. - `authProcEx` ([`PDAuthProcEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAuthProcEx)): 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` (`void *`): A pointer to user-supplied data to pass to authProcEx() each time it is called. - `doRepair` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): 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:** [`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc) The newly-opened document. **Exceptions** - `pdErrNeedPassword`: is raised if the file is encrypted and `authProc`Ex() is `NULL` or returns `false`. - `pdErrNotEnoughMemoryToOpenDoc`: or genErrNoMemory is raised if there is insufficient memory to open the document. - `pdErrNeedRebuild`: is raised if the document needs to be rebuilt and `doRepair` is `false`. - `pdErrBadOutlineObj`: 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). - `pdErrBadRootObj`: is raised if the Catalog object (as returned by CosDocGetRoot()) is not a dictionary. - `pdErrBadBaseObj`: 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). - `pdErrTooManyPagesForOpen`: is raised if the document contains too many pages. - `cosSynErrNoHeader`: is raised if the document's header appears to be bad. - `cosSynErrNoStartXRef`: is raised if no end-of-file line can be located. - `cosErrRebuildFailed`: is raised if `doRepair` is `true` and rebuild failed. **See also:** [`PDDocClose`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocClose), [`PDDocCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreate), [`PDDocAuthorize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocAuthorize), [`PDDocOpen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocOpen), [`PDDocOpenFromASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocOpenFromASFile), [`PDDocOpenFromASFileEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocOpenFromASFileEx) #### PDDocOpenFromASFile ```cpp PDDoc PDDocOpenFromASFile(ASFile aFile, PDAuthProc authProc, ASBool doRepair) ``` Header: `PDProcs.h:5548` 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. **Parameters** - `aFile` ([`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): The ASFile to open. The ASFile should be released after the PDDoc is closed. - `authProc` ([`PDAuthProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAuthProc)): 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` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): 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:** [`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc) A valid PDDoc if successfully opened. **Exceptions** - `pdErrNeedPassword`: is raised if the file is encrypted and `authProc` is `NULL` or returns `false`. - `fileErrBytesNotReady`: is raised if the bytes required to open a PDDoc are not yet available. **See also:** [`PDDocClose`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocClose), [`PDDocOpen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocOpen), [`PDDocOpenEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocOpenEx), [`PDDocOpenFromASFileEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocOpenFromASFileEx) #### PDDocOpenFromASFileEx ```cpp PDDoc PDDocOpenFromASFileEx(ASFile aFile, PDAuthProcEx authProcEx, void *authProcClientData, ASBool doRepair) ``` Header: `PDProcs.h:6074` 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. **Parameters** - `aFile` ([`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): The ASFile to open. The ASFile should be released after the PDDoc is closed. - `authProcEx` ([`PDAuthProcEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAuthProcEx)): 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` (`void *`): A pointer to user-supplied data to pass to authProcEx() each time it is called. - `doRepair` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): 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:** [`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc) A valid PDDoc if successfully opened. **Exceptions** - `pdErrNeedPassword`: is raised if the file is encrypted and `authProc` is `NULL` or returns `false`. - `fileErrBytesNotReady`: is raised if the bytes required to open a PDDoc are not yet available. **See also:** [`PDDocClose`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocClose), [`PDDocOpen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocOpen), [`PDDocOpenEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocOpenEx), [`PDDocOpenFromASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocOpenFromASFile) #### PDDocOpenWithParams ```cpp PDDoc PDDocOpenWithParams(PDDocOpenParams openParams) ``` Header: `PDProcs.h:7322` 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. **Parameters** - `openParams` ([`PDDocOpenParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocOpenParams)): 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:** [`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc) The PDDoc for the PDF document described by the structure passed in `openParams`. **See also:** [`PDDocOpen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocOpen), [`PDDocOpenEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocOpenEx), [`PDDocOpenFromASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocOpenFromASFile), [`PDDocOpenFromASFileEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocOpenFromASFileEx) #### PDDocPermRequest ```cpp PDPermReqStatus PDDocPermRequest(PDDoc pdDoc, PDPermReqObj reqObj, PDPermReqOpr reqOpr, void *authData) ``` Header: `PDProcs.h:7860` 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. @since **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The PDDoc whose permissions are being requested. - `reqObj` ([`PDPermReqObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPermReqObj)): The target object of the permissions request. - `reqOpr` ([`PDPermReqOpr`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPermReqOpr)): The target operation of the permissions request. - `authData` (`void *`): A pointer to an authorization data structure. **Returns:** [`PDPermReqStatus`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPermReqStatus) **See also:** [`PDDocAuthorize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocAuthorize), [`PDDocGetPermissions`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetPermissions), [`PDDocGetNewCryptHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetNewCryptHandler), [`PDDocSetNewCryptHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetNewCryptHandler), [`PDDocSetNewCryptHandlerEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetNewCryptHandlerEx), [`PDRegisterCryptHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterCryptHandler), [`PDRegisterCryptHandlerEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterCryptHandlerEx) #### PDDocPermRequestNoUB ```cpp PDPermReqStatus PDDocPermRequestNoUB(PDDoc pdDoc, PDPermReqObj reqObj, PDPermReqOpr reqOpr, void *authData) ``` Header: `PDProcs.h:11265` PDDocPermRequestNoUB() indicates whether the permission would have been granted had the document not been Rights Enabled. This may throw numerous exceptions. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The PDDoc whose permissions are being requested. - `reqObj` ([`PDPermReqObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPermReqObj)): The target object of the permissions request. - `reqOpr` ([`PDPermReqOpr`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPermReqOpr)): The target operation of the permissions request. - `authData` (`void *`): A pointer to an authorization data structure. **Returns:** [`PDPermReqStatus`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPermReqStatus) The request status constant: `0` if the requested operation is allowed, a non-zero status code otherwise. **See also:** [`PDDocPermRequest`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocPermRequest) #### PDDocReadAhead ```cpp void PDDocReadAhead(PDDoc doc, ASUns32 flags, void *clientData) ``` Header: `PDProcs.h:5974` 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. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The document being read. - `flags` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): IN/OUT Flags describing type of data to read ahead. It must be an `OR` of flags in PDDocReadAhead() Flags. - `clientData` (`void *`): IN/OUT Currently unused. **Returns:** `void` #### PDDocReadAheadEmbeddedFile ```cpp void PDDocReadAheadEmbeddedFile(PDDoc doc, CosObj embeddedFileObj) ``` Header: `PDProcs.h:10986` 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. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document being read. - `embeddedFileObj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The Cos object of the embedded file stream (the stream referenced by entries in the EF dictionary). **Returns:** `void` #### PDDocReadAheadPages ```cpp void PDDocReadAheadPages(PDDoc doc, ASInt32 startPage, ASInt32 nPages) ``` Header: `PDProcs.h:7337` Reads ahead `nPages` starting at `startPage` (if the file is linearized). **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The document for which pages are read ahead. - `startPage` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN/OUT The page for which read ahead is initiated. - `nPages` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN/OUT The number of pages to read ahead. **Returns:** `void` #### PDDocRelease ```cpp void PDDocRelease(PDDoc doc) ``` Header: `PDProcs.h:1406` Decrements a document's reference count. The document will not be closed until the reference count is zero, or the application terminates. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The document whose reference count is decremented. **Returns:** `void` **Exceptions** - `genErrBadParm` **See also:** [`PDDocAcquire`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocAcquire) #### PDDocRemoveNameTree ```cpp void PDDocRemoveNameTree(PDDoc thePDDoc, ASAtom theTree) ``` Header: `PDProcs.h:7095` Removes the name tree inside the Names dictionary with the specified key name. It does nothing if no object with that name exists. **Parameters** - `thePDDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The document from which a name tree is removed. - `theTree` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): IN/OUT The name tree to remove. **Returns:** `void` **See also:** [`PDDocCreateNameTree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateNameTree), [`PDDocGetNameTree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetNameTree) #### PDDocRemoveOpenAction ```cpp void PDDocRemoveOpenAction(PDDoc doc) ``` Header: `PDProcs.h:7942` Removes the value of the OpenAction key in the Catalog dictionary. The value is the action performed when the document is opened. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The document whose open action is removed. **Returns:** `void` **Exceptions** - `genErrBadParm` - `pdErrOpNotPermitted` **See also:** [`PDDocGetOpenAction`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetOpenAction), [`PDDocSetOpenAction`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetOpenAction) #### PDDocRemovePageLabel ```cpp void PDDocRemovePageLabel(PDDoc pdDoc, ASInt32 pageNum) ``` Header: `PDProcs.h:7302` Removes the page label that is attached to the specified page, effectively merging the specified range with the previous page label sequence. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document from which a page label is removed. - `pageNum` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The page from which the page label is removed. **Returns:** `void` **See also:** [`PDDocSetPageLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetPageLabel), [`PDDocGetPageLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetPageLabel), [`PDPageLabelNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageLabelNew) #### PDDocRemoveThread ```cpp void PDDocRemoveThread(PDDoc doc, ASInt32 index) ``` Header: `PDProcs.h:1881` Removes an article thread from a document. If you also wish to destroy the thread, use PDThreadDestroy() after calling PDDocRemoveThread(). **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The document from which the thread is removed. - `index` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN/OUT The index of the thread to remove. @notify PDDocWillRemoveThread @notify PDDocDidRemoveThread **Returns:** `void` **See also:** [`PDThreadDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThreadDestroy), [`PDDocAddThread`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocAddThread), [`PDBeadGetThread`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBeadGetThread) #### PDDocReplaceOCG ```cpp void PDDocReplaceOCG(PDOCG replaceOCG, PDOCG keepOCG) ``` Header: `PDProcs.h:10372` In the document associated with a specified optional-content group, replaces that group with another group. **Parameters** - `replaceOCG` ([`PDOCG`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG)): The OCG to replace. - `keepOCG` ([`PDOCG`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG)): The replacement OCG. **Returns:** `void` **See also:** [`PDDocHasOC`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocHasOC), [`PDDocGetOCGs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetOCGs), [`PDDocEnumOCGs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocEnumOCGs), [`PDDocGetNumOCGs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetNumOCGs), [`PDDocGetOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetOCConfig), [`PDDocGetOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetOCContext) #### PDDocReplacePages ```cpp void PDDocReplacePages(PDDoc doc, ASInt32 startPage, PDDoc doc2, ASInt32 startPageDoc2, ASInt32 numPages, ASBool mergeTextAnnots, ProgressMonitor progMon, void *progMonClientData, CancelProc cancelProc, void *cancelProcClientData) ``` Header: `PDProcs.h:1814` 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. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document in which pages are replaced. - `startPage` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The first page number in `doc` to replace. The first page is `0`. - `doc2` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document from which pages are copied into `doc`. - `startPageDoc2` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The page number of the first page in `doc2` to copy. The first page is `0`. - `numPages` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The number of pages to replace. - `mergeTextAnnots` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): 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` ([`ProgressMonitor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ProgressMonitor)): A progress monitor. Use AVAppGetDocProgressMonitor() to obtain the default progress monitor. `NULL` may be passed, in which case no progress monitor is used. - `progMonClientData` (`void *`): A pointer to user-supplied data to pass to `progMon` each time it is called. It should be `NULL` if `progMon` is `NULL`. - `cancelProc` ([`CancelProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#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` (`void *`): A pointer to user-supplied data to pass to `cancelProc` each time it is called. It should be `NULL` if `cancelProc` is `NULL`. **Returns:** `void` **Exceptions** - `pdErrOpNotPermitted`: is raised unless `doc` is editable and `doc2` is not encrypted or the owner opened it. - `pdErrCantUseNewVersion`: is raised if `doc2` is a newer major version than the Acrobat viewer understands. - `genErrBadParm`: 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` - `genErrNoMemory`: is raised if there is insufficient memory to perform the insertion. @notify PDDocWillReplacePages @notify PDDocDidReplacePages @notify PDDocDidChangePages @notify PDDocWillChangePages **See also:** [`PDDocInsertPages`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocInsertPages), [`PDDocMovePage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocMovePage), [`PDDocDeletePages`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocDeletePages), [`PDDocCreatePage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreatePage) #### PDDocRequestEntireFile ```cpp void PDDocRequestEntireFile(PDDoc doc, PDDocRequestEntireFileProc requestProc, void *clientData) ``` Header: `PDProcs.h:10872` Requests the document file and performs the specified procedure on it. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document for which pages are read ahead. - `requestProc` ([`PDDocRequestEntireFileProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocRequestEntireFileProc)): The procedure to call to process the request. - `clientData` (`void *`): A pointer to user-defined data to pass to the `requestProc`. **Returns:** `void` #### PDDocRequestPages ```cpp void PDDocRequestPages(PDDoc doc, ASInt32 startPage, ASInt32 nPages, PDDocRequestPagesProc requestProc, void *clientData) ``` Header: `PDProcs.h:10860` Requests `nPages` starting at `startPage`, and performs a specified procedure on them. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document for which pages are read ahead. - `startPage` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The first page requested. - `nPages` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The number of pages requested. - `requestProc` ([`PDDocRequestPagesProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocRequestPagesProc)): The procedure to call to process the request. - `clientData` (`void *`): A pointer to user-defined data to pass to the `requestProc`. **Returns:** `void` #### PDDocResetInkUsage ```cpp void PDDocResetInkUsage(PDDoc doc) ``` Header: `PDProcs.h:11984` 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. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN The document on which to reset set the ink usage. **Returns:** `void` #### PDDocSave ```cpp void PDDocSave(PDDoc doc, PDSaveFlags saveFlags, ASPathName newPath, ASFileSys fileSys, ProgressMonitor progMon, void *progMonClientData) ``` Header: `PDProcs.h:1360` 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. @ingroup ReplaceableMethods **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document to save.`OR` of the PDSaveFlags values. - `saveFlags` ([`PDSaveFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDSaveFlags)) - `newPath` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): 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`.`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. - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)) - `progMon` ([`ProgressMonitor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ProgressMonitor)): A progress monitor. Use AVAppGetDocProgressMonitor() to obtain the default. `NULL` may be passed, in which case no progress monitor is used. - `progMonClientData` (`void *`): A pointer to user-supplied data to pass to `progMon` each time it is called. It should be `NULL` if `progMon` is `NULL`. **Returns:** `void` **Exceptions** - `pdErrAlreadyOpen`: is raised if PDSaveFull is used, and the file specified by `newPath` is already open. @notify PDDocWillSave @notify PDDocDidSave - `pdErrAfterSave`: 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. - `pdErrOpNotPermitted`: 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. **Note:** Not replaceable in Adobe Reader. **See also:** [`PDDocClose`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocClose), [`PDDocSaveWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSaveWithParams) #### PDDocSaveWithParams ```cpp void PDDocSaveWithParams(PDDoc doc, PDDocSaveParams inParams) ``` Header: `PDProcs.h:6165` 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. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document to save. - `inParams` ([`PDDocSaveParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSaveParams)): A PDDocSaveParams structure specifying how the document should be saved. **Returns:** `void` **See also:** [`PDDocSave`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSave) #### PDDocSetAdobePDFVersion ```cpp void PDDocSetAdobePDFVersion(PDDoc doc, const AdobePDFVersion version) ``` Header: `PDProcs.h:12815` PDDocSetAdobePDFVersion() sets the current version of the document in the AdobePDFVersion define in CosExp.T **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The document whose version is to be updated. - `version` ([`const AdobePDFVersion`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#AdobePDFVersion)): IN/OUT version to which document is updated. **Returns:** `void` #### PDDocSetFlags ```cpp void PDDocSetFlags(PDDoc doc, ASInt32 flags) ``` Header: `PDProcs.h:1434` 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. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The document whose flags are set. - `flags` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN/OUT A bit field composed of an `OR` of the PDDocFlags values. **Returns:** `void` **See also:** [`PDDocGetFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetFlags), [`PDDocClearFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocClearFlags) #### PDDocSetFullScreen ```cpp void PDDocSetFullScreen(PDDoc pdDoc, ASBool fs) ``` Header: `PDProcs.h:6141` Sets whether this document opens in full-screen mode. This provides an alternative to calling PDDocSetPageMode() with PDFullScreen. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document to set. - `fs` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): `true` if the document is set to open in full-screen mode, `false` otherwise. **Returns:** `void` **See also:** [`PDDocGetFullScreen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetFullScreen) #### PDDocSetLayoutMode ```cpp void PDDocSetLayoutMode(PDDoc doc, PDLayoutMode mode) ``` Header: `PDProcs.h:11331` Sets the value of the PageLayout key in the Catalog dictionary. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN The document whose page mode is set. - `mode` ([`PDLayoutMode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDLayoutMode)): IN The layout mode to set. **Returns:** `void` **See also:** [`PDDocGetLayoutMode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetLayoutMode) #### PDDocSetMinorVersion ```cpp void PDDocSetMinorVersion(PDDoc pdDoc, ASInt16 minor) ``` Header: `PDProcs.h:11846` 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. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document. - `minor` ([`ASInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16)): The minimum required minor version **Returns:** `void` #### PDDocSetNewCryptFilterData ```cpp void PDDocSetNewCryptFilterData(PDDoc doc, ASAtom filterName, char *cryptData, ASInt32 cryptDataLen) ``` Header: `PDProcs.h:10795` Sets the encrypted data for the specified document's encryption filter to decrypt. Call this before accessing the stream to be decrypted. @product_exclude RDR **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document whose new encrypted data is set. - `filterName` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The ASAtom corresponding to the name of the security filter used by the document. - `cryptData` (`char *`): The new encrypted data for the document. - `cryptDataLen` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The length of `cryptData` in bytes. **Returns:** `void` **Exceptions** - `pdErrNoCryptHandler`: is raised if there is no security handler registered for the document. - `pdErrOpNotPermitted`: is raised if the document's permissions do not allow its data to be modified. **See also:** [`PDCryptAuthorizeFilterAccess`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCryptAuthorizeFilterAccess), [`PDDocSetNewCryptFilterMethod`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetNewCryptFilterMethod), [`PDDocSetNewDefaultFilters`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetNewDefaultFilters) #### PDDocSetNewCryptFilterMethod ```cpp void PDDocSetNewCryptFilterMethod(PDDoc doc, ASAtom filterName, ASAtom method) ``` Header: `PDProcs.h:10771` Sets or resets the specified document's security filter method, used for encryption and decryption of the document's data. @product_exclude RDR **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document whose new security filter method is set. - `filterName` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The ASAtom corresponding to the name of the security filter to use. - `method` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): One of five supported security methods: • None (default) • V2 (RC4) • V3 (RC4) • AESV1 • AESV2 (128 bit) • AESV3 (256 bit) **Returns:** `void` **Exceptions** - `pdErrNoCryptHandler`: is raised if there is no security handler registered for the document. **See also:** [`PDCryptAuthorizeFilterAccess`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCryptAuthorizeFilterAccess), [`PDDocSetNewCryptFilterData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetNewCryptFilterData), [`PDDocSetNewDefaultFilters`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetNewDefaultFilters) #### PDDocSetNewCryptHandler ```cpp void PDDocSetNewCryptHandler(PDDoc pdDoc, ASAtom newCryptHandler) ``` Header: `PDProcs.h:2508` 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`. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document whose new security handler is set. - `newCryptHandler` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): 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. **Returns:** `void` **Exceptions** - `pdErrNoCryptHandler`: is raised if there is no security handler registered with the specified name and the name is not ASAtomNull. - `pdErrOpNotPermitted`: is raised if the document's permissions do not allow its security to be modified. **See also:** [`PDDocGetNewCryptHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetNewCryptHandler), [`PDDocPermRequest`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocPermRequest), [`PDDocSetNewCryptHandlerEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetNewCryptHandlerEx), [`PDRegisterCryptHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterCryptHandler), [`PDRegisterCryptHandlerEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterCryptHandlerEx) #### PDDocSetNewCryptHandlerEx ```cpp void PDDocSetNewCryptHandlerEx(PDDoc pdDoc, ASAtom newCryptHandler, void *currentAuthData) ``` Header: `PDProcs.h:11026` 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`. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document whose new security handler is set. - `newCryptHandler` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): 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` (`void *`): 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. **Returns:** `void` **Exceptions** - `pdErrNoCryptHandler`: is raised if there is no security handler registered with the specified name and the name is not ASAtomNull. - `pdErrOpNotPermitted`: is raised if the document's permissions do not allow its security to be modified. **See also:** [`PDDocGetNewCryptHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetNewCryptHandler), [`PDDocPermRequest`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocPermRequest), [`PDDocSetNewCryptHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetNewCryptHandler), [`PDRegisterCryptHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterCryptHandler), [`PDRegisterCryptHandlerEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterCryptHandlerEx) #### PDDocSetNewDefaultFilters ```cpp void PDDocSetNewDefaultFilters(PDDoc doc, ASAtom defaultStmFilterName, ASAtom defaultStrFilterName) ``` Header: `PDProcs.h:10818` 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). **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document whose new security filter is set. - `defaultStmFilterName` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The ASAtom corresponding to the name of the default security filter to use for streams. The filter must exist and be registered. - `defaultStrFilterName` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The ASAtom corresponding to the name of the default security filter to use for strings. The filter must exist and be registered. **Returns:** `void` **Exceptions** - `pdErrNoCryptHandler`: is raised if there is no security handler registered for the document. **See also:** [`PDCryptAuthorizeFilterAccess`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCryptAuthorizeFilterAccess), [`PDDocSetNewCryptFilterData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetNewCryptFilterData), `PDDocSetNewCryptFilterMethod @product_exclude RDR` #### PDDocSetNewSecurityData ```cpp void PDDocSetNewSecurityData(PDDoc pdDoc, void *secData) ``` Header: `PDProcs.h:2477` Sets the security data structure for the specified document's new security handler. Use PDDocSetNewCryptHandler() to set a new security handler for a document. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The document whose new security data structure is set. - `secData` (`void *`): IN/OUT A pointer to the new security data structure to set for `doc`. See PDDocNewSecurityData() for information on creating and filling this structure. **Returns:** `void` **Exceptions** - `pdErrNeedCryptHandler`: is raised if the document does not have a new security handler. - `pdErrOpNotPermitted`: is raised if the document's permissions cannot be changed. **See also:** [`PDDocGetNewSecurityData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetNewSecurityData), [`PDDocGetSecurityData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetSecurityData), [`PDDocNewSecurityData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocNewSecurityData), [`PDDocSetNewCryptHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetNewCryptHandler) #### PDDocSetOpenAction ```cpp void PDDocSetOpenAction(PDDoc doc, PDAction action) ``` Header: `PDProcs.h:1255` Sets the value of the OpenAction key in the Catalog dictionary, which is the action performed when the document is opened. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document whose open action is set. - `action` ([`PDAction`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAction)): The open action you want to set. **Returns:** `void` **See also:** [`PDDocGetOpenAction`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetOpenAction) #### PDDocSetPageLabel ```cpp void PDDocSetPageLabel(PDDoc pdDoc, ASInt32 pageNum, PDPageLabel pgLabel) ``` Header: `PDProcs.h:7288` 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. @notify PDDocPageLabelDidChange **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document containing the page to label. - `pageNum` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The number of the page to label. - `pgLabel` ([`PDPageLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageLabel)): The label for the page specified by `pageNum`. **Returns:** `void` **Exceptions** - `genErrBadParm`: is raised if `pgLabel` is not a valid PDPageLabel. **See also:** [`PDDocFindPageNumForLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocFindPageNumForLabel), [`PDDocGetPageLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetPageLabel), [`PDDocGetLabelForPageNum`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetLabelForPageNum), [`PDDocRemovePageLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocRemovePageLabel), [`PDPageLabelNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageLabelNew) #### PDDocSetPageMode ```cpp void PDDocSetPageMode(PDDoc doc, PDPageMode mode) ``` Header: `PDProcs.h:1458` Sets the value of the PageMode key in the Catalog dictionary. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The document whose page mode is set. - `mode` ([`PDPageMode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageMode)): IN/OUT The page mode to set. **Returns:** `void` **See also:** [`PDDocGetPageMode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetPageMode), `AVDocSetViewMode` #### PDDocSetTrapped ```cpp void PDDocSetTrapped(PDDoc pdDoc, ASAtom newValue) ``` Header: `PDProcs.h:11058` 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. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document whose Trapped key value to set. - `newValue` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): 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. **Returns:** `void` **See also:** [`PDDocGetTrapped`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetTrapped) #### PDEnumDocs ```cpp void PDEnumDocs(PDDocEnumProc proc, void *clientData) ``` Header: `PDProcs.h:1171` Enumerates the PDDoc objects that are currently open, calling a user-supplied procedure for each open document. **Parameters** - `proc` ([`PDDocEnumProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocEnumProc)): IN/OUT A user-supplied callback to call for each open PDDoc. Enumeration halts if `proc` returns `false`. - `clientData` (`void *`): IN/OUT A pointer to user-supplied data to pass to `proc` each time it is called. **Returns:** `void` **See also:** `AVAppEnumDocs`, [`PDDocOpen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocOpen) ### Typedefs (22) #### PDDocFlags ```cpp typedef ASInt32 PDDocFlags ``` Header: `PDExpT.h:103` A `signed int` (which is never negative), for historical reasons. **See also:** [`PDDocClearFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocClearFlags), [`PDDocGetFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetFlags), [`PDDocSetFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetFlags) #### PDDocOCChangeType ```cpp typedef ASUns8 PDDocOCChangeType ``` Header: `PDExpT.h:5830` #### PDDocRequestReason ```cpp typedef ASEnum8 PDDocRequestReason ``` Header: `PDExpT.h:6533` #### PDDocVersion ```cpp typedef ASInt16 PDDocVersion ``` Header: `PDExpT.h:95` A `signed int` (which is never negative), for historical reasons. #### PDLayoutMode ```cpp typedef ASEnum8 PDLayoutMode ``` Header: `PDExpT.h:2064` #### PDPermReqObj ```cpp typedef ASUns32 PDPermReqObj ``` Header: `PDExpT.h:4190` #### PDPermReqOpr ```cpp typedef ASUns32 PDPermReqOpr ``` Header: `PDExpT.h:4269` #### PDPermReqStatus ```cpp typedef ASInt16 PDPermReqStatus ``` Header: `PDExpT.h:4129` The set of valid PDPermRequestStatus values providing the status of PDDoc-related permissions methods. **See also:** [`PDDocPermRequest`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocPermRequest), [`PDCryptAuthorizeExProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCryptAuthorizeExProc), [`PDCryptGetAuthDataExProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCryptGetAuthDataExProc) #### PDPerms ```cpp typedef ASUns32 PDPerms ``` Header: `PDExpT.h:1436` Constant values that specify permissions which allow operations on a document file. **See also:** `AVCryptGetPassword`, [`PDDocAuthorize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocAuthorize), `PDDocGetPermissions (obsolete)`, [`PDDocPermRequest`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocPermRequest), [`PDCryptAuthorizeProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCryptAuthorizeProc), [`PDCryptGetAuthDataProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCryptGetAuthDataProc) #### PDPrintWhat ```cpp typedef ASEnum8 PDPrintWhat ``` Header: `PDExpT.h:5644` #### PDSaveFlags ```cpp typedef ASEnum16 PDSaveFlags ``` Header: `PDExpT.h:1506` #### PDAuthProc ```cpp typedef ASBool(*) PDAuthProc(PDDoc pdDoc)(PDDoc pdDoc) ``` Header: `PDExpT.h:1264` A callback used by PDDocOpen. It is called when an encrypted document is being opened to determine whether the user is authorized to open the file. This callback implements whatever authorization strategy you choose and calls the callbacks of the appropriate security handler (the one that was used to secure the document) to obtain and check authorization data. The PDAuthProc() must call the security handler's PDCryptGetAuthDataProc() to obtain whatever authorization data is needed (such as a password), then call PDDocAuthorize() (which is mostly a call to the security handler's PDCryptAuthorizeProc()) to determine whether this data authorizes access to the file (for example, it verifies if the user provided the correct password). The PDAuthProc() must also free the authorization data by calling the security handler's PDCryptFreeAuthDataProc() (or ASfree(), if the handler does not have a PDCryptFreeAuthDataProc()). For Acrobat 3.0 and earlier, the correct way to obtain the security handler in a PDAuthProc() is to call PDDocGetNewCryptHandler(), relying on the fact that it returns the security handler if the document has no new security handler, and the fact that at the time the file is opened, it cannot yet have a new security handler (in the future, one or more new methods may be added to make this procedure more straightforward). The Acrobat viewer's built-in authorization procedure works according to the following algorithm: Call the security handler's PDCryptAuthorizeProc() with `NULL` authorization data to automatically handle the case where no authorization data is needed (for example, the file has a `NULL` password). If PDCryptAuthorizeProc() returns `true`, open the file. If PDCryptAuthorizeProc() returns `false` then Loop for `i = 1 to 3` {Call the security handler's PDCryptGetAuthDataProc(). If PDCryptGetAuthDataProc returns `true` { Call PDDocAuthorize(). If it returns `true` (authorized) call the security handler's PDCryptFreeAuthDataProc(). Exit the loop and return from PDAuthProc().} Call the security handler's PDCryptFreeAuthDataProc().} If it failed to get authorization after three attempts, display a dialog box indicating that user is not authorized to open the file. }return from PDAuthProc(). **See also:** [`PDDocAuthorize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocAuthorize), [`PDDocOpen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocOpen), [`PDDocOpenEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocOpenEx) #### PDAuthProcEx ```cpp typedef ASBool(*) PDAuthProcEx(PDDoc pdDoc, void *clientData)(PDDoc pdDoc, void *clientData) ``` Header: `PDExpT.h:1298` A callback used by PDDocOpenEx(). It is called when an encrypted document is opened, to determine whether the user is authorized to open the file. This callback implements whatever authorization strategy you choose and calls the callbacks of the appropriate security handler (the one that was used to secure the document) to obtain and check authorization data. The PDAuthProcEx() should obtain the authorization data (usually a password) and call PDDocAuthorize(). PDDocAuthorize() in turn calls the document encryption handler's `Authorize` function, which returns the permissions that the authorization data enables. PDDocAuthorize() adds these permissions to those currently allowed, and returns the new set of allowed permissions. **See also:** [`PDDocAuthorize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocAuthorize), [`PDDocOpen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocOpen), [`PDDocOpenEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocOpenEx) #### PDDocEnumProc ```cpp typedef ASBool(*) PDDocEnumProc(PDDoc pdDoc, void *clientData)(PDDoc pdDoc, void *clientData) ``` Header: `PDExpT.h:3689` A callback for PDEnumDocs(). It is called once for each open PDDoc. **See also:** [`PDEnumDocs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDEnumDocs) #### PDDocPreSaveProc ```cpp typedef void(*) PDDocPreSaveProc(PDDoc pdDoc, PDDocPreSaveInfo preSaveInfo, void *clientData)(PDDoc pdDoc, PDDocPreSaveInfo preSaveInfo, void *clientData) ``` Header: `PDExpT.h:1684` 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. **See also:** [`PDDocSaveWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSaveWithParams) #### PDDocPreWriteProc ```cpp typedef void(*) PDDocPreWriteProc(PDDoc pdDoc, void *clientData)(PDDoc pdDoc, void *clientData) ``` Header: `PDExpT.h:1694` A callback in the PDDocSaveParams structure. It is invoked by PDDocSaveWithParams() immediately before a PDDoc is saved to disk. **See also:** [`PDDocSaveWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSaveWithParams) #### PDDocRequestEntireFileProc ```cpp typedef ASInt32(*) PDDocRequestEntireFileProc(PDDoc pdDoc, PDDocRequestReason reason, void *clientData)(PDDoc pdDoc, PDDocRequestReason reason, void *clientData) ``` Header: `PDExpT.h:6557` A callback used by PDDocRequestEntireFile. Use this callback to process a document file. **See also:** [`PDDocRequestEntireFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocRequestEntireFile) #### PDDocRequestPagesProc ```cpp typedef ASInt32(*) PDDocRequestPagesProc(PDDoc pdDoc, ASInt32 startPage, ASInt32 nPages, PDDocRequestReason reason, void *clientData)(PDDoc pdDoc, ASInt32 startPage, ASInt32 nPages, PDDocRequestReason reason, void *clientData) ``` Header: `PDExpT.h:6536` A callback for PDDocRequestPages(). #### PDDocWillExportAnnotCallback ```cpp typedef ASBool(*) PDDocWillExportAnnotCallback(PDDoc doc, PDPage pdpage, PDAnnot src, CosObj dict)(PDDoc doc, PDPage pdpage, PDAnnot src, CosObj dict) ``` Header: `PDExpT.h:6224` A callback for PDDocExportNotes. It determines whether an annotation is exported. **Note:** This is a different callback than PDDocWillExportAnnotProc(). **See also:** [`PDDocWillImportAnnotCallback`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocWillImportAnnotCallback) #### PDDocWillExportAnnotProc ```cpp typedef ASBool(*) PDDocWillExportAnnotProc(PDAnnotHandler pdanh, PDAnnot src, PDAnnot dst)(PDAnnotHandler pdanh, PDAnnot src, PDAnnot dst) ``` Header: `PDExpT.h:628` A callback for PDAnnotHandler. It determines whether an annotation is exported. **Note:** This is a different callback than PDDocWillImportAnnotCallback(). **See also:** [`PDAnnotWillPrintProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotWillPrintProc), [`PDDocWillImportAnnotProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocWillImportAnnotProc), [`PDRegisterAnnotHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterAnnotHandler) #### PDDocWillImportAnnotCallback ```cpp typedef ASBool(*) PDDocWillImportAnnotCallback(PDDoc doc, PDPage pdPage, PDAnnot annot)(PDDoc doc, PDPage pdPage, PDAnnot annot) ``` Header: `PDExpT.h:6241` A callback for PDDocImportCosDocNotes() and PDDocImportNotes(). It determines whether an annotation will be imported. **Note:** This is a different callback than PDDocWillImportAnnotProc(). **See also:** [`PDDocWillExportAnnotCallback`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocWillExportAnnotCallback) #### PDDocWillImportAnnotProc ```cpp typedef ASBool(*) PDDocWillImportAnnotProc(PDAnnotHandler pdanh, PDDoc doc, PDPage pdpage, PDAnnot annot)(PDAnnotHandler pdanh, PDDoc doc, PDPage pdpage, PDAnnot annot) ``` Header: `PDExpT.h:646` A callback for PDAnnotHandler. It determines whether an annotation will be imported. **Note:** This is a different callback than PDDocWillImportAnnotCallback(). **See also:** [`PDAnnotWillPrintProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotWillPrintProc), [`PDDocWillExportAnnotProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocWillExportAnnotProc), [`PDRegisterAnnotHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterAnnotHandler) ### Structures (4) #### PDDoc ```cpp typedef struct _t_PDDoc* PDDoc ``` Header: `PDBasicExpT.h:68` 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`. **See also:** `AVDocGetPDDoc`, [`PDDocFromCosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocFromCosDoc), [`PDDocOpen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocOpen), [`PDDocOpenFromASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocOpenFromASFile), [`PDDocOpenWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocOpenWithParams), [`PDDocCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreate), [`PDPageGetDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetDoc), [`PDFileSpecGetDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileSpecGetDoc), [`PDEnumDocs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDEnumDocs), [`PDDocClose`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocClose), [`PDDocRelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocRelease), [`PDDocEnumFonts`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocEnumFonts), [`PDDocEnumLoadedFonts`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocEnumLoadedFonts) #### PDDocInsertPagesParams ```cpp typedef struct _t_PDDocInsertPagesParams* PDDocInsertPagesParams ``` Header: `PDExpT.h:1938` #### PDDocOpenParams ```cpp typedef struct _t_PDDocOpenParams* PDDocOpenParams ``` Header: `PDExpT.h:1946` A structure used by PDDocOpenWithParams() to specify file open information. The parameters are very similar to those in PDDocOpenEx() and PDDocOpenFromASFileEx(). **See also:** [`PDDocOpenWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocOpenWithParams) #### PDDocSaveParams ```cpp typedef struct _t_PDDocSaveParams* PDDocSaveParams ``` Header: `PDExpT.h:1854` ### Enums (5) #### PDDocOCChangeTypes Header: `PDExpT.h:5795` 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. **Values** - `kPDOCGCreate = 0`: Optional Content Groups (OCGs) created. - `kPDOCGProperties = 1`: OCG properties changed. - `kPDOCGReplace = 2`: An OCG was replaced by another. - `kPDOCGDestroy = 3`: An OCG was destroyed. - `kPDOCMDAttach = 4`: Content was made optional. - `kPDOCMDRemove = 5`: Content was made optional. - `kPDOCConfigCreate = 6`: An OC config was created. - `kPDOCConfigChange = 7`: An OC config was changed. - `kPDOCConfigDestroy = 8`: An OC config was destroyed. - `kPDDocRemoveOC = 9`: OC was removed from document. - `kPDOC_LastDocChangeType = kPDDocRemoveOC` #### PDDocRequestReasons Header: `PDExpT.h:6519` This tells the callback why it is being called. **Values** - `kPDDocRequestUnderway = 0`: The request is still being processed. - `kPDDocRequestComplete = 1`: The requested data has arrived. - `kPDDocRequestCancelled = 2`: The request is cancelled because the file is being closed. - `kPDDocRequestError = 3`: An error occurred. #### PDDocSaveFlags Header: `PDExpT.h:1449` Flags for the PDDocSave `saveFlags` parameter. All undefined flags should be set to zero. **Values** - `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. **See also:** [`PDDocSave`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSave), [`PDSaveFlags2`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDSaveFlags2) #### PDDocSaveFlags2 Header: `PDExpT.h:1516` 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. **Values** - `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. If `PDSaveAddFlate` and `PDSaveAddBrotli` are both set, only Flate is used. - `PDSaveReplaceLZW = 1 << 5`: Replace all LZW filters with FlateEncode filters, or, if `PDSaveAddBrotli` is also set, with BrotliEncode 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. - `PDSaveAddBrotli = 1 << 16`: Encode any unencoded stream with Brotli, except for metadata streams, which are never encoded, and for streams that would be larger if encoded. Object streams and cross-reference streams written by the save are Brotli-encoded as well, and, when `PDSaveReplaceLZW` is also set, LZW filters are replaced with BrotliEncode rather than FlateEncode. This flag is ignored if `PDSaveFull` is off. It is also ignored when `PDSaveAddFlate` is set, which takes precedence. Brotli compressed stream data (IETF RFC 7932) is written with the `BrotliDecode` filter, an extension to PDF 2.0 published by the PDF Association. It is not part of ISO 32000-2:2020 itself, so PDF processors that do not implement the extension cannot read the affected streams. Use it only when the consumers of the output are known to support it. **See also:** [`PDDocSave`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSave), [`PDSaveFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDSaveFlags) #### PDOperations Header: `PDExpT.h:974` 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. **Values** - `pdOpInsertPages = 0`: Page insertion. - `pdOpDeletePages = 1`: Page deletion. - `pdOpReplacePages = 2`: Page replacement. - `pdOpMovePages = 3`: Page rearrangment. - `pdOpRotatePages = 4`: Page rotation. - `pdOpCropPages = 5`: Page cropping. - `pdOpAddResources = 6`: Only PDDocDidChangePages() exists, not PDDocWillChangePages(). - `pdOpRemoveResources = 7`: Only PDDocDidChangePages() exists, not PDDocWillChangePages(). - `pdOpAddContents = 8`: Only PDDocDidChangePages() exists, not PDDocWillChangePages(). - `pdOpRemoveContents = 9`: Only PDDocDidChangePages() exists, not PDDocWillChangePages(). - `pdOpSetMediaBox = 10`: Page media box modification. - `pdOpSetBleedBox = 11`: Page bleed box modification. - `pdOpSetTrimBox = 12`: Page trim box modification. - `pdOpSetArtBox = 13`: Page art box modification. - `pdOpSetTabOrder = 14`: Page tab order modification. **See also:** [`PDDocDeletePages`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocDeletePages), [`PDDocInsertPages`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocInsertPages), [`PDDocMovePage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocMovePage), [`PDPageAddCosContents`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageAddCosContents), [`PDPageAddCosResource`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageAddCosResource), [`PDPageRemoveCosContents`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageRemoveCosContents), [`PDPageRemoveCosResource`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageRemoveCosResource), [`PDPageSetRotate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageSetRotate), [`PDPageSetCropBox`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageSetCropBox), [`PDPageSetMediaBox`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageSetMediaBox) ### Definitions (59) #### PDDocCreateTextSelect Header: `PDCalls.h:157` Value: `PDDocCreateTextSelectHost` #### PDDocGetWordFinder Header: `PDCalls.h:156` Value: `PDDocGetWordFinderHost` #### PDPermReqDenied Header: `PDExpT.h:4131` Value: `(PDPermReqStatus)(-1)` `-1` The request was denied. #### PDPermReqGranted Header: `PDExpT.h:4133` Value: `(PDPermReqStatus)(0)` `0` The request was granted. #### PDPermReqOperationNA Header: `PDExpT.h:4139` Value: `(PDPermReqStatus)(3)` `3` The operation is not applicable for the specified object. #### PDPermReqPending Header: `PDExpT.h:4143` Value: `(PDPermReqStatus)(4)` The handler does not have enough information to determine an answer at this point. Try again later. #### PDPermReqUnknownObject Header: `PDExpT.h:4135` Value: `(PDPermReqStatus)(1)` `1` The object is unknown. #### PDPermReqUnknownOperation Header: `PDExpT.h:4137` Value: `(PDPermReqStatus)(2)` `2` The operation is unknown. #### PDPermReqVersion Header: `PDExpT.h:4146` Value: `0x0004` #### STDSEC_CryptRevision1 Header: `PDExpT.h:4386` Value: `1` #### STDSEC_CryptRevision2 Header: `PDExpT.h:4387` Value: `2` #### STDSEC_CryptRevision3 Header: `PDExpT.h:4388` Value: `3` #### STDSEC_CryptRevision4 Header: `PDExpT.h:4389` Value: `4` #### STDSEC_CryptRevision5 Header: `PDExpT.h:4397` Value: `5` #### STDSEC_CryptRevision6 Header: `PDExpT.h:4399` Value: `6` #### STDSEC_CryptVersionV1 Header: `PDExpT.h:4377` Value: `1` #### STDSEC_CryptVersionV2 Header: `PDExpT.h:4378` Value: `2` #### STDSEC_CryptVersionV3 Header: `PDExpT.h:4379` Value: `3` #### STDSEC_CryptVersionV4 Header: `PDExpT.h:4381` Value: `4` #### STDSEC_CryptVersionV5 Header: `PDExpT.h:4383` Value: `5` New encryption method for Acrobat 9.0 #### STDSEC_KEYLENGTH_AES128 Header: `PDExpT.h:4372` Value: `16` #### STDSEC_KEYLENGTH_AES256 Header: `PDExpT.h:4374` Value: `32` New encryption method for Acrobat 9.0 #### STDSEC_KEYLENGTH_RC4_V1 Header: `PDExpT.h:4370` Value: `5` #### STDSEC_KEYLENGTH_RC4_V2 Header: `PDExpT.h:4371` Value: `16` #### STDSEC_METHOD_AES_V1 Header: `PDExpT.h:4365` Value: `5` #### STDSEC_METHOD_AES_V2 Header: `PDExpT.h:4366` Value: `6` #### STDSEC_METHOD_AES_V3 Header: `PDExpT.h:4368` Value: `7` New encryption method for Acrobat 9.0 #### STDSEC_METHOD_RC4_V2 Header: `PDExpT.h:4364` Value: `2` #### kPDDocReadAheadAcroForms Header: `PDExpT.h:4089` Value: `0x0001` 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). #### kPDDocReadAheadPageLabels Header: `PDExpT.h:4105` Value: `0x0004` 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. #### kPDDocReadAheadRenditions Header: `PDExpT.h:4116` Value: `0x0010` #### kPDDocReadAheadStructure Header: `PDExpT.h:4112` Value: `0x0008` 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. #### kPDDocReadAheadTemplates Header: `PDExpT.h:4097` Value: `0x0002` 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. #### pdInfoCanCopy Header: `PDExpT.h:4301` Value: `pdPermCopy` The document text and graphics can be copied to the clipboard. #### pdInfoCanEdit Header: `PDExpT.h:4296` Value: `pdPermEdit` The document can be modified (for example, by adding notes, links, or bookmarks). **See also:** [`pdInfoCanEditNotes`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#pdInfoCanEditNotes) #### pdInfoCanEditNotes Header: `PDExpT.h:4307` Value: `pdPermEditNotes` The document's notes, but nothing else, can be modified. **See also:** [`pdInfoCanEdit`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#pdInfoCanEdit) #### pdInfoCanPrint Header: `PDExpT.h:4290` Value: `pdPermPrint` The document can be printed. #### pdInfoHasOwnerPW Header: `PDExpT.h:4285` Value: `pdPermSecure` The document has an owner password. #### pdInfoHasUserPW Header: `PDExpT.h:4280` Value: `pdPermOpen` The document has a user password. #### pdOpAddResource Header: `PDExpT.h:1024` Value: `pdOpAddResources` #### pdOpRemoveResource Header: `PDExpT.h:1023` Value: `pdOpRemoveResources` #### pdPermAll Header: `PDExpT.h:1415` Value: `0xFFFFFFFF` #### pdPermCopy Header: `PDExpT.h:1331` Value: `0x10` The user can copy information from the document to the clipboard. In the document restrictions, this corresponds to the Content Copying or Extraction entry. #### pdPermEdit Header: `PDExpT.h:1324` Value: `0x08` 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. #### pdPermEditNotes Header: `PDExpT.h:1338` Value: `0x20` 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. #### pdPermExt Header: `PDExpT.h:1353` Value: `0x80` #### pdPermOpen Header: `PDExpT.h:1304` Value: `0x01` The user can open and decrypt the document. #### pdPermOwner Header: `PDExpT.h:1398` Value: `0x8000` 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. #### pdPermPrint Header: `PDExpT.h:1317` Value: `0x04` 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. #### pdPermSaveAs Header: `PDExpT.h:1348` Value: `0x40` 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. #### pdPermSecure Header: `PDExpT.h:1309` Value: `0x02` The user can change the document's security settings. #### pdPermSettable Header: `PDExpT.h:1421` Value: `(pdPermPrint + pdPermEdit + pdPermCopy + pdPermEditNotes)` The OR of all operations that can be set by the user in the security restrictions (pdPermPrint + pdPermEdit + pdPermCopy + pdPermEditNotes). #### pdPermUser Header: `PDExpT.h:1426` Value: `(pdPermAll - pdPermOpen - pdPermSecure)` All permissions. #### pdPrivPermAccessible Header: `PDExpT.h:1372` Value: `0x200` 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. #### pdPrivPermDocAssembly Header: `PDExpT.h:1378` Value: `0x400` Overrides various pdPermEdit bits and allows the following operations: page insert/delete/rotate and create bookmark and thumbnail. #### pdPrivPermFillandSign Header: `PDExpT.h:1365` Value: `0x100` Overrides other PDPerm bits. It allows the user to fill in or sign existing form or signature fields. #### pdPrivPermFormSpawnTempl Header: `PDExpT.h:1410` Value: `0x20000` 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. #### pdPrivPermFormSubmit Header: `PDExpT.h:1404` Value: `0x10000` This should be set if the user can submit forms outside of the browser. This bit is a supplement to pdPrivPermFillandSign. #### pdPrivPermHighPrint Header: `PDExpT.h:1385` Value: `0x800` 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. ## PDEFont ### Structures (1) #### PDEFont ```cpp typedef struct _t_PDEFont* PDEFont ``` Header: `PDExpT.h:6565` ## PDEObject ### Enums (1) #### PDEObjectStatusFlags Header: `PDExpT.h:7114` **Values** - `kStatus_UnpairedMC = 0x1` ## PDFLPrint ### Structures (1) #### PDTile ```cpp typedef struct PDTileRec * PDTile ``` Header: `PDExpT.h:6356` ## PDFileAttachment ### Functions (23) #### PDFileAttachmentFromCosObj ```cpp PDFileAttachment PDFileAttachmentFromCosObj(CosObj cosAttachment) ``` Header: `PDProcs.h:12156` Converts a file specification dictionary to a `PDFileAttachment` object. An exception is raised if the parameter is not a file specification dictionary. **Parameters** - `cosAttachment` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)) **Returns:** [`PDFileAttachment`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileAttachment) The file attachment object. #### PDFileAttachmentGetCosObj ```cpp CosObj PDFileAttachmentGetCosObj(PDFileAttachment attachment) ``` Header: `PDProcs.h:12162` Returns a `CosObj` representing the file specification dictionary of the file attachment. **Parameters** - `attachment` ([`PDFileAttachment`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileAttachment)): The file attachment object. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) The `CosObj` representation of the file attachment. #### PDFileAttachmentGetCreationDate ```cpp ASBool PDFileAttachmentGetCreationDate(PDFileAttachment attachment, ASTimeRec *date) ``` Header: `PDProcs.h:12189` Gets the creation date of the file attachment. **Parameters** - `attachment` ([`PDFileAttachment`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileAttachment)): The file attachment object. - `date` (`ASTimeRec *`): A pointer to a date that will receive the creation date. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the file attachment has a creation date, `false` otherwise. A creation date may be absent for various reasons. For example, the file attachment may have originated from a file system that does not provide creation date information, such as Unix. #### PDFileAttachmentGetFieldDate ```cpp ASBool PDFileAttachmentGetFieldDate(PDFileAttachment attachment, ASAtom fieldID, ASTimeRec *date) ``` Header: `PDProcs.h:12287` Gets the value of the specified date field in the file attachment. **Parameters** - `attachment` ([`PDFileAttachment`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileAttachment)): The file attachment. - `fieldID` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The field identifier. - `date` (`ASTimeRec *`): The date that will receive the field value. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the field value was found, `false` otherwise. #### PDFileAttachmentGetFieldNumber ```cpp ASBool PDFileAttachmentGetFieldNumber(PDFileAttachment attachment, ASAtom fieldID, float *number) ``` Header: `PDProcs.h:12270` Gets the value of the specified numeric field in the file attachment. **Parameters** - `attachment` ([`PDFileAttachment`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileAttachment)): The file attachment. - `fieldID` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The field identifier. - `number` (`float *`): The number that will receive the field value. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the field value was found, `false` otherwise. #### PDFileAttachmentGetFieldPrefix ```cpp ASBool PDFileAttachmentGetFieldPrefix(PDFileAttachment attachment, ASAtom fieldName, ASText prefix) ``` Header: `PDProcs.h:12304` Gets the specified prefix field in the file attachment. **Parameters** - `attachment` ([`PDFileAttachment`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileAttachment)): The file attachment. - `fieldName` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)) - `prefix` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): The text object that will receive the prefix. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) #### PDFileAttachmentGetFieldStyle ```cpp ASBool PDFileAttachmentGetFieldStyle(PDFileAttachment attachment, ASAtom fieldID, ASCab styles) ``` Header: `PDProcs.h:12253` Gets the value of the specified text field in the file attachment. **Parameters** - `attachment` ([`PDFileAttachment`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileAttachment)): The file attachment. - `fieldID` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The field identifier. - `styles` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)): ASCab object that will receive the field styles **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the field value was found, `false` otherwise. #### PDFileAttachmentGetFieldStyledText ```cpp ASBool PDFileAttachmentGetFieldStyledText(PDFileAttachment attachment, ASAtom fieldID, ASText text) ``` Header: `PDProcs.h:12236` Gets the value of the specified text field in the file attachment as styled text, in XML Text Layout Format. **Parameters** - `attachment` ([`PDFileAttachment`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileAttachment)): The file attachment. - `fieldID` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The field identifier. - `text` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): The text object that will receive the field value. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the field value was found, `false` otherwise. #### PDFileAttachmentGetFieldText ```cpp ASBool PDFileAttachmentGetFieldText(PDFileAttachment attachment, ASAtom fieldID, ASText text) ``` Header: `PDProcs.h:12228` Gets the value of the specified text field in the file attachment. **Parameters** - `attachment` ([`PDFileAttachment`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileAttachment)): The file attachment. - `fieldID` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The field identifier. - `text` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): The text object that will receive the field value. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the field value was found, `false` otherwise. #### PDFileAttachmentGetFileName ```cpp ASText PDFileAttachmentGetFileName(PDFileAttachment attachment) ``` Header: `PDProcs.h:12202` Gets the file name of the file attachment. **Parameters** - `attachment` ([`PDFileAttachment`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileAttachment)): The file attachment. **Returns:** [`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText) An `ASText` copy of the file name of the file attachment. #### PDFileAttachmentGetFileSize ```cpp ASUns32 PDFileAttachmentGetFileSize(PDFileAttachment attachment) ``` Header: `PDProcs.h:12179` Returns the size, in bytes, that the file will occupy if exported to disk. **Parameters** - `attachment` ([`PDFileAttachment`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileAttachment)): The file attachment object **Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32) The size of the file attachment. It returns `0` if the `PDFileAttachment` object does not specify a file size and one cannot be determined. #### PDFileAttachmentGetModDate ```cpp ASBool PDFileAttachmentGetModDate(PDFileAttachment attachment, ASTimeRec *date) ``` Header: `PDProcs.h:12196` Gets the modification date of the file attachment. **Parameters** - `attachment` ([`PDFileAttachment`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileAttachment)): The file attachment object. - `date` (`ASTimeRec *`): A pointer to a date that will receive the modification date. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the file attachment has a modification date, `false` otherwise. #### PDFileAttachmentIsValid ```cpp ASBool PDFileAttachmentIsValid(PDFileAttachment attachment) ``` Header: `PDProcs.h:12070` Tests a file attachment for validity. **Parameters** - `attachment` ([`PDFileAttachment`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileAttachment)): The file attachment. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the file attachment is a dictionary, `false` otherwise. #### PDFileAttachmentNewFromFile ```cpp PDFileAttachment PDFileAttachmentNewFromFile(CosDoc parentDoc, ASFile sourceFile, const ASAtom *filterNames, const ASArraySize numFilters, CosObj filterParams, ASProgressMonitor monitor, ASConstText monitorText, void *monitorData) ``` Header: `PDProcs.h:12115` Creates a new file attachment from the given file. The resulting file specification dictionary is created for the given document, but is not referenced. The client must reference the resulting file specification dictionary by attaching it to another object in the PDF file, such as an annotation or name tree. An exception is raised if the file could not be read or the attachment stream could not be created. Note that permissions must be checked by the caller before invoking this function. For example, to have an attachment flate compressed and then ASCII base-85 encoded: ASAtom filterNames[2]; filterNames[0] = ASAtomFromString("ASCII85Decode"); filterNames[1] = ASAtomFromString("FlateDecode"); PDFileAttachmentNewFromFile(parentDoc, sourceFile, filterNames, 2, CosNewNull(), NULL, NULL, NULL); You can find this document on the web store of the International Standards Organization (ISO). **Parameters** - `parentDoc` ([`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc)): The `CosDoc` in which the file attachment dictionary will be created. - `sourceFile` ([`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): The `ASFile` from which to create the file attachment. - `filterNames` ([`const ASAtom *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): An array of filters to apply to the file attachment stream. Filters are indentified by name. See the description of Filters in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.4, page 22. - `numFilters` ([`const ASArraySize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASArraySize)): The number of elements in `filterNames`. - `filterParams` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The filter parameters, represented as a `CosArray` or `CosNull`. When the array form is used, the array must contain the same number of elements as `filterNames`. Each element in the `CosArray` is a `CosDict` representing the filter parameters for the corresponding filter in the `filterNames` array, or `CosNull` to indicate that default parameters should be used for that filter. When the `CosNull` form is used for `filterParams`, default parameters are used for every filter in the filterNames array. - `monitor` (`ASProgressMonitor`): The `ASProgressMonitor` to use for the duration of the call. The monitor object is owned by the caller. `NULL` indicates that no progress updates are needed. - `monitorText` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): The text for the monitor to display, or `NULL` if no text is needed. The text object is owned by the caller. - `monitorData` (`void *`): Opaque data that is specific to the monitor object. **Returns:** [`PDFileAttachment`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileAttachment) The new file attachment. #### PDFileAttachmentOpenStream ```cpp ASStm PDFileAttachmentOpenStream(PDFileAttachment attachment) ``` Header: `PDProcs.h:12170` Returns a stream for reading the data from an existing file attachment. An exception is raised if the file attachment does not have a stream (it is not embedded) or the stream could not be opened. The caller is responsible for closing the returned stream. **Parameters** - `attachment` ([`PDFileAttachment`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileAttachment)): The file attachment object. **Returns:** [`ASStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStm) The file attachment stream. #### PDFileAttachmentSaveToFile ```cpp void PDFileAttachmentSaveToFile(PDFileAttachment attachment, ASFile destFile) ``` Header: `PDProcs.h:12149` Copies the data embedded in the file attachment to the specified file. The file must be open for write or append. The caller is responsible for closing the file after this call returns. If an error is encountered during the write, some data may have been written to the destination file. This call will make no attempt at restoring the file after failure. An exception is raised if the file attachment has no embedded stream or if a file write error occurs. **Parameters** - `attachment` ([`PDFileAttachment`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileAttachment)): The file attachment. - `destFile` ([`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): The file that will be written with the file attachment data. **Returns:** `void` #### PDFileAttachmentSetFieldDate ```cpp void PDFileAttachmentSetFieldDate(PDFileAttachment attachment, ASAtom fieldID, const ASTimeRec *date) ``` Header: `PDProcs.h:12279` Sets the specified date field in the file attachment. **Parameters** - `attachment` ([`PDFileAttachment`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileAttachment)): The file attachment. - `fieldID` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The field identifier. - `date` (`const ASTimeRec *`): The date to use as the new value for the specified field. **Returns:** `void` **Exceptions** - `genErrBadParm`: is raised if the field does not exist in the collection schema or the field type is not `D` (date). #### PDFileAttachmentSetFieldNumber ```cpp void PDFileAttachmentSetFieldNumber(PDFileAttachment attachment, ASAtom fieldID, float number) ``` Header: `PDProcs.h:12262` Sets the specified numeric field in the file attachment. **Parameters** - `attachment` ([`PDFileAttachment`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileAttachment)): The file attachment. - `fieldID` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The field identifier. - `number` (`float`): The number to use as the new value for the specified field. **Returns:** `void` **Exceptions** - `genErrBadParm`: is raised if the field does not exist in the collection schema or the field type is not `N` (number). #### PDFileAttachmentSetFieldPrefix ```cpp void PDFileAttachmentSetFieldPrefix(PDFileAttachment attachment, ASAtom fieldName, ASText text) ``` Header: `PDProcs.h:12297` Sets the specified prefix field in the file attachment. The prefix allows additional text to be prepended to the visual appearance of a field without affecting its actual value. **Parameters** - `attachment` ([`PDFileAttachment`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileAttachment)): The file attachment. - `fieldName` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The field identifier. - `text` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): The prefix to use as the new value for the specified field. Note that if a `NULL` value is passed into this parameter, the prefix is removed and an exception will not be thrown. **Returns:** `void` **Exceptions** - `genErrBadParm`: is raised if the field does not exist in the collection schema. #### PDFileAttachmentSetFieldStyle ```cpp void PDFileAttachmentSetFieldStyle(PDFileAttachment attachment, ASAtom fieldID, ASConstCab styles) ``` Header: `PDProcs.h:12245` Sets the specified text field in the file attachment using styled text. **Parameters** - `attachment` ([`PDFileAttachment`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileAttachment)): The file attachment. - `fieldID` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The field identifier. - `styles` ([`ASConstCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstCab)): ASConstCab containing field styles for the specified field. **Returns:** `void` **Exceptions** - `genErrBadParm`: is raised if the field does not exist in the collection schema or the field type is not `S` (text). #### PDFileAttachmentSetFieldStyledText ```cpp void PDFileAttachmentSetFieldStyledText(PDFileAttachment attachment, ASAtom fieldID, ASConstText text) ``` Header: `PDProcs.h:12220` Sets the specified text field in the file attachment using styled text. **Parameters** - `attachment` ([`PDFileAttachment`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileAttachment)): The file attachment. - `fieldID` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The field identifier. - `text` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): Text Layout Format XML containing the text to use as the new value for the specified field. **Returns:** `void` **Exceptions** - `genErrBadParm`: is raised if the field does not exist in the collection schema or the field type is not `S` (text). #### PDFileAttachmentSetFieldText ```cpp void PDFileAttachmentSetFieldText(PDFileAttachment attachment, ASAtom fieldID, ASText text) ``` Header: `PDProcs.h:12211` Sets the specified text field in the file attachment. **Parameters** - `attachment` ([`PDFileAttachment`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileAttachment)): The file attachment. - `fieldID` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The field identifier. - `text` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): The text to use as the new value for the specified field. **Returns:** `void` **Exceptions** - `genErrBadParm`: is raised if the field does not exist in the collection schema or the field type is not `S` (text). #### PDFileAttachmentUpdateFromFile ```cpp void PDFileAttachmentUpdateFromFile(PDFileAttachment attachment, ASFile sourceFile, ASProgressMonitor monitor, ASConstText monitorText, void *monitorData) ``` Header: `PDProcs.h:12135` Updates a file attachment from the given file. The attachment uses the filters specified in the attachment to encode the data. An exception is raised if the file could not be read or the attachment stream could not be updated. Note that permissions must be checked by the caller before invoking this function. **Parameters** - `attachment` ([`PDFileAttachment`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileAttachment)): The file attachment. - `sourceFile` ([`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): The file to use as input for the update operation. - `monitor` (`ASProgressMonitor`): The `ASProgressMonitor` to use for the duration of the call. The monitor object is owned by the caller. `NULL` indicates that no progress updates are needed. - `monitorText` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): The text for the monitor to display, or `NULL` if no text is needed. The text object is owned by the caller. - `monitorData` (`void *`): Opaque data that is specific to the monitor object. **Returns:** `void` ### Typedefs (1) #### PDFileAttachment ```cpp typedef OPAQUE_64_BITS PDFileAttachment ``` Header: `PDExpT.h:6997` A `PDFileAttachment` represents an embedded file stored in a PDF file, and may be stored at various locations in a PDF file, including the `EmbeddedFiles` name tree, `FileAttachment` annotation types, and `Multimedia` annotations. **See also:** [`PDFileAttachmentNewFromFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileAttachmentNewFromFile), [`PDFileAttachmentUpdateFromFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileAttachmentUpdateFromFile), [`PDFileAttachmentSaveToFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileAttachmentSaveToFile) ## PDFileSpec ### Functions (14) #### PDFileSpecAcquireASPath ```cpp ASPathName PDFileSpecAcquireASPath(PDFileSpec fileSpec, ASPathName relativeToThisPath) ``` Header: `PDProcs.h:5264` Acquires an ASPathName for the specified file specification and relative path. **Parameters** - `fileSpec` ([`PDFileSpec`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileSpec)): IN/OUT The file specification for which an ASPathName is acquired. - `relativeToThisPath` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): IN/OUT A path name relative to which the `fileSpec` is interpreted. If it is `NULL`, `fileSpec` is assumed to be an absolute, not a relative, path. After you are done using the ASPathName, you must free it using ASFileSysReleasePath(). **Returns:** [`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName) The ASPathName corresponding to `fileSpec`. **See also:** [`ASFileSysReleasePath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysReleasePath) #### PDFileSpecAcquireASPathEx ```cpp ASPathName PDFileSpecAcquireASPathEx(PDFileSpec fileSpec, ASFileSys relPathFileSys, ASPathName relativeToThisPath, ASFileSys *retFileSys, ASBool pathMustExist) ``` Header: `PDProcs.h:11411` Acquires an ASPathName for the specified file specification and relative path. After you are done using the ASPathName, you must free it using ASFileSysReleasePath(). **Parameters** - `fileSpec` ([`PDFileSpec`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileSpec)): IN/OUT The file specification for which an ASPathName is acquired. - `relPathFileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): The file system that owns `relativeToThisPath`. - `relativeToThisPath` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): IN/OUT A path name relative to which the `fileSpec` is interpreted. If it is `NULL`, `fileSpec` is assumed to be an absolute, not a relative, path. If it is not `NULL` and `fileSys` and `relPathFileSys` are not the same, then an attempt is made to fabricate a `relPathName` in terms of `fileSys`, and if that is not possible, `NULL` is used. - `retFileSys` ([`ASFileSys *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): IN/OUT The file system that owns the returned ASPathName. - `pathMustExist` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): IN/OUT If it is `true` and the result ASPathName does not exist, then the return value is `NULL`. **Returns:** [`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName) The ASPathName corresponding to `fileSpec`. **See also:** [`ASFileSysReleasePath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSysReleasePath) #### PDFileSpecFromCosObj ```cpp PDFileSpec PDFileSpecFromCosObj(CosObj obj) ``` Header: `PDProcs.h:5233` Converts an appropriate string or dictionary Cos object to a file specification. This method does not copy the object, but is instead the logical equivalent of a type cast. **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): IN/OUT The Cos object to convert to a file specification. **Returns:** [`PDFileSpec`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileSpec) The file specification corresponding to `obj`. **Exceptions** - `pdErrBadFileSpec`: is raised if the file specification is not valid, as determined by PDFileSpecIsValid(). **See also:** [`PDFileSpecGetCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileSpecGetCosObj), [`PDFileSpecIsValid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileSpecIsValid) #### PDFileSpecGetCosObj ```cpp CosObj PDFileSpecGetCosObj(PDFileSpec fileSpec) ``` Header: `PDProcs.h:5278` Gets the Cos object associated with a file specification. This method does not copy the object, but is instead the logical equivalent of a type cast. **Parameters** - `fileSpec` ([`PDFileSpec`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileSpec)): IN/OUT The file specification whose Cos object is obtained. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) The string or dictionary Cos object corresponding to the file specification. **See also:** [`PDFileSpecFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileSpecFromCosObj) #### PDFileSpecGetDIPath ```cpp ASInt32 PDFileSpecGetDIPath(PDFileSpec fileSpec, char *buffer, ASInt32 bufLen) ``` Header: `PDProcs.h:5336` Gets the device-independent path name from a file specification. **Parameters** - `fileSpec` ([`PDFileSpec`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileSpec)): IN/OUT The file specification whose device-independent path name is obtained. - `buffer` (`char *`): IN/OUT (Filled by the method) `NULL`-terminated device- independent path name. If `buffer` is `NULL`, the method simply returns the length of the path name. - `bufLen` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN/OUT The length of `buffer` in bytes. If the device- independent path name is longer than this, only the first `bufLen - 1` bytes are copied into `buffer`, plus a `NULL` at the end of the buffer. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The number of characters (excluding the `NULL`) copied into `buffer`. #### PDFileSpecGetDIPathEx ```cpp void PDFileSpecGetDIPathEx(PDFileSpec fileSpec, ASText diPath) ``` Header: `PDProcs.h:11425` Gets the device-independent path name from a file specification. **Parameters** - `fileSpec` ([`PDFileSpec`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileSpec)): IN The file specification whose device-independent path name is obtained. - `diPath` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): IN/OUT An existing ASText object whose content is set to the path name obtained from from `fileSpec`. **Returns:** `void` #### PDFileSpecGetDoc ```cpp PDDoc PDFileSpecGetDoc(PDFileSpec fileSpec) ``` Header: `PDProcs.h:5558` Gets the PDDoc that contains `fileSpec`. **Parameters** - `fileSpec` ([`PDFileSpec`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileSpec)): IN/OUT A PDFileSpec in a document. **Returns:** [`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc) A PDDoc or `NULL` if the file specification CosObj is not in a document. #### PDFileSpecGetFileSys ```cpp ASFileSys PDFileSpecGetFileSys(PDFileSpec fileSpec) ``` Header: `PDProcs.h:5245` Gets the file system that services the specified file specification. **Parameters** - `fileSpec` ([`PDFileSpec`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileSpec)): IN/OUT The file specification whose file system is obtained. **Returns:** [`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys) The file system that services `fileSpec`. **See also:** [`PDFileSpecGetFileSysName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileSpecGetFileSysName) #### PDFileSpecGetFileSysName ```cpp ASAtom PDFileSpecGetFileSysName(PDFileSpec fileSpec) ``` Header: `PDProcs.h:5578` Gets the name of the file system that a PDFileSpec belongs to. For a simple `fileSpec` (string form), the name of the file system is the name of the document's file system if the CosObj that is the `fileSpec` is contained in a document. For a complex `fileSpec` (dictionary form) with an FS key, the name of the file system is the atom associated with the FS key. The file system returned by PDFileSpecGetFileSys() is the file system that has registered a PDFileSpecHandler() for the file specification's file system name (if there is one), and is not necessarily the same as `ASFileGetFileSysByName(PDFileSpecGetFileSysName(fileSpec));` . **Parameters** - `fileSpec` ([`PDFileSpec`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileSpec)): A PDFileSpec. **Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom) An ASAtom representing the file system of `fileSpec`. **See also:** [`PDFileSpecGetFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileSpecGetFileSys) #### PDFileSpecIsValid ```cpp ASBool PDFileSpecIsValid(PDFileSpec fileSpec) ``` Header: `PDProcs.h:5290` Tests whether a file specification is valid. This is intended only to ensure that the file specification has not been deleted, not to ensure that all necessary information is present and valid. **Parameters** - `fileSpec` ([`PDFileSpec`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileSpec)): The file specification whose validity is tested. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if `fileSpec` is valid, `false` otherwise. #### PDFileSpecNewFromASPath ```cpp PDFileSpec PDFileSpecNewFromASPath(PDDoc pdDoc, ASFileSys fileSys, ASPathName path, ASPathName relativeToThisPath) ``` Header: `PDProcs.h:5217` Creates a new file specification from the specified ASPathName, using the PDFileSpecNewFromASPathProc() of the specified file system's file specification handler. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document in which the new file specification will be used. - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): A pointer to an `ASFileSysRec` specifying the file system responsible for the newly created file specification. - `path` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): The path to convert into a file specification. - `relativeToThisPath` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): A path name relative to which `path` is interpreted. If it is `NULL`, `path` is interpreted as an absolute path name, not a relative path name. **Returns:** [`PDFileSpec`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileSpec) The newly created file spec, or an invalid file spec if the ASPathName cannot be converted to a PDFileSpec (use PDFileSpecIsValid() to test whether the conversion was successful). **See also:** [`PDFileSpecIsValid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileSpecIsValid) #### PDFileSpecNewFromASPathEx ```cpp PDFileSpec PDFileSpecNewFromASPathEx(PDDoc pdDoc, ASFileSys fileSys, ASPathName path, ASFileSys relPathFileSys, ASPathName relativeToThisPath) ``` Header: `PDProcs.h:11385` Creates a new file specification from the specified ASPathName, using the PDFileSpecNewFromASPathProc() of the specified file system's file specification handler. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document in which the new file specification will be used. - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): A pointer to an `ASFileSysRec` specifying the file system responsible for the newly created file specification. - `path` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): The path to convert into a file specification. - `relPathFileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): The file system that owns `relativeToThisPath`. - `relativeToThisPath` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): A path name relative to which the `fileSpec` is interpreted. If it is `NULL`, `fileSpec` is assumed to be an absolute, not a relative, path. If it is not `NULL` and `fileSys` and `relPathFileSys` are not the same, then an attempt is made to fabricate a `relPathName` in terms of `fileSys`, and if that is not possible, `NULL` is used. **Returns:** [`PDFileSpec`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileSpec) The newly created file specification, or an invalid file specification if the ASPathName cannot be converted to a PDFileSpec (use PDFileSpecIsValid() to test whether the conversion was successful). **See also:** [`PDFileSpecIsValid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileSpecIsValid) #### PDRegisterFileSpecHandler ```cpp void PDRegisterFileSpecHandler(ASFileSys contextFileSys, PDFileSpecHandler fileSpecHandler, void *fileSpecHandlerObj) ``` Header: `PDProcs.h:5317` Registers a new file specification handler with the Acrobat viewer. In version 3.0 and later of the Acrobat viewer, use the PDRegisterFileSpecHandlerByName method instead. **Parameters** - `contextFileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): The file system that specifies the context in which the file specification handler is used. This is the file system on which the PDF document resides. It is sometimes necessary to use different file specification handlers depending on the file system in which the document is open. For example, when a document is opened in a web browser, the Acrobat viewer may use the browser's HTTP stack when it needs to use HTTP. When a document is opened outside of the browser, however, the Acrobat viewer must use a different HTTP stack. - `fileSpecHandler` (`PDFileSpecHandler`): A pointer to a structure that contains the handler's callbacks. This structure must not be freed after calling PDRegisterFileSpecHandler(). - `fileSpecHandlerObj` (`void *`): A pointer to user-supplied data to pass to the file specification handler's callbacks each time they are called. **Returns:** `void` **Exceptions** - `genErrNoMemory` **See also:** [`PDRegisterFileSpecHandlerByName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterFileSpecHandlerByName) #### PDRegisterFileSpecHandlerByName ```cpp void PDRegisterFileSpecHandlerByName(ASAtom specSysName, ASFileSys contextFileSys, PDFileSpecHandler fileSpecHandler, void *fileSpecHandlerObj) ``` Header: `PDProcs.h:5616` Registers a new file specification handler with the Acrobat viewer. The viewer calls the appropriate file specification handler when it encounters a file specification in a PDF file. The appropriate file specification handler is the one whose `specSysName` matches the value of the FS key in the file specification and whose `contextFileSys` matches the file system on which the PDF file resides. The file specification handler's file system, (passed as the `fileSys` field of `fileSpecHandler`), is used to obtain data from, or write data to, the file referred to by the file specification. **Parameters** - `specSysName` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The name (as an ASAtom) of a file system with which this file specification works. - `contextFileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): The file system that specifies the context in which the file specification handler is used. This is the file system on which the PDF document resides. It is sometimes necessary to use different file specification handlers depending on the file system in which the document is open. For example, when a document is opened in a web broswer, the Acrobat viewer may use the browser's HTTP stack when it needs to use HTTP. When a document is opened outside of the browser, however, the Acrobat viewer must use a different HTTP stack. - `fileSpecHandler` (`PDFileSpecHandler`): A pointer to a structure that contains the handler's callbacks. This structure must not be freed after calling PDRegisterFileSpecHandlerByName(). - `fileSpecHandlerObj` (`void *`): A pointer to user-supplied data to pass to the file specification handler's callbacks each time they are called. **Returns:** `void` **Exceptions** - `genErrNoMemory` **See also:** [`PDRegisterFileSpecHandler`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRegisterFileSpecHandler) ### Typedefs (3) #### PDFileSpec ```cpp typedef OPAQUE_64_BITS PDFileSpec ``` Header: `PDExpT.h:1123` The PDF file specification object. It is used to specify a file in an action (see PDAction). A file specification in a PDF file can take two forms: • A single platform-independent path. • A data structure containing one or more alternative ways to locate the file on different platforms. PDFileSpec objects can be created from ASPathName objects or from Cos objects. **See also:** [`PDActionGetFileSpec`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionGetFileSpec), [`PDFileSpecNewFromASPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileSpecNewFromASPath), [`PDFileSpecFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileSpecFromCosObj) #### PDFileSpecAcquireASPathProc ```cpp typedef ASPathName(*) PDFileSpecAcquireASPathProc(void *fileSpecHandlerObj, PDFileSpec fileSpec, ASPathName relativeToThisPath)(void *fileSpecHandlerObj, PDFileSpec fileSpec, ASPathName relativeToThisPath) ``` Header: `PDExpT.h:1164` A callback for PDFileSpecHandler. It aquires the ASPath corresponding to a file specification. **See also:** [`PDFileSpecAcquireASPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileSpecAcquireASPath) #### PDFileSpecNewFromASPathProc ```cpp typedef PDFileSpec(*) PDFileSpecNewFromASPathProc(void *fileSpecHandlerObj, PDDoc pdDoc, ASPathName path, ASPathName relativeToThisPath)(void *fileSpecHandlerObj, PDDoc pdDoc, ASPathName path, ASPathName relativeToThisPath) ``` Header: `PDExpT.h:1147` A callback for PDFileSpecHandler. It creates a file specification from an ASPath. **Parameters** - `fileSpecHandlerObj`: User-supplied data passed in the call to PDRegisterFileSpecHandler(). - `pdDoc`: The PDDoc in which the file specification is created. - `path`: The ASPathName for which a corresponding file specification is created. - `relativeToThisPath`: A path name relative to which path is interpreted. If `NULL`, `path` is assumed to be an absolute path, not a relative path. **See also:** [`PDFileSpecNewFromASPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileSpecNewFromASPath) ## PDFolder ### Functions (27) #### PDFolderGetCreationDate ```cpp ASBool PDFolderGetCreationDate(PDFolder folder, ASTimeRec *date) ``` Header: `PDProcs.h:12536` Gets the creation date of the folder. **Parameters** - `folder` ([`PDFolder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFolder)): The folder. - `date` (`ASTimeRec *`): A pointer to an `ASTimeRec` that will be filled with the folder creation date. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the folder has a creation date, `false` otherwise. #### PDFolderGetDescription ```cpp ASBool PDFolderGetDescription(PDFolder folder, ASText text) ``` Header: `PDProcs.h:12549` Gets the description of the folder. **Parameters** - `folder` ([`PDFolder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFolder)): The folder. - `text` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): A text object that will receive the folder description. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the folder has a description, `false` otherwise. #### PDFolderGetDescriptionStyled ```cpp ASBool PDFolderGetDescriptionStyled(PDFolder folder, ASText text) ``` Header: `PDProcs.h:12556` Gets the description of the folder as styled text, in XML Text Layout Format. **Parameters** - `folder` ([`PDFolder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFolder)): The folder. - `text` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): A text object that will receive the folder description. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the folder has a description, `false` otherwise. #### PDFolderGetFieldDate ```cpp ASBool PDFolderGetFieldDate(PDFolder folder, ASAtom fieldID, ASTimeRec *date) ``` Header: `PDProcs.h:12645` Gets the value of the specified date field in the folder. **Parameters** - `folder` ([`PDFolder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFolder)): The folder. - `fieldID` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The field identifier. - `date` (`ASTimeRec *`): The date that will receive the field value **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the field value was found, `false` otherwise. #### PDFolderGetFieldNumber ```cpp ASBool PDFolderGetFieldNumber(PDFolder folder, ASAtom fieldID, float *number) ``` Header: `PDProcs.h:12628` Gets the value of the specified numeric field in the folder. **Parameters** - `folder` ([`PDFolder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFolder)): The folder. - `fieldID` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The field identifier. - `number` (`float *`): The number that will receive the field value. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the field value was found, `false` otherwise. #### PDFolderGetFieldStyle ```cpp ASBool PDFolderGetFieldStyle(PDFolder folder, ASAtom fieldID, ASCab styles) ``` Header: `PDProcs.h:12620` Gets the style dictionary for the specified field in the folder **Parameters** - `folder` ([`PDFolder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFolder)): The folder. - `fieldID` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The field identifier. - `styles` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)): ASCab object that will receive the field styles **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the field value was found, `false` otherwise. #### PDFolderGetFieldStyledText ```cpp ASBool PDFolderGetFieldStyledText(PDFolder attachment, ASAtom fieldID, ASText text) ``` Header: `PDProcs.h:12603` Gets the value of the specified text field in the folder as styled text, in XML Text Layout Format. **Parameters** - `attachment` ([`PDFolder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFolder)) - `fieldID` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The field identifier. - `text` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): The text object that will receive the field value. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the field value was found, `false` otherwise. #### PDFolderGetFieldText ```cpp ASBool PDFolderGetFieldText(PDFolder folder, ASAtom fieldID, ASText text) ``` Header: `PDProcs.h:12577` Gets the value of the specified text field in the folder. **Parameters** - `folder` ([`PDFolder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFolder)): The folder. - `fieldID` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The field identifier. - `text` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): The text object that will receive the field value. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the field value was found, `false` otherwise. #### PDFolderGetFirstChild ```cpp PDFolder PDFolderGetFirstChild(PDFolder folder) ``` Header: `PDProcs.h:12486` Gets the first child of a folder. **Parameters** - `folder` ([`PDFolder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFolder)): The folder. **Returns:** [`PDFolder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFolder) The first child of the folder. If no child exists, the returned folder is invalid. #### PDFolderGetID ```cpp ASInt32 PDFolderGetID(PDFolder folder) ``` Header: `PDProcs.h:12510` Gets the ID number of a folder. **Parameters** - `folder` ([`PDFolder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFolder)): The folder. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The folder ID. #### PDFolderGetModDate ```cpp ASBool PDFolderGetModDate(PDFolder folder, ASTimeRec *date) ``` Header: `PDProcs.h:12523` Gets the modification date of the folder. **Parameters** - `folder` ([`PDFolder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFolder)): The folder. - `date` (`ASTimeRec *`): A pointer to an `ASTimeRec` that will be filled with the folder modification date. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the folder has a modification date, `false` otherwise. #### PDFolderGetName ```cpp void PDFolderGetName(PDFolder folder, ASText name) ``` Header: `PDProcs.h:12504` Gets the name of a folder. **Parameters** - `folder` ([`PDFolder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFolder)): The folder. - `name` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)) **Returns:** `void` #### PDFolderGetNextSibling ```cpp PDFolder PDFolderGetNextSibling(PDFolder folder) ``` Header: `PDProcs.h:12492` Gets the next sibling of a folder. **Parameters** - `folder` ([`PDFolder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFolder)): The folder. **Returns:** [`PDFolder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFolder) The next sibling of the folder. If no next sibling exists, the returned folder is invalid. #### PDFolderGetParent ```cpp PDFolder PDFolderGetParent(PDFolder folder) ``` Header: `PDProcs.h:12474` Gets the parent of the specified folder. **Parameters** - `folder` ([`PDFolder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFolder)): The folder object. **Returns:** [`PDFolder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFolder) The parent of the specified folder. If no parent exists, the returned folder is invalid. #### PDFolderGetPathText ```cpp void PDFolderGetPathText(PDFolder folder, ASText path) ``` Header: `PDProcs.h:12516` Gets the path of the folder. **Parameters** - `folder` ([`PDFolder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFolder)): The folder. - `path` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): The folder path. **Returns:** `void` #### PDFolderIsValid ```cpp ASBool PDFolderIsValid(PDFolder folder) ``` Header: `PDProcs.h:12416` Determines if a `PDFolder` is valid. **Parameters** - `folder` ([`PDFolder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFolder)): The folder object **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the folder is a dictionary, `false` otherwise. #### PDFolderSetCreationDate ```cpp void PDFolderSetCreationDate(PDFolder folder, const ASTimeRec *date) ``` Header: `PDProcs.h:12542` Sets the creation date of the folder. **Parameters** - `folder` ([`PDFolder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFolder)): The folder. - `date` (`const ASTimeRec *`): A pointer to an `ASTimeRec` will be used to set the creation date. **Returns:** `void` #### PDFolderSetDescription ```cpp void PDFolderSetDescription(PDFolder folder, ASConstText text) ``` Header: `PDProcs.h:12562` Sets the description of the folder. Removes a styled version if present. **Parameters** - `folder` ([`PDFolder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFolder)): The folder. - `text` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): The new description for the folder. **Returns:** `void` #### PDFolderSetDescriptionStyled ```cpp void PDFolderSetDescriptionStyled(PDFolder folder, ASConstText text) ``` Header: `PDProcs.h:12569` Sets the description of the folder using styled text. Keeps the non-styled description in sync. with the styled version. **Parameters** - `folder` ([`PDFolder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFolder)): The folder. - `text` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): The new description for the folder in XML Text Layout Format. **Returns:** `void` #### PDFolderSetFieldDate ```cpp void PDFolderSetFieldDate(PDFolder folder, ASAtom fieldID, const ASTimeRec *date) ``` Header: `PDProcs.h:12654` Sets the specified date field in the folder. **Parameters** - `folder` ([`PDFolder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFolder)): The folder. - `fieldID` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The field identifier. - `date` (`const ASTimeRec *`): The date to use as the new value for the specified field. **Returns:** `void` **Exceptions** - `genErrBadParm`: is raised if the field does not exist in the collection schema or the field type is not `D` (date). #### PDFolderSetFieldNumber ```cpp void PDFolderSetFieldNumber(PDFolder folder, ASAtom fieldID, float number) ``` Header: `PDProcs.h:12637` Sets the specified numeric field in the folder. **Parameters** - `folder` ([`PDFolder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFolder)): The folder. - `fieldID` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The field identifier. - `number` (`float`): The number to use as the new value for the specified field. **Returns:** `void` **Exceptions** - `genErrBadParm`: is raised if the field does not exist in the collection schema or the field type is not `N` (number). #### PDFolderSetFieldStyle ```cpp void PDFolderSetFieldStyle(PDFolder folder, ASAtom fieldID, ASConstCab styles) ``` Header: `PDProcs.h:12612` Sets the style dictionary for the specified field in the folder. **Parameters** - `folder` ([`PDFolder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFolder)): The folder. - `fieldID` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The field identifier. - `styles` ([`ASConstCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstCab)): ASConstCab containing field styles for the specified field. **Returns:** `void` **Exceptions** - `genErrBadParm`: is raised if the field does not exist in the collection schema or the field type is not `S` (text). #### PDFolderSetFieldStyledText ```cpp void PDFolderSetFieldStyledText(PDFolder folder, ASAtom fieldID, ASConstText text) ``` Header: `PDProcs.h:12595` Sets the specified text field in the folder **Parameters** - `folder` ([`PDFolder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFolder)): The folder. - `fieldID` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The field identifier. - `text` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): Text Layout Format XML containing the text to use as the new value for the specified field. **Returns:** `void` **Exceptions** - `genErrBadParm`: is raised if the field does not exist in the collection schema or the field type is not `S` (text). #### PDFolderSetFieldText ```cpp void PDFolderSetFieldText(PDFolder folder, ASAtom fieldID, ASConstText text) ``` Header: `PDProcs.h:12586` Sets the specified text field in the folder. **Parameters** - `folder` ([`PDFolder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFolder)): The folder. - `fieldID` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The field identifier. - `text` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): The text to use as the new value for the specified field. **Returns:** `void` **Exceptions** - `genErrBadParm`: is raised if the field does not exist in the collection schema or the field type is not `S` (text). #### PDFolderSetModDate ```cpp void PDFolderSetModDate(PDFolder folder, const ASTimeRec *date) ``` Header: `PDProcs.h:12529` Sets the modification date of the folder. **Parameters** - `folder` ([`PDFolder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFolder)): The folder. - `date` (`const ASTimeRec *`): A pointer to an `ASTimeRec` that will be used to set the modification date. **Returns:** `void` #### PDFolderSetName ```cpp void PDFolderSetName(PDFolder folder, ASConstText folderName) ``` Header: `PDProcs.h:12498` Sets the name of a folder. **Parameters** - `folder` ([`PDFolder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFolder)): The folder. - `folderName` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): The name of the folder. **Returns:** `void` #### PDFolderSetParent ```cpp void PDFolderSetParent(PDFolder folder, PDFolder parent) ``` Header: `PDProcs.h:12480` Sets the parent of the specified folder. **Parameters** - `folder` ([`PDFolder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFolder)): The folder that will receive a new parent. - `parent` ([`PDFolder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFolder)): The new parent folder. **Returns:** `void` ### Typedefs (1) #### PDFolder ```cpp typedef OPAQUE_64_BITS PDFolder ``` Header: `PDExpT.h:7111` An opaque object representing a collection folder dictionary. Folders are used to provide grouping for files in a portable collection. ## PDFont ### Functions (36) #### PDCharProcEnumWithParams ```cpp void PDCharProcEnumWithParams(PDCharProc obj, PDGraphicEnumParams params) ``` Header: `PDProcs.h:10576` Enumerates the graphic description of a single character procedure for a Type 3 font, for those contents that are visible in a given optional-content context. The parameters include both the monitor and data you would pass to PDCharProcEnum(), and an optional-content context that determines which contents are visible. **Parameters** - `obj` ([`PDCharProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCharProc)): The character procedure whose graphic descriptions are enumerated. - `params` (`PDGraphicEnumParams`): The parameters, including the optional-content context to use for content visibility. **Returns:** `void` **Exceptions** - `pdPErrUnableToCreateRasterPort` **See also:** [`PDCharProcEnum`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCharProcEnum), [`PDFormEnumPaintProcWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFormEnumPaintProcWithParams), [`PDPageEnumContents`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageEnumContents) #### PDFontAcquireEncodingArray ```cpp ASUns8 ** PDFontAcquireEncodingArray(PDFont font) ``` Header: `PDProcs.h:2795` Acquires a font's encoding array (the mapping of character codes to glyphs). When you are done with this array, call PDFontEncodingArrayRelease() to release it. The array contains 256 pointers. If a pointer is not `NULL`, it points to a C string containing the name of the glyph for the code point corresponding to the index. If it is `NULL`, then the name of the glyph is unchanged from that specified by the font's built-in encoding. For a Type 3 font, all glyph names will be present in the encoding array, and `NULL` entries correspond to un-encoded code points. For non-Roman character set viewers, it is not appropriate to call this method. **Parameters** - `font` ([`PDFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFont)): The font whose encoding array is obtained. **Returns:** [`ASUns8 **`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns8) The font's encoding array. It returns `NULL` if there is no encoding array associated with the font. **See also:** [`PDFontEncodingArrayRelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontEncodingArrayRelease), [`PDFontGetEncodingIndex`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontGetEncodingIndex) #### PDFontAcquireEncodingArrayFull ```cpp ASUns8 ** PDFontAcquireEncodingArrayFull(PDFont font) ``` Header: `PDProcs.h:12870` This function fills in the base encoding, differences, and standard encoding for a font. Acquires a font's encoding array (the mapping of character codes to glyphs). When you are done with this array, call PDFontEncodingArrayRelease() to release it. The array contains 256 pointers. If a pointer is not `NULL`, it points to a C string containing the name of the glyph for the code point corresponding to the index. If it is `NULL`, then the name of the glyph is unchanged from that specified by the font's built-in encoding. For a Type 3 font, all glyph names will be present in the encoding array, and `NULL` entries correspond to un-encoded code points. For non-Roman character set viewers, it is not appropriate to call this method. **Parameters** - `font` ([`PDFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFont)): The font whose encoding array is obtained. **Returns:** [`ASUns8 **`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns8) The font's encoding array. It returns `NULL` if there is no encoding array associated with the font. **See also:** `PDFontGetEncodingDelta` #### PDFontAcquireXlateTable ```cpp ASInt16 * PDFontAcquireXlateTable(PDFont font) ``` Header: `PDProcs.h:2991` Increments the specified font's XlateTable reference count and also returns the XlateTable, which is a 256-entry table that maps characters from their encoding in the PDF file to host encoding. If a character cannot be mapped to host encoding, then the table entry will (for that character) contain `-1`. When you are done using the XlateTable, call PDFontXlateTableRelease() to release it. For non-Roman character set viewers, it is not appropriate to call this method. **Parameters** - `font` ([`PDFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFont)): IN/OUT The font whose XlateTable is obtained. **Returns:** [`ASInt16 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16) A pointer to the font's XlateTable, if any. Otherwise it returns `NULL`. **See also:** [`PDFontXlateTableRelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontXlateTableRelease), [`PDFontXlateString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontXlateString) #### PDFontEnumCharProcs ```cpp void PDFontEnumCharProcs(PDFont font, PDCharProcEnumProc proc, void *clientData) ``` Header: `PDProcs.h:4015` Enumerates a Type 3 font's character drawing procedures. The elements of a single character procedure can be enumerated using PDCharProcEnum(). **Parameters** - `font` ([`PDFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFont)): IN/OUT The Type 3 font's character drawing procedures are being enumerated. - `proc` ([`PDCharProcEnumProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCharProcEnumProc)): IN/OUT A user-supplied callback to call for each character in the font. Enumeration ends if `proc` returns `false`. If the font contains no characters, `proc` will not be called. - `clientData` (`void *`): IN/OUT A pointer to user-supplied data passed to `proc` each time it is called. **Returns:** `void` **See also:** [`PDCharProcEnum`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCharProcEnum), [`PDDocEnumFonts`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocEnumFonts), [`PDDocEnumLoadedFonts`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocEnumLoadedFonts) #### PDFontFromCosObj ```cpp PDFont PDFontFromCosObj(CosObj fontObj) ``` Header: `PDProcs.h:7790` Converts a dictionary Cos object to a font. This method does not copy the object, but is instead the logical equivalent of a type cast. **Parameters** - `fontObj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): IN/OUT The dictionary Cos object for the font. **Returns:** [`PDFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFont) #### PDFontGetASTextName ```cpp void PDFontGetASTextName(PDFont font, ASBool removePrefix, ASText nameToFill) ``` Header: `PDProcs.h:11122` Fills in an ASText object with the font name, to be used in displaying lists or menus. In PDF 1.5, the font name can be represented with a UTF8 byte sequence. In previous versions of Acrobat the name could also be represented by host encodings such as Shift- JIS, Big5, KSC, and so on. This routine tries to return a text object that uses the correct script, but cannot always do so. The ASText object is owned by the caller. **Parameters** - `font` ([`PDFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFont)): The font whose name is obtained. - `removePrefix` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): Whether to remove the subset prefix, if present. For example, when `true`, the name `"ABCDEF+Myriad"` is returned as `"Myriad"`. - `nameToFill` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): (Filled by the method) The ASText object for the font's name. **Returns:** `void` #### PDFontGetBBox ```cpp void PDFontGetBBox(PDFont font, ASFixedRect *bboxP) ``` Header: `PDProcs.h:2841` Gets a Type 3 font's bounding box, which is the smallest rectangle that would enclose every character in the font if they were overlaid and painted. **Parameters** - `font` ([`PDFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFont)): IN/OUT The font whose bounding box is obtained. - `bboxP` (`ASFixedRect *`): IN/OUT (Filled by the method) A pointer to a rectangle specifying the font's bounding box. **Returns:** `void` #### PDFontGetCIDSystemInfo ```cpp ASAtom PDFontGetCIDSystemInfo(PDFont font) ``` Header: `PDProcs.h:6324` Gets an ASAtom representing Registry and Ordering for a CIDFont. This information resides in the CIDSystemInfo entry of the CIDFont dictionary, which describes a CIDFont. PDFontGetCIDSystemInfo() takes either a Type 0 font or a descendant font (CIDType0 or CIDType2) as an argument. This information is always present for any Type 0 font; the actual registry ordering information is a part of the descendant font. This method provides one way to identify a font's language. The CIDSystemInfo entry uses three components to identify a character collection uniquely: • A registry name to identify an issuer of ordering information. • An ordering name to identify an ordered character collection. • A supplement number to indicate that the ordered character collection for a registry, ordering, and previous supplement has been changed to add new characters assigned CIDs beginning with the next available CID. The PDFontGetCIDSystemInfo() method obtains the first two of these components. A CIDFont is designed to contain a large number of glyph procedures. Instead of being accessed by a name, each glyph procedure is accessed by an integer known as a character identifier or CID. Instead of a font encoding, CIDFonts use a CMap with a Type 0 composite font to define the mapping from character codes to a font number and a character selector. For more information on Type 0 fonts, CIDFonts, and CMaps, See the description of Composite 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](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](https://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5014.CIDFont_Spec.pdf) **Parameters** - `font` ([`PDFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFont)): IN/OUT The font whose Registry and Ordering information is obtained. **Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom) The ASAtom representing the CIDFont's Registry and Ordering information (for example, `"Adobe-Japan1"`). **See also:** [`PDFontGetCIDSystemSupplement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontGetCIDSystemSupplement), [`PDFontGetDescendant`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontGetDescendant) #### PDFontGetCIDSystemSupplement ```cpp ASInt32 PDFontGetCIDSystemSupplement(PDFont font) ``` Header: `PDProcs.h:6378` Gets the SystemSupplement number of a CIDFont. This field resides in the CIDSystemInfo entry of the CIDFont dictionary, which describes a CIDFont. The CIDSystemInfo entry uses three components to identify a character collection uniquely: • A registry name to identify an issuer of orderings. • An ordering name to identify an ordered character collection. • A supplement number to indicate that the ordered character collection for a registry, ordering, and previous supplement has been changed to add new characters assigned CIDs beginning with the next available CID. PDFontGetCIDSystemInfo() provides character collection information, and PDFontGetCIDSystemSupplement() specifies the version of the ordering. A CIDFont is designed to contain a large number of glyph procedures. Instead of being accessed by a name, each glyph procedure is accessed by an integer known as a character identifier or CID. Instead of a font encoding, CIDFonts use a CMap with a Type 0 composite font to define the mapping from character codes to a font number and a character selector. For more information on Type 0 fonts, CIDFonts, and CMaps, see the description of Composite 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](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](https://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5014.CIDFont_Spec.pdf) **Parameters** - `font` ([`PDFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFont)): IN/OUT The font whose `SystemSupplement` field is obtained. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The `SystemSupplement` field from the CIDFont. **See also:** [`PDFontGetDescendant`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontGetDescendant), [`PDFontGetCIDSystemInfo`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontGetCIDSystemInfo) #### PDFontGetCharSet ```cpp PDCharSet PDFontGetCharSet(PDFont font) ``` Header: `PDProcs.h:2753` Gets the font's character set. This is derived from the 'Uses Adobe standard encoding' bit in the font descriptor (if the font has a font descriptor) or from the font's name (if the font is one of the base 14 fonts and does not have a font descriptor). For non-Roman character set viewers, call PDFontGetEncodingName() instead. **Parameters** - `font` ([`PDFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFont)): IN/OUT The font whose character set is obtained. **Returns:** [`PDCharSet`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCharSet) The font's character set. For non-Roman character set viewers, it returns PDUnknownCharSet. **See also:** [`PDFontGetEncodingName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontGetEncodingName) #### PDFontGetCosObj ```cpp CosObj PDFontGetCosObj(PDFont font) ``` Header: `PDProcs.h:3054` Gets the Cos object for a font. This method does not copy the object, but is instead the logical equivalent of a type cast. **Parameters** - `font` ([`PDFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFont)): IN/OUT The font whose Cos object is obtained. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) The dictionary Cos object for the font. The dictionary's contents may be enumerated with CosObjEnum(). **See also:** [`PDDocEnumFonts`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocEnumFonts) #### PDFontGetDescendant ```cpp PDFont PDFontGetDescendant(PDFont font) ``` Header: `PDProcs.h:6225` Gets a Type 0 font's descendant, which may be a CIDType0 or CIDType2 font. Type 0 fonts support single-byte or multi-byte encodings and can refer to one or more descendant fonts. These fonts are analogous to the Type 0 or composite fonts supported by Level 2 PostScript interpreters. However, PDF Type 0 fonts only support character encodings defined by a CMap. The CMap specifies the mappings between character codes and the glyphs in the descendant fonts. For information about Type 0 fonts, see the description of Composite 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 more information on CMAPS, see page 272 of the same document. You can find this document on the web store of the International Standards Organization (ISO). **Parameters** - `font` ([`PDFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFont)): IN/OUT The font whose descendant is obtained. **Returns:** [`PDFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFont) The font's descendant font. **See also:** [`PDFontGetCIDSystemInfo`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontGetCIDSystemInfo), [`PDFontGetCIDSystemSupplement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontGetCIDSystemSupplement) #### PDFontGetEncodingIndex ```cpp ASInt32 PDFontGetEncodingIndex(PDFont font) ``` Header: `PDProcs.h:2769` Gets a font's encoding index. For non-Roman character set viewers, call PDFontGetEncodingName() instead. **Parameters** - `font` ([`PDFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFont)): IN/OUT The font whose encoding index is obtained. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) A font encoding index. If the index is greater than PDLastKnownEncoding, it is a custom encoding, and is unique within the document. If the index is less than PDLastKnownEncoding, it must be one of the PDFontEncoding values. **See also:** [`PDFontAcquireEncodingArray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontAcquireEncodingArray) #### PDFontGetEncodingName ```cpp const ASUns8 * PDFontGetEncodingName(PDFont font) ``` Header: `PDProcs.h:6262` Gets a string representing a font's encoding. Use PDFontGetEncodingIndex() to get encoding information for Roman viewers. Host encoding is a platform-dependent encoding for the host machine. 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`, `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). For non-Roman systems, the host encoding may be a variety of encodings, which are defined by a CMap (character map). See a list of predefined CMaps in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7.5, page 272. You can find this document on the web store of the International Standards Organization (ISO). In this case, the encoding string contains values such as `"90ms-RKSJ-H"`, `"90msp-RKSJ-H"`, `"Identity-V"`, or `"90pv-RKSJ-H"`; it does not return a string like `"Shift-JIS"`. @since **Parameters** - `font` ([`PDFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFont)): The font whose encoding name is obtained. **Returns:** [`const ASUns8 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns8) **See also:** [`PDFontGetEncodingIndex`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontGetEncodingIndex), [`PDGetHostEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDGetHostEncoding) #### PDFontGetFontMatrix ```cpp void PDFontGetFontMatrix(PDFont fontP, ASFixedMatrix *matrixP) ``` Header: `PDProcs.h:3019` Gets a font's matrix, which specifies the transformation from character space to text space. See Section 5.5.4 in the *PDF Reference*. This is only valid for Type 3 fonts. **Parameters** - `fontP` ([`PDFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFont)): IN/OUT The font whose matrix is obtained. - `matrixP` (`ASFixedMatrix *`): IN/OUT (Filled by the method) A pointer to the font's matrix. **Returns:** `void` **See also:** [`PDDocEnumFonts`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocEnumFonts) #### PDFontGetMetrics ```cpp void PDFontGetMetrics(PDFont font, PDFontMetricsP metricsP, ASSize_t sizeMetrics) ``` Header: `PDProcs.h:2830` Gets a font's metrics, which provide the information needed to create a substitute Multiple Master font when the original font is unavailable. See the description of Font Descriptors in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.8, page 281. You can find this document on the web store of the International Standards Organization (ISO). **Parameters** - `font` ([`PDFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFont)): IN/OUT The font whose metrics are being obtained. - `metricsP` (`PDFontMetricsP`): IN/OUT (Filled by the method) A pointer to a `PDFontMetrics` structure containing the font's metrics. The font metric values may be patched before being returned. If the actual values in the PDF file are required, use Cos instead to get trustworthy metrics. - `sizeMetrics` ([`ASSize_t`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASSize_t)): IN/OUT It must be `sizeof(PDFontMetrics)`. **Returns:** `void` **See also:** [`PDFontGetWidths`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontGetWidths), [`PDFontSetMetrics`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontSetMetrics) #### PDFontGetName ```cpp ASInt32 PDFontGetName(PDFont font, char *buffer, ASInt32 bufSize) ``` Header: `PDProcs.h:2725` Gets the name of a font. The behavior depends on the font type; for a Type 3 font it gets the value of the Name key in a PDF Font resource. See the description of font types in "Introduction to Font Data Structures" in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.5, page 253. You can find this document on the web store of the International Standards Organization (ISO). For other types it gets the value of the BaseFont key in a PDF font resource. **Parameters** - `font` ([`PDFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFont)): IN/OUT The font whose name is obtained. - `buffer` (`char *`): IN/OUT (Filled by the method) The buffer into which the font's name is stored. The client may pass in `NULL` to obtain the buffer size, excluding the terminating `NULL`, and then call the method with a buffer of the appropriate size. You must pass at least the `bufSize + 1` as the buffer size - `bufSize` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN/OUT The length of `buffer` in bytes. The maximum font name length that the Acrobat viewer will return is `PSNAMESIZE` (see PDExpT. h). **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The number of characters in the font name. If the font name is too long to fit into `buffer`, `bufSize - 1` bytes are copied into `buffer`, and `buffer` is `NULL`-terminated. **See also:** [`PDDocEnumFonts`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocEnumFonts), [`PDFontGetEncodingName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontGetEncodingName) #### PDFontGetSubtype ```cpp ASAtom PDFontGetSubtype(PDFont font) ``` Header: `PDProcs.h:2736` Gets a font's subtype. **Parameters** - `font` ([`PDFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFont)): IN/OUT The font whose subtype is obtained. **Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom) The font's subtype. The ASAtom returned can be converted to a string using ASAtomGetString(). It must be one of the Font Subtypes. **See also:** `PDDocEnumFonts FontSubtypes` #### PDFontGetWidths ```cpp void PDFontGetWidths(PDFont font, ASInt16 *widths) ``` Header: `PDProcs.h:2867` Gets the advance width of every glyph in a font. The advance width is the amount by which the current point advances when the glyph is drawn. The advance width may not correspond to the visible width of the glyph (for example, a glyph representing an accent mark might have an advance width of zero so that characters can be drawn under it). For this reason, the advance width cannot be used to determine the glyphs' bounding boxes. For non-Roman character set viewers, this method gets the width for a single byte range (`0` through `255`). **Parameters** - `font` ([`PDFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFont)): IN/OUT The font whose glyph advance widths are obtained. - `widths` ([`ASInt16 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16)): IN/OUT (Filled by the method) An array of glyph advance widths, measured in character space units. Un-encoded code points will have a width of zero. For non-Roman character set viewers, an array for a single byte range (`0` through `255`). **Returns:** `void` **See also:** [`PDFontGetMetrics`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontGetMetrics), [`PDFontSetMetrics`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontSetMetrics), [`PDFontXlateWidths`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontXlateWidths) #### PDFontIsEmbedded ```cpp ASBool PDFontIsEmbedded(PDFont font) ``` Header: `PDProcs.h:2919` Tests whether the specified font is embedded in the PDF file, meaning that the font is stored as a font file, which is a stream embedded in the PDF file. Only Type 1 and TrueType fonts can be embedded. **Parameters** - `font` ([`PDFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFont)): The font to test. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the font is embedded in the file, `false` otherwise. **See also:** [`PDDocEnumFonts`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocEnumFonts) #### PDFontSetMetrics ```cpp void PDFontSetMetrics(PDFont font, PDFontMetricsP metricsP, ASSize_t sizeMetrics) ``` Header: `PDProcs.h:3041` Sets a font's metrics, which provide the information needed to create a substitute Multiple Master font when the original font is unavailable. See the description of Font Descriptors in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.8, page 281. You can find this document on the web store of the International Standards Organization (ISO). This method can only be used on Type 1, Multiple Master Type 1, and TrueType fonts; it cannot be used on Type 3 fonts. **Parameters** - `font` ([`PDFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFont)): IN/OUT The font whose metrics are being set. - `metricsP` (`PDFontMetricsP`): IN/OUT A pointer to a `PDFontMetrics` structure containing the font's metrics. - `sizeMetrics` ([`ASSize_t`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASSize_t)): IN/OUT It must be `sizeof(PDFontMetrics)`. **Returns:** `void` **See also:** [`PDFontGetMetrics`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontGetMetrics) #### PDFontXlateString ```cpp ASBool PDFontXlateString(PDFont font, ASUns8 *inP, ASUns8 *outP, ASInt32 len) ``` Header: `PDProcs.h:2970` Translates a string from the PDFont's encoding into host encoding. If any characters cannot be represented in host encoding, they are replaced with space characters. If no XlateTable exists in the font, the function returns `false` and `outP` is not written. For non-Roman character set viewers, it is not appropriate to call this method. Instead call one of the following: PDFontXlateToHost(), PDFontXlateToUCS(), PDXlateToHostEx(), or PDXlateToPDFDocEncEx(). **Parameters** - `font` ([`PDFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFont)): The font (and hence, the encoding) that `inP` uses. - `inP` ([`ASUns8 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns8)): The string to translate. - `outP` ([`ASUns8 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns8)): (Filled by the method) The translated string. `outP` may point to the same buffer as `inP`, to allow in-place translation. - `len` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The length of `inP` and `outP`. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if an XlateTable exists in the font, `false` otherwise. If no XlateTable exists in the font, `outP` is not written. **See also:** [`PDFontXlateToHost`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontXlateToHost), [`PDFontAcquireXlateTable`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontAcquireXlateTable), [`PDFontXlateToUCS`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontXlateToUCS), [`PDXlateToHostEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXlateToHostEx), [`PDXlateToPDFDocEncEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXlateToPDFDocEncEx) #### PDFontXlateTableRelease ```cpp void PDFontXlateTableRelease(ASInt16 *table) ``` Header: `PDProcs.h:3005` Decrements the specified font's XlateTable reference count. The XlateTable is a 256-entry table that maps characters from their encoding in the PDF file to host encoding. If a character cannot be mapped to host encoding, then the table entry will (for that character) contain `-1`. **Parameters** - `table` ([`ASInt16 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16)): IN/OUT The XlateTable to release. **Returns:** `void` **See also:** [`PDFontAcquireXlateTable`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontAcquireXlateTable), [`PDFontXlateString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontXlateString) #### PDFontXlateToHost ```cpp ASInt32 PDFontXlateToHost(PDFont fontP, ASUns8 *inP, ASInt32 inLen, ASUns8 *outP, ASInt32 outLen) ``` Header: `PDProcs.h:6674` Translates a string from the PDFont's encoding to host encoding. This is useful for converting the text from a PDWord into host encoding. In the same way that PDXlateToHostEx() converts text from bookmark titles to host encoding, PDFontXlateToHost() converts text from a page contents stream to host encoding. Use PDFontXlateToUCS() to translate from the PDFont's encoding to Unicode. Non-Roman fonts, such as PostScript composite fonts, can be encoded in different ways, such as SHIFT-JIS, RKSJ, and so on. To use PDFontXlateToHost(), the caller does not need to know which encoding he is converting from, since that information is contained in the PDFont. Host encoding is a platform-dependent encoding for the host machine. 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`, `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). For non-Roman systems, the host encoding may be a variety of encodings, which are defined by a CMap (character map). For a list of predefined CMaps see the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7.5, page 272. You can find this document on the web store of the International Standards Organization (ISO). Use PDGetHostEncoding() to determine if a system's host encoding is Roman. @since **Parameters** - `fontP` ([`PDFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFont)): The font used in the input string `inP`. - `inP` ([`ASUns8 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns8)): A pointer to the string to translate.`inP` buffer in bytes. - `inLen` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)) - `outP` ([`ASUns8 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns8)): (Filled by the method) A pointer to the translated string.`outP` buffer in bytes.`outP`. - `outLen` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)) **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) **See also:** [`PDFontXlateString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontXlateString), [`PDFontXlateToUCS`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontXlateToUCS), [`PDGetHostEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDGetHostEncoding), [`PDXlateToHostEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXlateToHostEx), [`PDXlateToPDFDocEncEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXlateToPDFDocEncEx) #### PDFontXlateToUCS ```cpp ASInt32 PDFontXlateToUCS(PDFont fontP, ASUns8 *inP, ASInt32 inLen, ASUns8 *outP, ASInt32 outLen) ``` Header: `PDProcs.h:6726` Translates a string from whatever encoding the PDFont uses to Unicode encoding. This is useful for converting the text from a PDWord into Unicode. Use PDFontXlateToHost() to translate from the PDFont's encoding to host encoding. Non-Roman fonts, like PostScript composite fonts, can be encoded in different ways, such as SHIFT-JIS, RKSJ, and so on. The caller does not need to know which encoding they're converting from, since that information is contained in the PDFont. Host encoding is a platform-dependent encoding for the host machine. 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`, `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). For non-Roman systems, the host encoding may be a variety of encodings, which are defined by a CMap (character map). For a list of predefined CMaps see the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7.5, page 272. You can find this document on the web store of the International Standards Organization (ISO). Use PDGetHostEncoding() to determine if a system's host encoding is Roman. @since **Parameters** - `fontP` ([`PDFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFont)): The font of the input string `inP`. - `inP` ([`ASUns8 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns8)): A pointer to the string to translate.`inP` buffer in bytes. - `inLen` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)) - `outP` ([`ASUns8 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns8)): (Filled by the method) A pointer to the translated string. If it is `NULL`, the method returns the size of the translated string.`outP` buffer in bytes. If it is `0`, the method returns the size of the translated string.`outP`. - `outLen` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)) **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) **See also:** [`PDFontXlateToHost`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontXlateToHost), [`PDGetHostEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDGetHostEncoding), [`PDXlateToHostEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXlateToHostEx), [`PDXlateToPDFDocEncEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXlateToPDFDocEncEx) #### PDFontXlateWidths ```cpp void PDFontXlateWidths(PDFont font, ASInt16 *inP, ASInt16 *outP) ``` Header: `PDProcs.h:2940` Translates an array of 256 glyph advance widths (obtained from PDFontGetWidths()) from their order in the PDF file into host encoding order. If the widths are already in host encoding order, the widths are merely copied. All un-encoded code points are given a width of zero. For non-Roman character set viewers, it is not appropriate to call this method. **Parameters** - `font` ([`PDFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFont)): IN/OUT The font whose glyph widths are translated. - `inP` ([`ASInt16 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16)): IN/OUT The array of glyph advance widths to rearrange. - `outP` ([`ASInt16 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16)): IN/OUT (Filled by the method) The rearranged array of glyph advance widths. **Returns:** `void` **See also:** [`PDFontGetWidths`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontGetWidths) #### PDGetHostEncoding ```cpp ASHostEncoding PDGetHostEncoding(void) ``` Header: `PDProcs.h:6550` Indicates what kind of host encoding a system uses. It allows you to determine whether a system is Roman or non-Roman. (Non-Roman is also known as CJK-capable, which means that it is capable of handling multi-byte character sets such as Chinese, Japanese, or Korean). Host encoding is a platform-dependent encoding for the host machine. 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`, `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). For non-Roman systems, the host encoding may be a variety of encodings, which are defined by a CMap (character map). For a list of predefined CMaps see the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7.5, page 272. You can find this document on the web store of the International Standards Organization (ISO). Use PDGetHostEncoding() to determine if a system's host encoding is Roman.`0` for a Roman system, nonzero for a non-Roman system (a structure that depends on the host encoding). Users should simply test whether this value is `0`. @since **Parameters** - (unnamed) (`void`) **Returns:** [`ASHostEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASHostEncoding) **See also:** [`PDGetPDFDocEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDGetPDFDocEncoding), `AVAppGetLanguageEncoding` #### PDGetPDFDocEncoding ```cpp ASUns8 ** PDGetPDFDocEncoding(void) ``` Header: `PDProcs.h:2906` Gets an array describing the differences between the platform's host encoding and `PDFDocEncoding`. Host encoding is a platform-dependent encoding for the host machine. 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`, `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). For non-Roman systems, the host encoding may be a variety of encodings, which are defined by a CMap (character map). For a list of predefined CMaps see the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7.5, page 272. You can find this document on the web store of the International Standards Organization (ISO). Use PDGetHostEncoding() to determine whether a system's host encoding is Roman. If the element is `NULL`, the code point refers to the same glyph in both host encoding and `PDFDocEncoding`. If the element is non-`NULL`, it points to a string containing the glyph name for the code point. **Parameters** - (unnamed) (`void`) **Returns:** [`ASUns8 **`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns8) An array containing 256 elements. Each element corresponds to a code point in the `PDFDocEncoding`, and is either `NULL` or a pointer to a string. **See also:** [`PDGetHostEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDGetHostEncoding), `AVAppGetLanguageEncoding` #### PDHostMBLen ```cpp ASInt32 PDHostMBLen(const char *cp) ``` Header: `PDProcs.h:6513` Gets the number of additional bytes required for the multi-byte character pointed to by `cp`. If `cp` points to a single-byte character, `0` is returned. This method makes it possible to determine the length of multi-byte character strings to allocate space for them. This function is similar to the ANSI-C code: `mblen(cp, MB_LEN_MAX) - 1` or the Windows function: `IsDBCSLeadByte(cp)` **Parameters** - `cp` (`const char *`): The character to examine. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The number of bytes in the multi-byte character. #### PDXlateToASText ```cpp void PDXlateToASText(const char *inHostString, ASInt32 inHostStringSize, ASText outPDFString) ``` Header: `PDProcs.h:11743` Returns an ASText object corresponding to a host encoded string. **Parameters** - `inHostString` (`const char *`): A pointer to the string to translate (it may point to the same memory as `outPDFString`, allowing strings to translate in place). - `inHostStringSize` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The number of bytes in the string to translate. - `outPDFString` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): (Filled by the method) The text object corresponding to `inHostStringSize`. The client must pass a valid ASText object title. The routine does not allocate it. **Returns:** `void` The number of bytes in the translated string `outPDFString`. **See also:** [`PDFontXlateToHost`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontXlateToHost), [`PDFontXlateToUCS`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontXlateToUCS), [`PDGetHostEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDGetHostEncoding), [`PDXlateToHost`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXlateToHost), [`PDXlateToHostEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXlateToHostEx), [`PDXlateToPDFDocEnc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXlateToPDFDocEnc) #### PDXlateToHost ```cpp void PDXlateToHost(char *in, char *out, ASInt32 numBytes) ``` Header: `PDProcs.h:2694` Translates a string from `PDFDocEncoding` to host encoding. This method is useful when setting or retrieving displayed text that must be in `PDFDocEncoding` (or Unicode), such as text that appears in a text annotation or bookmark. A character that cannot be converted to the destination encoding is replaced with a space. Host encoding is a platform-dependent encoding for the host machine. For non-UNIX Roman systems, it is `MacRomanEncoding` on Mac OS and `WinAnsiEncoding` on Windows. 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`, `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). For non-Roman systems, the host encoding may be a variety of encodings, which are defined by a CMap (character map). For a list of predefined CMaps see the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7.5, page 272. You can find this document on the web store of the International Standards Organization (ISO). Use PDGetHostEncoding() to determine if a system's host encoding is Roman. For non-Roman systems, use PDXlateToHostEx(). In general, PDXlateToHostEx() can be called instead of PDXlateToHost() since PDXlateToHostEx() works for any host encoding. **Parameters** - `in` (`char *`): The string to translate (it may point to the same memory as `out`, allowing strings to translate in place). - `out` (`char *`): (Filled by the method) The translated string (it may point to the same memory as `in`). - `numBytes` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The number of bytes in the string to translate. **Returns:** `void` **See also:** [`PDGetHostEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDGetHostEncoding), [`PDXlateToHostEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXlateToHostEx), [`PDXlateToPDFDocEnc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXlateToPDFDocEnc), [`PDXlateToPDFDocEncEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXlateToPDFDocEncEx) #### PDXlateToHostASText ```cpp ASInt32 PDXlateToHostASText(const ASText inPdfString, char *outHostString, ASInt32 outHostStringSize) ``` Header: `PDProcs.h:11721` Returns a host encoded string corresponding to an ASText object. **Parameters** - `inPdfString` ([`const ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): The text object. - `outHostString` (`char *`): (Filled by the method) A pointer to the translated string. - `outHostStringSize` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The length of the `outHostString` buffer, in bytes. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The number of bytes in the translated string `outHostString`. **See also:** [`PDXlateToHostEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXlateToHostEx), [`PDFontXlateToHost`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontXlateToHost), [`PDFontXlateToUCS`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontXlateToUCS), [`PDGetHostEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDGetHostEncoding), [`PDXlateToHost`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXlateToHost), [`PDXlateToPDFDocEnc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXlateToPDFDocEnc), [`PDXlateToPDFDocEncEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXlateToPDFDocEncEx) #### PDXlateToHostEx ```cpp ASInt32 PDXlateToHostEx(const char *inPdfStr, ASInt32 inPdfStrSize, char *outHostStr, ASInt32 outHostStrSize) ``` Header: `PDProcs.h:6432` Translates a string from Unicode or `PDFDocEncoding` to host encoding. This method is useful when setting or retrieving displayed text that might be in Unicode, such as text that appears in a text annotation or bookmark. A character that cannot be converted to the destination encoding is replaced with a space. Host encoding is a platform-dependent encoding for the host machine. 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`, `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). For non-Roman systems, the host encoding may be a variety of encodings, which are defined by a CMap (character map). For a list of predefined CMaps see the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1:PDF 1.7, section 9.7.5, page 272. You can find this document on the web store of the International Standards Organization (ISO). For non-Roman systems, use PDXlatetoHostEx(). Use PDGetHostEncoding() to determine whether the host encoding for a system is Roman. In general, PDXlatetoHostEx() operates in the same way as PDXlateToHost() but requires an extra argument, since the sizes of the input and translated strings may differ. This method can be called instead of PDXlateToHost(), and must be called for multi-byte character set systems. @since **Parameters** - `inPdfStr` (`const char *`): IN/OUT A pointer to the string to translate (it may point to the same memory as `outHostStr`, allowing strings to translate in place).`inPdfStr` in bytes. - `inPdfStrSize` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)) - `outHostStr` (`char *`): IN/OUT (Filled by the method) A pointer to the translated string (it may point to the same memory as `inPdfStr`).`outHostStr` buffer in bytes.`outHostStr`. - `outHostStrSize` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)) **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) **See also:** [`PDFontXlateToHost`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontXlateToHost), [`PDFontXlateToUCS`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontXlateToUCS), [`PDGetHostEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDGetHostEncoding), [`PDXlateToHost`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXlateToHost), [`PDXlateToPDFDocEnc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXlateToPDFDocEnc), [`PDXlateToPDFDocEncEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXlateToPDFDocEncEx) #### PDXlateToPDFDocEnc ```cpp void PDXlateToPDFDocEnc(char *in, char *out, ASInt32 numBytes) ``` Header: `PDProcs.h:2645` Translates a string from host encoding to `PDFDocEncoding`. This method is useful when setting or retrieving displayed text that must be in `PDFDocEncoding` (or Unicode), such as text that appears in a text annotation or bookmark. A character that cannot be converted to the destination encoding is replaced with a space. For example, PDXlateToPDFDocEnc() converts `'\\n'` to a space character (`'\\r'` is present in `PDFDocEncoding` and is left unchanged). Host encoding is a platform-dependent encoding for the host machine. 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`, `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). For non-Roman systems, the host encoding may be a variety of encodings, which are defined by a CMap (character map). For a list of predefined CMaps see the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7.5, page 272. You can find this document on the web store of the International Standards Organization (ISO). Use PDGetHostEncoding() to determine if a system's host encoding is Roman. For non-Roman systems, use PDXlateToPDFDocEncEx(). In general, PDXlateToPDFDocEncEx() can be called instead of PDXlateToPDFDocEnc(), since PDXlateToPDFDocEncEx() works for PDFDocEncoding or Unicode. @since **Parameters** - `in` (`char *`): The string to translate (it may point to the same memory as `out`, allowing strings to translate in place). - `out` (`char *`): (Filled by the method) The translated string (it may point to the same memory as `in`). - `numBytes` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The number of bytes in the string to translate. **Returns:** `void` **See also:** [`PDGetHostEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDGetHostEncoding), [`PDXlateToHost`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXlateToHost), [`PDXlateToHostEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXlateToHostEx), [`PDXlateToPDFDocEncEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXlateToPDFDocEncEx) #### PDXlateToPDFDocEncEx ```cpp ASInt32 PDXlateToPDFDocEncEx(ASBool bUseUnicode, const char *inHostStr, ASInt32 inHostStrSize, char *outPDFStr, ASInt32 outPDFStrSize) ``` Header: `PDProcs.h:6492` Translates a string from host encoding to `PDFDocEncoding` or Unicode. This method is useful when using text that must be in `PDFDocEncoding` or Unicode, such as text in a text annotation, bookmark, or article title. A character that cannot be converted to the destination encoding is replaced with a space. For example, PDXlateToPDFDocEncEx() converts `'\\n'` to a space character (`'\\r'` is present in `PDFDocEncoding` and is left unchanged). Host encoding is a platform-dependent encoding for the host machine. 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`, `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). For non-Roman systems, the host encoding may be a variety of encodings, which are defined by a CMap (character map). For a list of predefined CMaps see the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7.5, page 272. You can find this document on the web store of the International Standards Organization (ISO). For non-Roman systems, use PDXlateToPDFDocEncEx(). You can use PDGetHostEncoding() to determine whether a system's host encoding is Roman. In general, PDXlateToPDFDocEncEx() can be called instead of PDXlateToPDFDocEnc() since PDXlateToPDFDocEncEx() works for PDFDocEncoding or Unicode.`true`, translate the string to Unicode; otherwise use `PDFDocEncoding`. @since **Parameters** - `bUseUnicode` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)) - `inHostStr` (`const char *`): A pointer to the string to translate (it may point to the same memory as `outPDFStr`, allowing strings to translate in place). - `inHostStrSize` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The number of bytes in the string to translate. - `outPDFStr` (`char *`): (Filled by the method) A pointer to the translated string (it may point to the same memory as `inHostStr`).`outPDFStr` buffer, in bytes.`outPDFStr`. - `outPDFStrSize` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)) **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) **See also:** [`PDFontXlateToHost`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontXlateToHost), [`PDFontXlateToUCS`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontXlateToUCS), [`PDGetHostEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDGetHostEncoding), [`PDXlateToHost`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXlateToHost), [`PDXlateToHostEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXlateToHostEx), [`PDXlateToPDFDocEnc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXlateToPDFDocEnc) ### Typedefs (6) #### PDCharSet ```cpp typedef ASEnum8 PDCharSet ``` Header: `PDExpT.h:2347` #### PDFontAngle ```cpp typedef ASInt16 PDFontAngle ``` Header: `PDExpT.h:77` An italic angle value in degrees, for use in `PDFontMetrics`. #### PDFontMetric ```cpp typedef ASUns16 PDFontMetric ``` Header: `PDExpT.h:72` An unsigned measurement of a font characteristic (for example, width). #### PDFontOffset ```cpp typedef ASInt16 PDFontOffset ``` Header: `PDExpT.h:82` A font offset value, for use in `PDFontMetrics`. #### PDCharProcEnumProc ```cpp typedef ASBool(*) PDCharProcEnumProc(char *name, PDCharProc obj, void *clientData)(char *name, PDCharProc obj, void *clientData) ``` Header: `PDExpT.h:3108` A callback for PDFontEnumCharProcs(). It is called once for each character in a Type 3 font. **See also:** [`PDFontEnumCharProcs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontEnumCharProcs) #### PDFontEnumProc ```cpp typedef ASBool(*) PDFontEnumProc(PDFont font, PDFontFlags *fontFlags, void *clientData)(PDFont font, PDFontFlags *fontFlags, void *clientData) ``` Header: `PDExpT.h:2257` A callback used by PDDocEnumFonts() and PDDocEnumLoadedFonts(). It is called once for each font. **See also:** [`PDDocEnumFonts`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocEnumFonts), [`PDDocEnumLoadedFonts`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocEnumLoadedFonts) ### Structures (2) #### PDCharProc ```cpp typedef struct _t_PDCharProc* PDCharProc ``` Header: `PDExpT.h:2509` #### PDFont ```cpp typedef struct _t_PDFont* PDFont ``` Header: `PDBasicExpT.h:107` A font that is used to draw text on a page. It corresponds to a Font Resource in a PDF file. Applications can get a list of PDFont objects used on a PDPage or a range of PDPage objects. More than one PDPage may reference the same PDFont object. A PDFont has a number of attributes whose values can be read or set, including an array of widths, the character encoding, and the font's resource name. **See also:** [`PDDocEnumFonts`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocEnumFonts), [`PDDocEnumLoadedFonts`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocEnumLoadedFonts), [`PDFontGetDescendant`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontGetDescendant), [`PDStyleGetFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDStyleGetFont), [`PDFontEnumCharProcs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontEnumCharProcs) ### Definitions (17) #### PDFONTFLAGS_USEDBYFORM Header: `PDExpT.h:2229` Value: `0x00000001` #### PDFontGetDescendant Header: `PDCalls.h:164` Value: `PDFontGetDescendantInt` #### PDLastOneByteEncoding Header: `PDExpT.h:2323` Value: `PDLastKnownEncoding` #### PDUnicodeEncoding Header: `PDExpT.h:2324` Value: `PDLastKnownEncoding` #### PD_ALL_CAP Header: `PDExpT.h:2273` Value: `0x00010000` #### PD_FIXED_WIDTH Header: `PDExpT.h:2267` Value: `0x00000001` #### PD_FORCE_BOLD Header: `PDExpT.h:2275` Value: `0x00040000` #### PD_ITALIC Header: `PDExpT.h:2272` Value: `0x00000040` #### PD_PI Header: `PDExpT.h:2269` Value: `0x00000004` #### PD_SCRIPT Header: `PDExpT.h:2270` Value: `0x00000008` #### PD_SEGASCII Header: `PDExpT.h:2350` Value: `((ASUns8)1)` #### PD_SEGBINARY Header: `PDExpT.h:2351` Value: `((ASUns8)2)` #### PD_SEGEOF Header: `PDExpT.h:2352` Value: `((ASUns8)3)` #### PD_SERIF Header: `PDExpT.h:2268` Value: `0x00000002` #### PD_SMALL_CAP Header: `PDExpT.h:2274` Value: `0x00020000` #### PD_STD_ENCODING Header: `PDExpT.h:2271` Value: `0x00000020` #### PSNAMESIZE Header: `PDExpT.h:2262` Value: `128` ## PDFontEncoding ### Functions (1) #### PDFontEncodingArrayRelease ```cpp void PDFontEncodingArrayRelease(ASUns8 **array) ``` Header: `PDProcs.h:2806` Releases a font's encoding array (the mapping of character codes to glyphs). Call this method after you are done using an encoding array acquired using PDFontAcquireEncodingArray(). **Parameters** - `array` ([`ASUns8 **`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns8)): IN/OUT The encoding array to release. **Returns:** `void` **See also:** [`PDFontAcquireEncodingArray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontAcquireEncodingArray) ### Typedefs (1) #### PDFontEncoding ```cpp typedef ASEnum8 PDFontEncoding ``` Header: `PDExpT.h:2321` ### Enums (1) #### PDFontEncodings Header: `PDExpT.h:2282` An enumerated data type that specifies a font's encoding. To learn more about MacRoman Encoding, see: You can find this document on the web store of the International Standards Organization (ISO). **Values** - `PDBuiltInEncoding = -1`: The encoding specified internally in the font. In the case of a Type 1 or MMType 1 font, this is specified by the Encoding value in the font's `fontdict`. In the case of TrueType fonts, this is the encoding specified by the default one-byte `CMap` for the platform. - `PDMacRomanEncoding = 0`: MacRomanEncoding, 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. - `PDMacExpertEncoding = 1`: MacExpertEncoding, see Annex D, "Character Sets and Encodings," page 651. - `PDWinAnsiEncoding = 2`: WinAnsiEncoding, see Annex D, "Character Sets and Encodings," page 651. - `PDStdEncoding = 3`: StandardEncoding, see Annex D, "Character Sets and Encodings," page 651. - `PDFDocEncoding = 4`: PDFDocEncoding, see Annex D, "Character Sets and Encodings," page 651. This will never be returned for a font; it is used internally. - `PDLastKnownEncoding = 5` ## PDGraphic ### Functions (3) #### PDGraphicGetBBox ```cpp void PDGraphicGetBBox(PDGraphic obj, ASFixedRect *bboxP) ``` Header: `PDProcs.h:3633` Gets a bounding box for the specified graphic object. **Parameters** - `obj` ([`PDGraphic`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDGraphic)): The graphic object whose bounding box is obtained. - `bboxP` (`ASFixedRect *`): (Filled by the method) A pointer to a rectangle containing the bounding box for `obj`. If it is called during PDFormEnumPaintProc() or PDCharProcEnum(), the coordinates are specified in the object space, meaning that they are relative to the object's matrix. **Returns:** `void` **See also:** [`PDCharProcEnum`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDCharProcEnum), [`PDFormEnumPaintProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFormEnumPaintProc) #### PDGraphicGetCurrentMatrix ```cpp void PDGraphicGetCurrentMatrix(PDGraphic obj, ASFixedMatrix *matrix) ``` Header: `PDProcs.h:3645` Gets the current transformation matrix in effect for a graphic object; the matrix is relative to user space. **Parameters** - `obj` ([`PDGraphic`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDGraphic)): IN/OUT The graphic object for which transformation matrix is obtained. - `matrix` (`ASFixedMatrix *`): IN/OUT (Filled by the method) A pointer to a matrix containing the transformation matrix for `obj`. **Returns:** `void` #### PDGraphicGetState ```cpp void PDGraphicGetState(PDGraphic obj, PDGraphicStateP stateP, ASInt32 stateLen) ``` Header: `PDProcs.h:3659` Gets the graphics state associated with a graphic object. See Section 4.3 in the *PDF Reference* for a discussion of the graphics state parameters. **Parameters** - `obj` ([`PDGraphic`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDGraphic)): IN/OUT The graphic object whose graphics state is obtained. - `stateP` (`PDGraphicStateP`): IN/OUT (Filled by the method) A pointer to a `PDGraphicState` structure containing the graphics state. - `stateLen` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN/OUT It must be `sizeof(PDGraphicsState)`. **Returns:** `void` ### Typedefs (9) #### PDGraphicEnumCacheDeviceProc ```cpp typedef ASBool(*) PDGraphicEnumCacheDeviceProc(ASFixed *parms, void *clientData)(ASFixed *parms, void *clientData) ``` Header: `PDExpT.h:2864` A callback for PDGraphicEnumMonitor. It is called for every d1 (`setcachedevice`) operator. **See also:** [`PDPageEnumContents`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageEnumContents) #### PDGraphicEnumCharWidthProc ```cpp typedef ASBool(*) PDGraphicEnumCharWidthProc(ASFixedPoint width, void *clientData)(ASFixedPoint width, void *clientData) ``` Header: `PDExpT.h:2852` A callback for PDGraphicEnumMonitor. It is called for every d0 (`setcharwidth`) operator. **See also:** [`PDPageEnumContents`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageEnumContents) #### PDGraphicEnumImageProc ```cpp typedef ASBool(*) PDGraphicEnumImageProc(PDInlineImage obj, void *clientData)(PDInlineImage obj, void *clientData) ``` Header: `PDExpT.h:2802` A callback for PDGraphicEnumMonitor. It is called for every image operator. **See also:** [`PDPageEnumContents`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageEnumContents) #### PDGraphicEnumPathProc ```cpp typedef ASBool(*) PDGraphicEnumPathProc(PDPath obj, void *clientData)(PDPath obj, void *clientData) ``` Header: `PDExpT.h:2790` A callback for PDGraphicEnumMonitor. It is called for every path operator. **See also:** [`PDPageEnumContents`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageEnumContents) #### PDGraphicEnumRestoreProc ```cpp typedef ASBool(*) PDGraphicEnumRestoreProc(void *clientData)(void *clientData) ``` Header: `PDExpT.h:2841` A callback for PDGraphicEnumMonitor. It is called for every Q (restore) operator. **See also:** [`PDPageEnumContents`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageEnumContents) #### PDGraphicEnumSaveProc ```cpp typedef ASBool(*) PDGraphicEnumSaveProc(void *clientData)(void *clientData) ``` Header: `PDExpT.h:2830` A callback for PDGraphicEnumMonitor. It is called for every Q (save) operator. **See also:** [`PDPageEnumContents`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageEnumContents) #### PDGraphicEnumTextProc ```cpp typedef ASBool(*) PDGraphicEnumTextProc(PDText obj, void *clientData)(PDText obj, void *clientData) ``` Header: `PDExpT.h:2778` A callback for PDGraphicEnumMonitor. It is called for every text operator. **See also:** [`PDPageEnumContents`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageEnumContents) #### PDGraphicEnumXObjectRefMatrixProc ```cpp typedef ASBool(*) PDGraphicEnumXObjectRefMatrixProc(ASFixedMatrix *matrix, void *clientData)(ASFixedMatrix *matrix, void *clientData) ``` Header: `PDExpT.h:2879` A callback for PDGraphicEnumMonitor. It gets the current matrix for the subsequent XObject. It is called immediately before PDGraphicEnumXObjectRefProc(). **See also:** [`PDPageEnumContents`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageEnumContents) #### PDGraphicEnumXObjectRefProc ```cpp typedef ASBool(*) PDGraphicEnumXObjectRefProc(char *name, ASFixedRect *bbox, void *clientData)(char *name, ASFixedRect *bbox, void *clientData) ``` Header: `PDExpT.h:2819` A callback for PDGraphicEnumMonitor. It is called for every XObject (Do) operator. **See also:** [`PDPageEnumContents`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageEnumContents) ### Structures (2) #### PDGraphic ```cpp typedef struct _t_PDGraphic* PDGraphic ``` Header: `PDExpT.h:2497` All graphic objects that comprise page, charproc, and PDForm descriptions. **See also:** [`PDGraphicEnumMonitor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDGraphicEnumMonitor) #### PDGraphicEnumMonitor ```cpp typedef struct _t_PDGraphicEnumMonitor* PDGraphicEnumMonitor ``` Header: `PDExpT.h:2881` ## PDInlineImage ### Functions (3) #### PDInlineImageColorSpaceGetIndexLookup ```cpp void PDInlineImageColorSpaceGetIndexLookup(PDInlineImage image, ASUns8 *data, ASInt32 dataLen) ``` Header: `PDProcs.h:3802` Gets the lookup table for an indexed color space. The table will contain the number of entries specified by the index size, and there will be 1 byte for each color component for each entry. The number of color components depends on the color space: Color Number of components gray 1 RGB 3 CMYK 4 Lab 3 For additional information on indexed color space, see the Special Color Spaces section in the ISO 32000-1:2008, Document Management- Portable Document Format-Part 1: PDF 1.7, section 8.6.6, page 155. You can find this document on the web store of the International Standards Organization (ISO). There is also some useful discussion in the *PostScript Language Reference Manual* under indexed color spaces. [https://www.adobe.com/jp/print/postscript/pdfs/PLRM.pdf](https://www.adobe.com/jp/print/postscript/pdfs/PLRM.pdf) **Parameters** - `image` ([`PDInlineImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDInlineImage)): IN/OUT The inline image whose lookup table is obtained. - `data` ([`ASUns8 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns8)): IN/OUT (Filled by the method) The lookup table for image. - `dataLen` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN/OUT The length of `data` in bytes. **Returns:** `void` **See also:** [`PDImageColorSpaceGetIndexLookup`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDImageColorSpaceGetIndexLookup) #### PDInlineImageGetAttrs ```cpp void PDInlineImageGetAttrs(PDInlineImage obj, PDImageAttrsP attrsP, ASInt32 attrsLen) ``` Header: `PDProcs.h:3751` Gets an inline image's attributes. **Note:** This method is provided only for backwards compatibility. It has not been updated beyond PDF Version 1.1 and may not work correctly for newly created PDF 1.2 or later files. You should use the PDFEdit API to enumerate page contents. **Note:** The attribute for a color space is a CosObj. Cos objects that are the result of parsing inline dictionaries in the PDF page contents are a special class of Cos objects. You should never depend on these objects lasting the lifetime of the document. You should extract the information you need from the object immediately and refer to it no further in your code. **Parameters** - `obj` ([`PDInlineImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDInlineImage)): IN/OUT The inline image whose attributes are obtained. - `attrsP` (`PDImageAttrsP`): IN/OUT (Filled by the method) A pointer to a `PDImageAttrs` structure containing the image attributes. Note that this structure contains a Cos object that is subject to the warning below. - `attrsLen` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN/OUT It must be `sizeof(PDImageAttrs)`. **Returns:** `void` **See also:** [`PDImageGetAttrs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDImageGetAttrs), [`PDInlineImageGetData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDInlineImageGetData) #### PDInlineImageGetData ```cpp void PDInlineImageGetData(PDInlineImage obj, ASUns8 *data, ASInt32 dataLen) ``` Header: `PDProcs.h:3766` Gets the image data for an inline image. **Parameters** - `obj` ([`PDInlineImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDInlineImage)): IN/OUT The inline image whose data is obtained. - `data` ([`ASUns8 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns8)): IN/OUT (Filled by the method) A buffer into which the image data will be placed. - `dataLen` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN/OUT The number of bytes that `data` can hold. It must be large enough to hold the entire inline image. Use PDInlineImageGetAttrs() to determine how much data is in the image. **Returns:** `void` **Exceptions** - `genErrBadParm`: is raised if `dataLen` is less than the amount of data in the image. **See also:** [`PDInlineImageGetAttrs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDInlineImageGetAttrs) ### Structures (1) #### PDInlineImage ```cpp typedef struct _t_PDGraphic * PDInlineImage ``` Header: `PDExpT.h:2499` ## PDLinkAnnot ### Functions (5) #### PDLinkAnnotGetAction ```cpp PDAction PDLinkAnnotGetAction(PDLinkAnnot aLinkAnnot) ``` Header: `PDProcs.h:703` Gets a link annotation's action. After you obtain the action, you can execute it with AVDocPerformAction(). **Parameters** - `aLinkAnnot` ([`PDLinkAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDLinkAnnot)): IN/OUT The link annotation whose action is obtained. **Returns:** [`PDAction`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAction) The link annotation's action. **See also:** `AVDocPerformAction`, [`PDLinkAnnotSetAction`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDLinkAnnotSetAction) #### PDLinkAnnotGetBorder ```cpp void PDLinkAnnotGetBorder(PDLinkAnnot aLinkAnnot, PDLinkAnnotBorder *border) ``` Header: `PDProcs.h:663` Gets the border of a link annotation. **Parameters** - `aLinkAnnot` ([`PDLinkAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDLinkAnnot)): IN/OUT The link annotation whose border is obtained. - `border` (`PDLinkAnnotBorder *`): IN/OUT (Filled by the method) A pointer to a structure containing the link border. Link corner radii are ignored by the Acrobat viewers. **Returns:** `void` **See also:** [`PDLinkAnnotSetBorder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDLinkAnnotSetBorder) #### PDLinkAnnotRemoveAction ```cpp void PDLinkAnnotRemoveAction(PDLinkAnnot aLinkAnnot) ``` Header: `PDProcs.h:7918` Removes a link annotation's action. **Parameters** - `aLinkAnnot` ([`PDLinkAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDLinkAnnot)): The link annotation whose action is removed. **Returns:** `void` **Exceptions** - `pdErrBadAction`: @notify PDAnnotWillChange @notify PDAnnotDidChange **See also:** [`PDLinkAnnotGetAction`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDLinkAnnotGetAction), [`PDLinkAnnotSetAction`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDLinkAnnotSetAction) #### PDLinkAnnotSetAction ```cpp void PDLinkAnnotSetAction(PDLinkAnnot aLinkAnnot, PDAction action) ``` Header: `PDProcs.h:691` Sets a link annotation's action. **Parameters** - `aLinkAnnot` ([`PDLinkAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDLinkAnnot)): IN/OUT The link annotation whose action is set. - `action` ([`PDAction`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAction)): IN/OUT The new action for the link annotation. @notify PDAnnotWillChange @notify PDAnnotDidChange **Returns:** `void` **See also:** [`PDLinkAnnotGetAction`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDLinkAnnotGetAction) #### PDLinkAnnotSetBorder ```cpp void PDLinkAnnotSetBorder(PDLinkAnnot aLinkAnnot, const PDLinkAnnotBorder *border) ``` Header: `PDProcs.h:679` Sets a link annotation's border. **Parameters** - `aLinkAnnot` ([`PDLinkAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDLinkAnnot)): IN/OUT The link annotation whose border is set. - `border` (`const PDLinkAnnotBorder *`): IN/OUT A pointer to a structure containing the link border. Link corner radii are ignored by the Acrobat viewers. **Returns:** `void` **Exceptions** - `PDAnnotDidChange` - `PDAnnotWillChange`: @notify PDAnnotWillChange @notify PDAnnotDidChange **See also:** [`PDLinkAnnotGetBorder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDLinkAnnotGetBorder) ### Typedefs (1) #### PDLinkAnnot ```cpp typedef OPAQUE_64_BITS PDLinkAnnot ``` Header: `PDExpT.h:366` A link annotation on a page in a PDF file. You can use any PDAnnot method on a PDLinkAnnot. Applications can: Get and set the bounding rectangle and color using PDAnnot methods. Get and set the action that occurs when the link is activated, and the link's border, using PDLinkAnnot methods. Create new link annotations and delete existing ones using the PDPage methods. To obtain a link annotation, use any of the PDAnnot calls, followed by CastToPDLinkAnnot(). The annotation passed to CastToPDLinkAnnot() must be a link annotation; other annotation types are not converted into link annotations. **See also:** [`CastToPDLinkAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#CastToPDLinkAnnot), [`PDPageRemoveAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageRemoveAnnot) ### Definitions (1) #### CastToPDLinkAnnot Header: `PDExpT.h:449` Value: `*(PDLinkAnnot *)&(a)` Casts a generic annotation or a text annotation to a link annotation. **See also:** [`CastToPDAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#CastToPDAnnot), [`CastToPDTextAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#CastToPDTextAnnot) ## PDNameTree ### Functions (12) #### PDNameTreeEnum ```cpp void PDNameTreeEnum(PDNameTree theTree, CosObjEnumProc proc, void *clientData) ``` Header: `PDProcs.h:7046` Enumerates the entries in the tree. **Parameters** - `theTree` ([`PDNameTree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTree)): IN/OUT A name tree. - `proc` ([`CosObjEnumProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjEnumProc)): IN/OUT A procedure to call once for each name/object pair in `theTree`. The obj/value pair in `proc` correspond to the Cos string and CosObj values of each leaf in the tree. - `clientData` (`void *`): IN/OUT Data used by the enumeration procedure. `clientData` is passed to the enumeration procedure proc each time an entry is encountered. **Returns:** `void` **See also:** [`PDNameTreeGet`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTreeGet), [`PDNameTreePut`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTreePut), [`PDNameTreeRemove`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTreeRemove) #### PDNameTreeEqual ```cpp ASBool PDNameTreeEqual(PDNameTree tree1, PDNameTree tree2) ``` Header: `PDProcs.h:6976` Compares two name trees to determine if they are the same object. **Parameters** - `tree1` ([`PDNameTree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTree)): A name tree. - `tree2` ([`PDNameTree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTree)): Another name tree. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the two name trees are equivalent, `false` otherwise. **See also:** [`PDNameTreeIsValid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTreeIsValid) #### PDNameTreeFromCosObj ```cpp PDNameTree PDNameTreeFromCosObj(CosObj obj) ``` Header: `PDProcs.h:6938` Creates a type cast of the CosObj to a name tree. This does not copy the object. **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): IN/OUT The CosObj for which a PDNameTree representation is desired. **Returns:** [`PDNameTree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTree) A PDNameTree representation of `obj`. **See also:** [`PDNameTreeNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTreeNew), [`PDNameTreeGetCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTreeGetCosObj) #### PDNameTreeGet ```cpp ASBool PDNameTreeGet(PDNameTree theTree, const char *name, ASInt32 nameLen, CosObj *value) ``` Header: `PDProcs.h:7011` Retrieves an object from the name tree. **Parameters** - `theTree` ([`PDNameTree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTree)): The PDNameTree from which an object is retrieved. - `name` (`const char *`): The name of the object within `theTree` to get. This is a Cos-style string, not a C string. - `nameLen` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The length of `name`. - `value` ([`CosObj *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): (Filled by the method) The Cos object corresponding to `name` within `theTree`. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the object was retrieved, `false` if no object with this name exists. **See also:** [`PDNameTreePut`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTreePut), [`PDNameTreeRemove`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTreeRemove) #### PDNameTreeGetCosObj ```cpp CosObj PDNameTreeGetCosObj(PDNameTree theTree) ``` Header: `PDProcs.h:6951` Creates a type cast of the name tree to a CosObj. This does not copy the object. **Parameters** - `theTree` ([`PDNameTree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTree)): IN/OUT The PDNameTree for which a CosObj representation is desired. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) A CosObj representation of `theTree`. **See also:** [`PDNameTreeNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTreeNew), [`PDNameTreeFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTreeFromCosObj) #### PDNameTreeIsValid ```cpp ASBool PDNameTreeIsValid(PDNameTree theTree) ``` Header: `PDProcs.h:6964` Validates whether a PDNameTree is a CosDict Cos object. **Parameters** - `theTree` ([`PDNameTree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTree)): The PDNameTree whose validity is desired. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the name tree is a CosDict, `false` otherwise. **See also:** [`PDDocCreateNameTree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateNameTree), [`PDDocGetNameTree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetNameTree), [`PDNameTreeEqual`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTreeEqual) #### PDNameTreeLookup ```cpp CosObj PDNameTreeLookup(CosObj nameTree, char *string, ASInt32 stringLen) ``` Header: `PDProcs.h:6192` Given a name tree (such as the Dests tree in the Names dictionary) and a string, find the CosObj in the tree that matches the string. See the description of Name Trees in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.9.6, page 88. You can find this document on the web store of the International Standards Organization (ISO). **Parameters** - `nameTree` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The name tree in which to search. - `string` (`char *`): The name to search for. The name tree uses Cos-style strings, which may use Unicode encoding, and these may contain bytes with zeroes in them (high bytes of ASCII characters). Note that `name` is not a C-style string. Cos string objects can contain `NULL` chars. Standard C string-handling functions may not work as expected. - `stringLen` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The length of `name` in bytes. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) The Cos object associated with the specified name, which is the array element following the name. **See also:** [`PDNameTreeGet`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTreeGet), [`PDNameTreePut`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTreePut) #### PDNameTreeNew ```cpp PDNameTree PDNameTreeNew(PDDoc pdDoc) ``` Header: `PDProcs.h:6925` Creates a new name tree in the document. PDNameTreeIsValid() should be called to determine if the name tree returned by PDNameTreeNew() is usable. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document for which a new name tree is desired. **Returns:** [`PDNameTree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTree) The newly created name tree or a `NULL` CosObj if Acrobat is unable to create a PDNameTree for the document specified by `pdDoc`. **See also:** [`PDNameTreeFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTreeFromCosObj), [`PDNameTreeGetCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTreeGetCosObj), [`PDNameTreeIsValid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTreeIsValid), [`PDNameTreeRemove`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTreeRemove) #### PDNameTreeNotifyNameAdded ```cpp void PDNameTreeNotifyNameAdded(PDNameTree theTree, CosObj key, CosObj value) ``` Header: `PDProcs.h:7956` Sends a PDNameTreeNameAdded() notification. **Parameters** - `theTree` ([`PDNameTree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTree)): The PDNameTree to which a name had been added. - `key` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The name of the object within `theTree` that was added. This is a Cos string, not a C string. - `value` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): (Filled by the method) The Cos object corresponding to the object name that was added to `theTree`. @notify PDNameTreeNameAdded **Returns:** `void` **See also:** [`PDNameTreeNotifyNameRemoved`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTreeNotifyNameRemoved) #### PDNameTreeNotifyNameRemoved ```cpp void PDNameTreeNotifyNameRemoved(PDNameTree theTree, CosObj removedName) ``` Header: `PDProcs.h:7967` Sends a PDNameTreeNameRemoved() notification. **Parameters** - `theTree` ([`PDNameTree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTree)): The PDNameTree from which the name had been removed. - `removedName` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The name within `theTree` that was removed. @notify PDNameTreeNameRemoved **Returns:** `void` **See also:** [`PDNameTreeNotifyNameAdded`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTreeNotifyNameAdded) #### PDNameTreePut ```cpp void PDNameTreePut(PDNameTree theTree, CosObj key, CosObj value) ``` Header: `PDProcs.h:6994` Puts a new entry in the name tree. If an entry with this name is already in the tree, it is replaced. @notify PDNameTreeNameAdded **Parameters** - `theTree` ([`PDNameTree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTree)): IN/OUT The name tree for which a new entry is added. - `key` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): IN/OUT The name of the object to put in the tree. This is a Cos-style string, not a C string. This allows the use of an existing indirect object for the key rather than forcing the creation of a new object. - `value` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): IN/OUT The Cos object to be associated with `key`. **Returns:** `void` **See also:** [`PDNameTreeGet`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTreeGet) #### PDNameTreeRemove ```cpp void PDNameTreeRemove(PDNameTree theTree, const char *key, ASInt32 keyLen) ``` Header: `PDProcs.h:7027` Removes the specified object from the tree. It does nothing if no object with that name exists. **Parameters** - `theTree` ([`PDNameTree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTree)): IN/OUT The name tree from which an entry is removed. - `key` (`const char *`): IN/OUT The name of the entry to remove. This is a Cos- style string, not a C string. - `keyLen` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN/OUT The length of `key` in bytes. @notify PDNameTreeNameRemoved **Returns:** `void` **See also:** [`PDNameTreeGet`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTreeGet), [`PDNameTreePut`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTreePut) ### Typedefs (1) #### PDNameTree ```cpp typedef OPAQUE_64_BITS PDNameTree ``` Header: `PDExpT.h:5539` The dictionary used to store all of the Named Destinations in a PDF file. A name tree is used to map Cos strings to Cos objects just as a Cos dictionary is used to map Cos names to Cos objects. However, a name tree can have many more entries than a Cos dictionary can. You create a PDNameTree and locate it where you think is appropriate (perhaps under a page, but most often right under the catalog). Name trees use Cos-style strings (not `NULL`-terminated C strings), which may use Unicode encoding, and these may contain bytes with zeroes in them (high bytes of ASCII characters). **See also:** [`PDDocCreateNameTree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateNameTree), [`PDNameTreeNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTreeNew), [`PDNameTreeFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTreeFromCosObj), [`PDNameTreeEnum`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNameTreeEnum) ## PDNumTree ### Functions (9) #### PDNumTreeEnum ```cpp void PDNumTreeEnum(PDNumTree theTree, CosObjEnumProc proc, void *clientData) ``` Header: `PDProcs.h:7778` Enumerates the entries in the tree. **Parameters** - `theTree` ([`PDNumTree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNumTree)): IN/OUT A number tree. - `proc` ([`CosObjEnumProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjEnumProc)): IN/OUT A procedure to call once for each number destination pair in `theTree`. - `clientData` (`void *`): IN/OUT Data used by the enumeration procedure. `clientData` is passed to the enumeration procedure proc each time a number tree is encountered. **Returns:** `void` **See also:** [`PDNumTreeGet`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNumTreeGet), [`PDNumTreePut`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNumTreePut) #### PDNumTreeEqual ```cpp ASBool PDNumTreeEqual(PDNumTree tree1, PDNumTree tree2) ``` Header: `PDProcs.h:7719` Compares two number trees to determine if they are the same object. **Parameters** - `tree1` ([`PDNumTree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNumTree)): A number tree. - `tree2` ([`PDNumTree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNumTree)): Another number tree. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the two number trees are equivalent, `false` otherwise. **See also:** [`PDNumTreeIsValid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNumTreeIsValid) #### PDNumTreeFromCosObj ```cpp PDNumTree PDNumTreeFromCosObj(CosObj obj) ``` Header: `PDProcs.h:7684` Creates a type cast of the CosObj to a number tree. **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): IN/OUT The CosObj for which a PDNumTree representation is desired. **Returns:** [`PDNumTree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNumTree) A PDNumTree representation of `obj`. **See also:** [`PDNumTreeNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNumTreeNew), [`PDNumTreeGetCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNumTreeGetCosObj) #### PDNumTreeGet ```cpp ASBool PDNumTreeGet(PDNumTree theTree, ASInt32 key, CosObj *value) ``` Header: `PDProcs.h:7748` Retrieves an object from the number tree. **Parameters** - `theTree` ([`PDNumTree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNumTree)): The PDNumTree requested. - `key` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The number of the entry to retrieve. - `value` ([`CosObj *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): (Filled by the method) The value associated with `key`. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the object was retrieved, `false` if no object with this number exists. **See also:** [`PDNumTreePut`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNumTreePut), [`PDNumTreeRemove`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNumTreeRemove) #### PDNumTreeGetCosObj ```cpp CosObj PDNumTreeGetCosObj(PDNumTree theTree) ``` Header: `PDProcs.h:7696` Creates a type cast of the number tree to a CosObj. **Parameters** - `theTree` ([`PDNumTree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNumTree)): IN/OUT The PDNumTree for which a CosObj representation is desired. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) A CosObj representation of `theTree`. **See also:** [`PDNumTreeNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNumTreeNew), [`PDNumTreeFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNumTreeFromCosObj) #### PDNumTreeIsValid ```cpp ASBool PDNumTreeIsValid(PDNumTree theTree) ``` Header: `PDProcs.h:7707` Validates whether a PDNumTree is a CosDict Cos object. **Parameters** - `theTree` ([`PDNumTree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNumTree)): The PDNumTree whose validity is desired. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the number tree is a CosDict, `false` otherwise. **See also:** [`PDNumTreeEqual`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNumTreeEqual) #### PDNumTreeNew ```cpp PDNumTree PDNumTreeNew(PDDoc pdDoc) ``` Header: `PDProcs.h:7672` Creates a new number tree in the document. PDNumTreeIsValid() should be called to determine if the number tree returned by PDNumTreeNew() is usable. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document for which a new number tree is desired. **Returns:** [`PDNumTree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNumTree) The newly created number tree, or a `NULL` CosObj if Acrobat is unable to create a PDNumTree for the document specified by `pdDoc`. **See also:** [`PDNumTreeFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNumTreeFromCosObj), [`PDNumTreeGetCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNumTreeGetCosObj), [`PDNumTreeIsValid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNumTreeIsValid) #### PDNumTreePut ```cpp void PDNumTreePut(PDNumTree theTree, ASInt32 key, CosObj value) ``` Header: `PDProcs.h:7734` Puts a new entry in the number tree. If an entry with this number is already in the tree, it is replaced. **Parameters** - `theTree` ([`PDNumTree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNumTree)): IN/OUT The number tree for which a new entry is added - `key` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN/OUT The number of the entry. - `value` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): IN/OUT The value associated with `key`. @notify PDNumTreeNumAdded **Returns:** `void` **See also:** [`PDNumTreeGet`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNumTreeGet), [`PDNumTreeRemove`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNumTreeRemove) #### PDNumTreeRemove ```cpp void PDNumTreeRemove(PDNumTree theTree, ASInt32 key) ``` Header: `PDProcs.h:7762` Removes the specified object from the tree. It does nothing if no object with that number exists. **Parameters** - `theTree` ([`PDNumTree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNumTree)): IN/OUT The number tree from which an entry is removed. - `key` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN/OUT The number of the entry to remove. @notify PDNumTreeNumRemoved **Returns:** `void` **See also:** [`PDNumTreeGet`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNumTreeGet), [`PDNumTreePut`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNumTreePut) ### Typedefs (1) #### PDNumTree ```cpp typedef OPAQUE_64_BITS PDNumTree ``` Header: `PDExpT.h:5554` An object that points to the root node of a number tree inside a PDF file. A number tree is used to map integers to arbitrary Cos objects just as a Cos dictionary is used to map Cos names to Cos objects. However, a number tree can have many more entries than a Cos dictionary can. **See also:** [`PDNumTreeNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNumTreeNew), [`PDNumTreeFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNumTreeFromCosObj), [`PDNumTreeEnum`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDNumTreeEnum) ## PDOCConfig ### Functions (19) #### PDOCConfigCreate ```cpp PDOCConfig PDOCConfigCreate(PDDoc pdDoc) ``` Header: `PDProcs.h:9998` Creates a new optional-content configuration object. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document in which the configuration is used. **Returns:** [`PDOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfig) The newly created configuration object. **See also:** [`PDOCConfigDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfigDestroy) #### PDOCConfigDestroy ```cpp void PDOCConfigDestroy(PDOCConfig pdOCCfg) ``` Header: `PDProcs.h:10009` Removes an optional-content configuration object and destroys the Cos objects associated with it. If you pass this method the document's default configuration object (as returned by PDDocGetOCConfig()), nothing happens. **Parameters** - `pdOCCfg` ([`PDOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfig)): The configuration to destroy. **Returns:** `void` **See also:** [`PDOCConfigCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfigCreate) #### PDOCConfigGetAllRadioButtonGroups ```cpp PDOCG ** PDOCConfigGetAllRadioButtonGroups(PDOCConfig pdOCCfg) ``` Header: `PDProcs.h:10133` Returns an array of pointers to sets of optional-content groups in the configuration that are configured to be mutually exclusive. A set behaves like a radio button group, where only one member can be `ON` at one time. **Parameters** - `pdOCCfg` ([`PDOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfig)): The configuration. **Returns:** [`PDOCG **`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG) A `NULL`-terminated array of pointers to `NULL`-terminated arrays of optional-content groups (OCGs). The client is responsible for freeing all arrays using ASfree(). **See also:** [`PDOCConfigGetRadioButtonGroupForOCG`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfigGetRadioButtonGroupForOCG), [`PDOCConfigMakeRadioButtonGroup`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfigMakeRadioButtonGroup) #### PDOCConfigGetCosObj ```cpp CosObj PDOCConfigGetCosObj(PDOCConfig pdOCCfg) ``` Header: `PDProcs.h:10044` Gets the Cos object associated with the optional-content configuration. **Parameters** - `pdOCCfg` ([`PDOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfig)): The configuration for which a CosObj representation is desired. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) A CosObj representation of pdOCCfg. #### PDOCConfigGetCreator ```cpp ASText PDOCConfigGetCreator(PDOCConfig pdOCCfg) ``` Header: `PDProcs.h:10229` Gets the creator property for an optional-content configuration. **Parameters** - `pdOCCfg` ([`PDOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfig)): The configuration for which a creator is desired. **Returns:** [`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText) An ASText object containing the creator string from the Creator entry in the configuration's Cos dictionary, or `NULL` if there is no such entry. The client is responsible for freeing the ASText using ASTextDestroy(). **See also:** [`PDOCConfigSetCreator`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfigSetCreator), [`PDOCConfigGetName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfigGetName) #### PDOCConfigGetInitState ```cpp void PDOCConfigGetInitState(PDOCConfig pdOCCfg, PDOCConfigBaseState *bs, PDOCG **onOCGs, PDOCG **offOCGs) ``` Header: `PDProcs.h:10175` Gets the initial `ON-OFF` states of optional-content groups in an optional-content configuration. The client is responsible for freeing storage for the arrays using ASfree(). **Parameters** - `pdOCCfg` ([`PDOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfig)): The configuration for which the initial state is desired. - `bs` ([`PDOCConfigBaseState *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfigBaseState)): (Filled by the method) An existing PDOCConfigBaseState structure in which to store the initialization information. - `onOCGs` ([`PDOCG **`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG)): (Filled by the method) A `NULL`-terminated array of OCGs that have an initial state of `ON`, or `NULL` if there are no such groups. - `offOCGs` ([`PDOCG **`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG)): (Filled by the method) A `NULL`-terminated array of OCGs that have an initial state of `OFF`, or `NULL` if there are no such groups. **Returns:** `void` **See also:** [`PDOCConfigSetInitState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfigSetInitState), [`PDOCGGetInitialState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGGetInitialState) #### PDOCConfigGetIntent ```cpp ASAtom * PDOCConfigGetIntent(PDOCConfig pdOCCfg) ``` Header: `PDProcs.h:10287` Gets the Intent entry for an optional-content configuration. An intent is an ASAtom value broadly describing the intended use, either `View` or `Design`. A group's content is considered to be optional (that is, the group's state is considered in its visibility) if any intent in its list matches an intent of the context. The intent list of the context is usually set from the intent list of the document configuration. The intent array contains entries (atoms) terminated by ASAtomNull. If the configuration has no Intent entry, the default value of `View` is used. In this case, optional content is disabled for contexts initialized with this configuration. **Parameters** - `pdOCCfg` ([`PDOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfig)): The configuration for which an intent list is desired. **Returns:** [`ASAtom *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom) The ASAtomNull-terminated intent array. The client is responsible for freeing it using ASfree(). **See also:** [`PDOCConfigSetIntent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfigSetIntent), [`PDOCContextGetIntent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextGetIntent), [`PDOCGGetIntent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGGetIntent), [`PDOCGUsedInOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGUsedInOCConfig), [`PDOCGUsedInOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGUsedInOCContext) #### PDOCConfigGetLockedArray ```cpp PDOCG * PDOCConfigGetLockedArray(PDOCConfig pdOCCfg) ``` Header: `PDProcs.h:11180` Returns a PDOCConfig object's list of locked OCGs. The on/off state of a locked OCG cannot be toggled by the user through the user interface. **Parameters** - `pdOCCfg` ([`PDOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfig)): The optional-content configuration. **Returns:** [`PDOCG *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG) A `NULL`-terminated array of PDOCG objects, or `NULL` if the specified configuration does not contain a list of locked OCGs. The client is responsible for freeing the array using ASfree(). **See also:** [`PDOCConfigSetLockedArray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfigSetLockedArray), [`PDOCGGetLocked`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGGetLocked), [`PDOCGSetLocked`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGSetLocked) #### PDOCConfigGetName ```cpp ASText PDOCConfigGetName(PDOCConfig pdOCCfg) ``` Header: `PDProcs.h:10201` Gets the name of an optional-content configuration. **Parameters** - `pdOCCfg` ([`PDOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfig)): The configuration for which a name is desired. **Returns:** [`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText) An ASText object containing the name string from Name entry of the configuration's Cos dictionary, or `NULL` if there is no Name entry. The client is responsible for freeing the ASText object using ASTextDestroy(). **See also:** [`PDOCConfigSetName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfigSetName), [`PDOCConfigGetCreator`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfigGetCreator) #### PDOCConfigGetOCGOrder ```cpp ASBool PDOCConfigGetOCGOrder(PDOCConfig pdOCCfg, CosObj *orderObj) ``` Header: `PDProcs.h:10085` Gets the user interface display order of optional-content groups (OCGs) in an optional-content configuration. This is the order in which the group names are displayed in the Layers panel of Acrobat 6.0 and later. You can find this document on the web store of the International Standards Organization (ISO). **Parameters** - `pdOCCfg` ([`PDOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfig)): The configuration for which an OCG display order is desired. - `orderObj` ([`CosObj *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): (Filled by the method) A pointer to the Cos object containing the OCG order array. See the description of the Optional Content Groups (OCG) in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 8.11.2, page 222. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the order belongs directly to this configuration, `false` if it is inherited from the document's default configuration. **See also:** [`PDOCConfigSetOCGOrder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfigSetOCGOrder) #### PDOCConfigGetPDDoc ```cpp PDDoc PDOCConfigGetPDDoc(PDOCConfig pdOCCfg) ``` Header: `PDProcs.h:10034` Gets the document to which the optional-content configuration belongs. **Parameters** - `pdOCCfg` ([`PDOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfig)): The configuration for which a document is desired. **Returns:** [`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc) The document object. **See also:** [`PDDocGetOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetOCConfig) #### PDOCConfigGetRadioButtonGroupForOCG ```cpp PDOCG * PDOCConfigGetRadioButtonGroupForOCG(PDOCConfig pdOCCfg, PDOCG ocg) ``` Header: `PDProcs.h:10118` Returns an array of optional-content groups in the configuration that contains the specified group, and is configured to behave like a radio button group, where only one member of the set can be `ON` at one time. **Parameters** - `pdOCCfg` ([`PDOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfig)): The optional-content configuration. - `ocg` ([`PDOCG`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG)): The optional-content group for which to obtain the radio-button group. **Returns:** [`PDOCG *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG) A `NULL`-terminated array of PDOCG objects, or `NULL` if the specified group does not belong to any radio button group. The client is responsible for freeing the array using ASfree(). **See also:** [`PDOCConfigGetAllRadioButtonGroups`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfigGetAllRadioButtonGroups), [`PDOCConfigMakeRadioButtonGroup`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfigMakeRadioButtonGroup) #### PDOCConfigMakeRadioButtonGroup ```cpp void PDOCConfigMakeRadioButtonGroup(PDOCConfig pdOCCfg, PDOCG *ocgs) ``` Header: `PDProcs.h:10100` Configures a mutually exclusive set of optional-content groups in an optional-content configuration. The set behaves like a radio button group, where only one OCG from the set can be `ON` at a time. A client must enforce this in the user interface-level code, not the PD-level code. **Parameters** - `pdOCCfg` ([`PDOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfig)): The optional-content configuration. - `ocgs` ([`PDOCG *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG)): A `NULL`-terminated array of optional-content groups to be included in the group. **Returns:** `void` **See also:** [`PDOCConfigGetAllRadioButtonGroups`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfigGetAllRadioButtonGroups), [`PDOCConfigGetRadioButtonGroupForOCG`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfigGetRadioButtonGroupForOCG) #### PDOCConfigSetCreator ```cpp void PDOCConfigSetCreator(PDOCConfig pdOCCfg, ASConstText creator) ``` Header: `PDProcs.h:10214` Sets the creator property of an optional-content configuration. Stores the specified string as the Creator entry in the configuration's Cos dictionary. **Parameters** - `pdOCCfg` ([`PDOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfig)): The configuration for which to set a creator. - `creator` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): The new creator string. **Returns:** `void` **See also:** [`PDOCConfigGetCreator`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfigGetCreator), [`PDOCConfigSetName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfigSetName) #### PDOCConfigSetInitState ```cpp void PDOCConfigSetInitState(PDOCConfig pdOCCfg, PDOCConfigBaseState bs, PDOCG *onOCGs, PDOCG *offOCGs) ``` Header: `PDProcs.h:10152` Sets the initial `ON-OFF` states of optional-content groups to be saved in an optional-content configuration. **Parameters** - `pdOCCfg` ([`PDOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfig)): The configuration for which to set the initial state. - `bs` ([`PDOCConfigBaseState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfigBaseState)): An existing PDOCConfigBaseState structure containing the initialization information. - `onOCGs` ([`PDOCG *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG)): A `NULL`-terminated array of optional-content groups (OCGs) that have an initial state of `ON` when that is not the base state, or `NULL`. - `offOCGs` ([`PDOCG *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG)): A `NULL`-terminated array of OCGs that have an initial state of `OFF` when that is not the base state, or `NULL`. **Returns:** `void` **See also:** [`PDOCConfigGetInitState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfigGetInitState), [`PDOCGSetInitialState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGSetInitialState) #### PDOCConfigSetIntent ```cpp void PDOCConfigSetIntent(PDOCConfig pdOCCfg, ASAtom *intent) ``` Header: `PDProcs.h:10258` Sets the Intent entry in an optional-content configuration's Cos dictionary. An intent is an ASAtom value broadly describing the intended use, either `View` or `Design`. A group's content is considered to be optional (that is, the group's state is considered in its visibility) if any intent in its list matches an intent of the context. The intent list of the context is usually set from the intent list of the document configuration. If the configuration has no Intent entry, the default value of `View` is used. In this case, optional content is disabled for contexts initialized with this configuration. **Parameters** - `pdOCCfg` ([`PDOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfig)): The configuration for which to set an intent. - `intent` ([`ASAtom *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The new Intent entry value, an array of atoms terminated with ASAtomNull. To remove the Intent entry, pass an array with only one element, ASAtom`NULL`. **Returns:** `void` **See also:** [`PDOCConfigGetIntent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfigGetIntent), [`PDOCContextSetIntent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextSetIntent), [`PDOCGSetIntent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGSetIntent), [`PDOCGUsedInOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGUsedInOCConfig), [`PDOCGUsedInOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGUsedInOCContext) #### PDOCConfigSetLockedArray ```cpp void PDOCConfigSetLockedArray(PDOCConfig pdOCCfg, PDOCG *lockedOCGs) ``` Header: `PDProcs.h:11195` Sets a PDOCConfig's list of locked OCGs. The on/off state of a locked OCG cannot be toggled by the user through the user interface. **Parameters** - `pdOCCfg` ([`PDOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfig)): The optional-content configuration. - `lockedOCGs` ([`PDOCG *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG)): A `NULL`-terminated array of PDOCG objects to be used as the locked OCGs for the specified configuration, or `NULL` if the configuration should not contain a list of locked OCGs. **Returns:** `void` **See also:** [`PDOCConfigGetLockedArray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfigGetLockedArray), [`PDOCGGetLocked`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGGetLocked), [`PDOCGSetLocked`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGSetLocked) #### PDOCConfigSetName ```cpp void PDOCConfigSetName(PDOCConfig pdOCCfg, ASConstText name) ``` Header: `PDProcs.h:10188` Sets the name of an optional-content configuration. It stores the specified string as the Name entry in the configuration's Cos dictionary. **Parameters** - `pdOCCfg` ([`PDOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfig)): The configuration for which to set the name. - `name` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): The new name string. **Returns:** `void` **See also:** [`PDOCConfigGetName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfigGetName), [`PDOCConfigSetCreator`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfigSetCreator) #### PDOCConfigSetOCGOrder ```cpp void PDOCConfigSetOCGOrder(PDOCConfig pdOCCfg, CosObj orderArray) ``` Header: `PDProcs.h:10063` Sets the user interface display order of optional-content groups (OCGs) in an optional-content configuration. This is the order in which the group names are displayed in the Layers panel of Acrobat 6.0 and later. You can find this document on the web store of the International Standards Organization (ISO). Pass NULL to remove any existing order entry. **Parameters** - `pdOCCfg` ([`PDOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfig)): The configuration for which a OCG is desired. - `orderArray` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The Cos object containing the OCG order array. See the description of the Optional Content Groups (OCG) in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 8.11.2, page 222. **Returns:** `void` **See also:** [`PDOCConfigGetOCGOrder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfigGetOCGOrder) ### Typedefs (2) #### PDOCConfigBaseState ```cpp typedef ASUns8 PDOCConfigBaseState ``` Header: `PDExpT.h:5729` #### PDOCConfigEnumProc ```cpp typedef ASBool(*) PDOCConfigEnumProc(PDOCConfig occonfig, void *clientData)(PDOCConfig occonfig, void *clientData) ``` Header: `PDExpT.h:5858` A callback used for enumerating optional-content configurations. Enumeration stops when all configurations have been enumerated, or when the callback returns `false`. **See also:** [`PDDocEnumOCConfigs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocEnumOCConfigs) ### Structures (1) #### PDOCConfig ```cpp typedef struct _t_PDOCConfig* PDOCConfig ``` Header: `PDExpT.h:5681` A PDOCConfig represents a set of states and other information that is saved in a PDF file for future use. There is a document default configuration, saved in the /D entry in the OCProperties dictionary, and a list of other client configurations, saved as an array of configurations in the /Configs entry in the OCProperties dictionary. PDOCConfig objects are typically used to initialize the OCG states for a client's PDOCContext. ### Enums (1) #### PDOCConfigBaseStates Header: `PDExpT.h:5721` PDOCBaseState enumerates the three legal values for the BaseState key in an optional content configuration dictionary (PDOCConfig). When initializing a PDOCContext using KOCCInit_FromConfig(), this enumeration represents the starting state of the Optional Content Groups (OCGs) before the contents of the config's ON and OFF OCG lists are processed. If the BaseState is Unchanged, and the PDOCConfig is just being constructed, the current states of the OCGs from the PDDoc's own PDOCConfig are used. **Values** - `kPDOCBaseState_OFF = 0` - `kPDOCBaseState_ON = 1` - `kPDOCBaseState_Unchanged = 2` ## PDOCContext ### Functions (24) #### PDOCContextApplyAutoStateChanges ```cpp ASBool PDOCContextApplyAutoStateChanges(PDOCContext ctx, PDOCConfig cfg, ASAtom event) ``` Header: `PDProcs.h:9709` Calls PDOCContextFindAutoStateChanges() to find optional-content groups whose `ON-OFF` states should be toggled, based on usage application directives contained in the configuration's AS array, and applies the changes within the given context. The AS array defines how usage entries are used to automatically manipulate the OCG states. It associates an event (`View`, `Print`, or `Export`) with a list of OCGs and a category, or list of usage keys identifying OCG usage dictionary entries. See the description of the Optional Content Groups (OCG) in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 8.11.2, page 222. You can find this document on the web store of the International Standards Organization (ISO). **Parameters** - `ctx` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The context for which the visibility state is changed. - `cfg` ([`PDOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfig)): The configuration whose usage directives are used. - `event` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The event for which an `ON-OFF` state is automatically changed. Events are `View`, `Export`, and `Print`. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if successful, `false` otherwise. **See also:** [`PDOCContextFindAutoStateChanges`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextFindAutoStateChanges), [`PDOCContextMakeCopyWithAutoStateChanges`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextMakeCopyWithAutoStateChanges), [`PDOCContextClearAllUserOverrides`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextClearAllUserOverrides), [`PDOCGGetUserOverride`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGGetUserOverride), [`PDOCGSetUserOverride`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGSetUserOverride) #### PDOCContextClearAllUserOverrides ```cpp void PDOCContextClearAllUserOverrides(PDOCContext ctx) ``` Header: `PDProcs.h:10463` Removes usage override marks in all optional-content groups in the given context. When an optional-content group is marked as having had its state set explicitly in a specified context, automatic state changes caused by the `View` event are prevented. When a group's automatic state change is caused by the `Export` or `Print` event, the user-override setting for the group is ignored. A configuration's AS array defines how usage entries are used to automatically manipulate the OCG states. It associates an event (`View`, `Print`, or `Export`) with a list of OCGs and a category, or list of usage keys identifying OCG usage dictionary entries. See the description of the Optional Content Groups (OCG) in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 8.11.2, page 222. You can find this document on the web store of the International Standards Organization (ISO). **Parameters** - `ctx` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The context for which the user override marks are removed. **Returns:** `void` **See also:** [`PDOCGGetUserOverride`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGGetUserOverride), [`PDOCGSetUserOverride`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGSetUserOverride), [`PDOCContextApplyAutoStateChanges`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextApplyAutoStateChanges), [`PDOCContextFindAutoStateChanges`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextFindAutoStateChanges), [`PDOCContextMakeCopyWithAutoStateChanges`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextMakeCopyWithAutoStateChanges) #### PDOCContextContentIsVisible ```cpp ASBool PDOCContextContentIsVisible(PDOCContext ocContext) ``` Header: `PDProcs.h:9966` Tests whether content is visible in the optional-content context. The method considers the context's current OCMD stack, the group `ON-OFF` states, the non-OC drawing status, the drawing and enumeration type, and the intent. Use this method in conjunction with the OCMD stack methods. **Parameters** - `ocContext` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The context for which the visibility state is desired. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the content is visible, `false` otherwise. **See also:** [`PDOCContextPopOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextPopOCMD), [`PDOCContextPushOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextPushOCMD), [`PDOCContextResetOCMDStack`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextResetOCMDStack), [`PDOCContextXObjectIsVisible`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextXObjectIsVisible) #### PDOCContextFindAutoStateChanges ```cpp PDOCG * PDOCContextFindAutoStateChanges(PDOCContext ctx, PDOCConfig cfg, ASAtom event) ``` Header: `PDProcs.h:9677` Finds optional-content groups whose `ON-OFF` states should be toggled in the context, based on usage application directives contained in the configuration's AS array. The AS array defines how usage entries are used to automatically manipulate the OCG states. It associates an event (`View`, `Print`, or `Export`) with a list of OCGs and a category, or list of usage keys identifying OCG usage dictionary entries. **Parameters** - `ctx` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The context for which the visibility state should be changed. - `cfg` ([`PDOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfig)): The configuration whose usage directives are used. - `event` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The event for which an `ON-OFF` state is automatically changed. Events are `View`, `Export`, and `Print`. **Returns:** [`PDOCG *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG) A `NULL`-terminated array of optional-content group objects. The client is responsible for freeing it using ASfree(). **See also:** [`PDOCContextApplyAutoStateChanges`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextApplyAutoStateChanges), [`PDOCContextMakeCopyWithAutoStateChanges`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextMakeCopyWithAutoStateChanges), [`PDOCContextClearAllUserOverrides`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextClearAllUserOverrides), [`PDOCGGetUserOverride`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGGetUserOverride), [`PDOCGSetUserOverride`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGSetUserOverride) #### PDOCContextFree ```cpp void PDOCContextFree(PDOCContext ocContext) ``` Header: `PDProcs.h:9481` Destroys an optional-content context object and frees the associated memory as needed. **Parameters** - `ocContext` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The context object to free. **Returns:** `void` **See also:** [`PDOCContextInit`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextInit), [`PDOCContextNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextNew) #### PDOCContextGetIntent ```cpp ASAtom * PDOCContextGetIntent(PDOCContext ocContext) ``` Header: `PDProcs.h:9797` Gets the intent list for an optional-content context. An intent is an ASAtom value broadly describing the intended use, either `View` or `Design`. A group's content is considered to be optional (that is, the group's state is considered in its visibility) if any intent in its list matches an intent of the context. The intent list of the context is usually set from the intent list of the document configuration. **Parameters** - `ocContext` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The context for which an intent is desired. **Returns:** [`ASAtom *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom) An array containing intent entries (ASAtom objects) terminated by ASAtomNull. The client is responsible for freeing it using ASfree(). **See also:** [`PDOCContextSetIntent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextSetIntent), [`PDOCConfigGetIntent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfigGetIntent), [`PDOCGGetIntent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGGetIntent), [`PDOCGUsedInOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGUsedInOCConfig), [`PDOCGUsedInOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGUsedInOCContext) #### PDOCContextGetNonOCDrawing ```cpp ASBool PDOCContextGetNonOCDrawing(PDOCContext ocContext) ``` Header: `PDProcs.h:9838` Gets the non-OC drawing status for an optional-content context. Content that is not marked as optional content is drawn when NonOCDrawing is `true`, and not drawn when NonOCDrawing is `false`. Together, this value and the PDOCDrawEnumType value of the context determine how both optional and non-optional content on a page is drawn or enumerated. See PDOCDrawEnumType(). **Parameters** - `ocContext` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The context for which the non-OC drawing status is desired.`true` if the context's NonOCDrawing is `true`, `false` otherwise. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) **See also:** [`PDOCContextSetNonOCDrawing`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextSetNonOCDrawing), [`PDOCContextGetOCDrawEnumType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextGetOCDrawEnumType), [`PDOCContextNewWithOCDisabled`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextNewWithOCDisabled) #### PDOCContextGetOCDrawEnumType ```cpp PDOCDrawEnumType PDOCContextGetOCDrawEnumType(PDOCContext ocContext) ``` Header: `PDProcs.h:9747` Gets the drawing and enumeration type for an optional-content context. This type, together with the visibility determined by the OCG and Optional Content Membership Dictionary (OCMD) states, controls whether content that is marked as optional content is drawn or enumerated. Together, this value and the NonOCDrawing value of the context determine how both optional and non-optional content on a page is drawn or enumerated. See PDOCDrawEnumType(). @since **Parameters** - `ocContext` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The context for which the drawing and enumeration type is desired. **Returns:** [`PDOCDrawEnumType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCDrawEnumType) **See also:** [`PDOCContextGetNonOCDrawing`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextGetNonOCDrawing), [`PDOCContextSetOCDrawEnumType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextSetOCDrawEnumType) #### PDOCContextGetOCGStates ```cpp void PDOCContextGetOCGStates(PDOCContext ocContext, PDOCG *pdocgs, ASBool *states) ``` Header: `PDProcs.h:9604` Gets the `ON-OFF` states for the given optional-content groups (OCGs) in the given optional-content context. It returns the states in the `states` array, which must be large enough to hold as many ASBool values as there are OCGs. **Parameters** - `ocContext` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The context for which the OCG states are desired. - `pdocgs` ([`PDOCG *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG)): A `NULL`-terminated array of optional-content groups whose states are obtained. - `states` ([`ASBool *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): (Filled by the method) An array of OCG states corresponding to the array of OCGs, `true` for ON and `false` for `OFF`. The array must be large enough to hold as many states as there are non-`NULL` OCGs. **Returns:** `void` **See also:** [`PDOCContextSetOCGStates`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextSetOCGStates) #### PDOCContextGetPDDoc ```cpp PDDoc PDOCContextGetPDDoc(PDOCContext ocContext) ``` Header: `PDProcs.h:9505` Gets the document that contains an optional-content context. **Parameters** - `ocContext` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The context for which a document is desired. **Returns:** [`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc) The document object. **See also:** [`PDDocGetOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetOCContext) #### PDOCContextInit ```cpp void PDOCContextInit(PDOCContext ocContext, PDOCContextInitPolicy policy, PDOCContext otherCtx, PDOCConfig pdOCCfg) ``` Header: `PDProcs.h:9524` Initializes the `ON-OFF` states of all optional-content groups (OCGs) within an existing context. **Parameters** - `ocContext` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The context to initialize. - `policy` ([`PDOCContextInitPolicy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextInitPolicy)): The initialization policy for the context. This value determines whether optional-content groups are initially `ON` or `OFF`. - `otherCtx` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): Another context from which to take initial OCG states when the policy is kOCCInit_FromOtherContext. It is ignored for other policies. - `pdOCCfg` ([`PDOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfig)): A configuration from which to take initial OCG states when the policy is kOCCInit_FromConfig. It is ignored for other policies. **Returns:** `void` **See also:** [`PDOCContextNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextNew), [`PDOCContextFree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextFree) #### PDOCContextMakeCopy ```cpp PDOCContext PDOCContextMakeCopy(PDOCContext ocContext) ``` Header: `PDProcs.h:9543` Creates a new context object to represent an optional-content state of the document, using an existing context as a template. This is the same as the following call: `PDOCCOntextNew(kOCCInit_FromOtherContext, ocContext, NULL, PDOCContextGetPDDoc(ocContext));` **Parameters** - `ocContext` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The context to copy. **Returns:** [`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext) The new PDOCContext object. The client is responsible for freeing the context using PDOCContextFree(). **See also:** [`PDDocGetOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetOCContext), [`PDOCContextInit`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextInit), [`PDOCContextNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextNew), [`PDOCContextFree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextFree) #### PDOCContextMakeCopyWithAutoStateChanges ```cpp PDOCContext PDOCContextMakeCopyWithAutoStateChanges(PDOCContext inCtx, PDOCConfig cfg, ASAtom event) ``` Header: `PDProcs.h:9650` Creates a new context object that represents an optional-content state of the document, using an existing context as a template, but applying an automatic state change for the specified event. An automatic state change toggles all groups' `ON-OFF` states when the triggering event occurs. A configuration's AS array defines how usage entries are used to automatically manipulate the OCG states. It associates an event (`View`, `Print`, or `Export`) with a list of OCGs and a category, or list of usage keys identifying OCG usage dictionary entries. @since **Parameters** - `inCtx` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The context to copy. - `cfg` ([`PDOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfig)): The configuration in which the automatic state change applies. - `event` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The event for which state will automatically change. Events are `View`, `Export`, and `Print`. **Returns:** [`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext) **See also:** [`PDOCContextApplyAutoStateChanges`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextApplyAutoStateChanges), [`PDOCContextFindAutoStateChanges`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextFindAutoStateChanges), [`PDOCContextClearAllUserOverrides`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextClearAllUserOverrides), [`PDOCGGetUserOverride`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGGetUserOverride), [`PDOCGSetUserOverride`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGSetUserOverride) #### PDOCContextNew ```cpp PDOCContext PDOCContextNew(PDOCContextInitPolicy policy, PDOCContext otherCtx, PDOCConfig pdOCCfg, PDDoc pdDoc) ``` Header: `PDProcs.h:9471` Creates a context object that represents an optional-content state of the document, initializing it in the same way as PDOCContextInit(). **Parameters** - `policy` ([`PDOCContextInitPolicy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextInitPolicy)): The initialization policy for the new context. This value determines whether optional-content groups (OCGs) are initially `ON` or `OFF`. - `otherCtx` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): Another context from which to take initial OCG states when the policy is kOCCInit_FromOtherContext. It is ignored for other policies. - `pdOCCfg` ([`PDOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfig)): A configuration from which to take initial OCG states when the policy is kOCCInit_FromConfig. It is ignored for other policies. - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document for which to create a context. **Returns:** [`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext) The new PDOCContext object. The client is responsible for freeing the context using PDOCContextFree(). **See also:** [`PDOCContextInit`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextInit), [`PDOCContextFree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextFree) #### PDOCContextNewWithInitialState ```cpp PDOCContext PDOCContextNewWithInitialState(PDDoc pdDoc) ``` Header: `PDProcs.h:9586` Creates a context object that represents an optional-content state of the document, using the current state as the initial state for each group (OCG), as determined by the document's optional-content configuration (returned by `PDDocGetOCConfig(pdDoc)`). **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document for which to create a context. **Returns:** [`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext) The new PDOCContext object. The client is responsible for freeing the context using PDOCContextFree(). **See also:** [`PDDocGetOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetOCConfig), [`PDOCContextInit`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextInit), [`PDOCContextNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextNew), [`PDOCContextNewWithOCDisabled`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextNewWithOCDisabled), [`PDOCContextFree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextFree) #### PDOCContextNewWithOCDisabled ```cpp PDOCContext PDOCContextNewWithOCDisabled(PDDoc pdDoc) ``` Header: `PDProcs.h:9568` Creates a context object that represents an optional-content state of the document, with the PDOCDrawEnumType property set to kPDOC_NoOC, so that no content marked as optional content is drawn, regardless of the visibility according to the OCGs and OCMDs. Content that is not marked as optional content may still be drawn, depending on the NonOCDrawing property. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document for which to create a context. **Returns:** [`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext) The new PDOCContext object. The client is responsible for freeing the context using PDOCContextFree(). **See also:** [`PDOCContextInit`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextInit), [`PDOCContextNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextNew), [`PDOCContextNewWithInitialState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextNewWithInitialState), [`PDOCContextFree`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextFree), [`PDOCContextGetNonOCDrawing`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextGetNonOCDrawing), [`PDOCContextGetOCDrawEnumType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextGetOCDrawEnumType), [`PDOCContextSetNonOCDrawing`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextSetNonOCDrawing), [`PDOCContextSetOCDrawEnumType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextSetOCDrawEnumType) #### PDOCContextPopOCMD ```cpp void PDOCContextPopOCMD(PDOCContext ocContext) ``` Header: `PDProcs.h:9946` Pops the optional-content membership dictionary (OCMD) stack for an optional-content context. The stack is used to track nesting of optional-content states as contents are enumerated or drawn: • Call the PDOCContextPushOCMD() method when entering BDC for optional content or beginning to process a form or annotation that has a OC entry. • Call this method to pop the stack when encountering EMC, or finishing the processing of a form or annotation appearance. To track nested content that is not for optional content, pass in `NULL` for pdOCMD when pushing the OCMD stack for BMC, patterns, and charprocs, for BDC with no optional content, or for forms or annotations that do not have an OC entry. When finished processing any of these objects, you can call PDOCContextPopOCMD() without worrying about whether the content was optional. **Parameters** - `ocContext` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The context for which to pop the OCMD stack. **Returns:** `void` **See also:** [`PDOCContextPushOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextPushOCMD), [`PDOCContextResetOCMDStack`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextResetOCMDStack), [`PDOCContextContentIsVisible`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextContentIsVisible), [`PDOCContextXObjectIsVisible`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextXObjectIsVisible) #### PDOCContextPushOCMD ```cpp void PDOCContextPushOCMD(PDOCContext pdOCContext, PDOCMD pdOCMD) ``` Header: `PDProcs.h:9914` Pushes a new optional-content membership dictionary (OCMD) onto the stack for an optional-content context. The stack is used to track nesting of optional-content states as contents are enumerated or drawn. Call this method when entering the BDC for optional content or beginning to process a form or annotation that has a OC entry. Call PDOCContextPopOCMD() when encountering an EMC, or finishing the processing of a form or annotation appearance. To make it easier to track nested content that is not for optional content, pass `NULL` for pdOCMD when encountering BMC, patterns, and charprocs. Also pass `NULL` for a BDC with no optional content or for forms or annotations that do not have an OC entry. When finished processing any of these objects, you can call PDOCContextPopOCMD() without worrying about whether the content was optional. **Parameters** - `pdOCContext` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The context containing the OCMD stack. - `pdOCMD` ([`PDOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMD)): The OCMD to push onto the stack. **Returns:** `void` **See also:** [`PDOCContextPopOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextPopOCMD), [`PDOCContextResetOCMDStack`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextResetOCMDStack), [`PDOCContextContentIsVisible`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextContentIsVisible), [`PDOCContextXObjectIsVisible`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextXObjectIsVisible) #### PDOCContextResetOCMDStack ```cpp void PDOCContextResetOCMDStack(PDOCContext pdOCContext) ``` Header: `PDProcs.h:9884` Clears the Optional Content Membership Dictionary (OCMD) stack for an optional-content context, and resets the current visibility for the context based on the context's non-OC drawing setting (see PDOCContextSetNonOCDrawing()). Call this method at the start of an enumeration or drawing operation that uses a given context. The OCMD stack contains optional-content membership dictionary objects. The OCMD stack methods and the various methods that test visibility (such as PDAnnotIsCurrentlyVisible()) work together as content is being enumerated or drawn to determine whether particular graphical elements are visible or not. Visibility is based on the context's collection of `ON-OFF` states for optional-content groups, the context's current settings for NonOCDrawing and PDOCDrawEnumType, and the state of the OCMD stack. Any custom drawing or enumerating code that needs to keep track of visibility of content must make a private copy of the PDOCContext if that context could be accessed by some other client, in order to avoid conflicting state changes. In particular, you must copy the document's default context (as returned by PDDocGetOCContext()). To enforce this, this reset method does nothing when given a document's default context. Similarly, the push and pop stack operations raise an error for the default context. If you are using the PD-level draw and enumeration methods, you do not need to copy the context or explicitly call the OCMD stack methods, as the PD-level methods do this internally. Clients of PDFEdit and other libraries that enumerate contents need to use these three methods when traversing the PDEContent structure. When entering a new PDEContent, call PDOCContextPushOCMD() (passing an OCMD object or `NULL`). Upon finishing the traversal, call PDOCContextPopOCMD(). @since **Parameters** - `pdOCContext` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The context for which to reset the OCMD stack. **Returns:** `void` **See also:** [`PDOCContextPopOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextPopOCMD), [`PDOCContextPushOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextPushOCMD), [`PDOCContextContentIsVisible`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextContentIsVisible), [`PDOCContextXObjectIsVisible`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextXObjectIsVisible) #### PDOCContextSetIntent ```cpp void PDOCContextSetIntent(PDOCContext ocContext, ASAtom *intent) ``` Header: `PDProcs.h:9773` Sets the Intent entry in an optional-content context's Cos dictionary. An intent is an ASAtom value broadly describing the intended use, either `View` or `Design`. A group's content is considered to be optional (that is, the group's state is considered in its visibility) if any intent in its list matches an intent of the context. The intent list of the context is usually set from the intent list of the document configuration. It raises an exception if the context is busy. **Parameters** - `ocContext` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The context for which to set the intent. - `intent` ([`ASAtom *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The new Intent entry value, an array of atoms terminated with ASAtomNull. **Returns:** `void` **See also:** [`PDOCContextGetIntent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextGetIntent), [`PDOCConfigSetIntent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfigSetIntent), [`PDOCGSetIntent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGSetIntent), [`PDOCGUsedInOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGUsedInOCConfig), [`PDOCGUsedInOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGUsedInOCContext) #### PDOCContextSetNonOCDrawing ```cpp void PDOCContextSetNonOCDrawing(PDOCContext ocContext, ASBool drawNonOC) ``` Header: `PDProcs.h:9817` Sets the non-OC status for an optional-content context. Content that is not marked as optional content is drawn when NonOCDrawing is `true`, and not drawn when NonOCDrawing is `false`. Together, this value and the PDOCDrawEnumType value of the context determine how both optional and non-optional content on a page is drawn or enumerated. See PDOCDrawEnumType(). **Parameters** - `ocContext` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The context for which to set the non-OC drawing status. - `drawNonOC` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): The new value for the non-OC drawing status, `true` or `false`. **Returns:** `void` **See also:** [`PDOCContextGetNonOCDrawing`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextGetNonOCDrawing), [`PDOCContextGetOCDrawEnumType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextGetOCDrawEnumType) #### PDOCContextSetOCDrawEnumType ```cpp void PDOCContextSetOCDrawEnumType(PDOCContext ocContext, PDOCDrawEnumType dt) ``` Header: `PDProcs.h:9728` Sets the drawing and enumeration type for an optional-content context. This type, together with the visibility determined by the OCG and OCMD states, controls whether content that is marked as optional content is drawn or enumerated. Together, this value and the NonOCDrawing value of the context determine how both optional and non-optional content on a page is drawn or enumerated. See PDOCDrawEnumType(). **Parameters** - `ocContext` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The context for which the drawing and enumeration type is desired. - `dt` ([`PDOCDrawEnumType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCDrawEnumType)): The new drawing and enumeration type. **Returns:** `void` **See also:** [`PDOCContextGetOCDrawEnumType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextGetOCDrawEnumType), [`PDOCContextSetNonOCDrawing`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextSetNonOCDrawing) #### PDOCContextSetOCGStates ```cpp void PDOCContextSetOCGStates(PDOCContext ocContext, PDOCG *pdocgs, ASBool *newStates) ``` Header: `PDProcs.h:9622` Sets the `ON-OFF` states for the given optional-content groups (OCGs) in the given optional-content context. The `newStates` array must be large enough to hold as many ASBool values as there are OCGs. **Parameters** - `ocContext` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The context for which the OCG states are set. - `pdocgs` ([`PDOCG *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG)): A `NULL`-terminated array of optional-content groups. - `newStates` ([`ASBool *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): An array of new OCG states corresponding to the array of OCGs, `true` for ON and `false` for `OFF`. The array must contain as many states as there are non-`NULL` OCGs in the `pdocgs` array. **Returns:** `void` **See also:** [`PDOCContextGetOCGStates`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextGetOCGStates) #### PDOCContextXObjectIsVisible ```cpp ASBool PDOCContextXObjectIsVisible(PDOCContext pdOCContext, CosObj obj) ``` Header: `PDProcs.h:9988` Tests whether an XObject form or image contained in `obj` is visible in the optional-content context. The method considers the context's current OCMD stack, optional-content group `ON-OFF` states, the non-OC drawing status, the drawing and enumeration type, the intent, and the specific OCG. Use this method in conjunction with the OCMD stack methods. **Parameters** - `pdOCContext` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The context for which to test visibility. - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The external object. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the external object is visible, `false` otherwise. **See also:** [`PDOCContextContentIsVisible`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextContentIsVisible), [`PDOCContextPopOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextPopOCMD), [`PDOCContextPushOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextPushOCMD), [`PDOCContextResetOCMDStack`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextResetOCMDStack) ### Typedefs (3) #### PDOCContextChangeType ```cpp typedef ASUns8 PDOCContextChangeType ``` Header: `PDExpT.h:5787` #### PDOCContextInitPolicy ```cpp typedef ASUns8 PDOCContextInitPolicy ``` Header: `PDExpT.h:5712` #### PDOCDrawEnumType ```cpp typedef ASUns8 PDOCDrawEnumType ``` Header: `PDExpT.h:5769` ### Structures (1) #### PDOCContext ```cpp typedef struct _t_PDOCContext* PDOCContext ``` Header: `PDExpT.h:5672` A PDOCContext is an object that keeps track the on/off states of all of the OCGs in a document. There can be more than one PDOCContext object, representing different combinations of OCG states. The PDDoc contains an internal PDOCContext that is used for on-screen drawing and as the default state used for any other drawing or content enumeration. Clients can change the states of OCGs within any PDOCContext. Clients can build (and save in the PDF file) PDOCContext objects with their own combination of OCG states, and issue drawing or enumeration commands using their own PDOCContext instead of the document's internal PDOCContext. All discussion of *visibility* of content is therefore meant to be with respect to the OCG states stored in a specific PDOCContext. ### Enums (3) #### PDOCContextChangeTypes Header: `PDExpT.h:5773` The optional-content group (OCG) state is changing. **Values** - `kPDOCGState = 0`: The OCGs' states are changing. - `kPDOCContextDrawEnumType = 1`: The PDOCContext object's PDDrawEnumType is changing. - `kPDOCContextNonOCDrawing = 2`: The PDOCContext object's non-optional content drawing is changing. - `kPDOCContextIntent = 3`: The PDOCContext object's intent is changing. - `kPDOCContextInit = 4`: The PDOCContext is being reset using PDOCContextInit(). - `kPDOC_LastContextChangeType = kPDOCContextInit` #### PDOCContextInitPolicies Header: `PDExpT.h:5702` PDOCContextInitPolicy is used to specify how to initialize the states of Optional Content Groups (OCGs) when calling PDOCContextNew() or PDOCContextInit(). **Values** - `kOCCInit_OFF = 0` - `kOCCInit_ON = 1` - `kOCCInit_FromOtherContext = 2` - `kOCCInit_FromConfig = 3` #### PDOCDrawEnumTypes Header: `PDExpT.h:5750` PDOCDrawEnumType controls drawing or enumerating the page with respect to optional content. It is an enumerated type that, together with the `NonOCDrawing` value, controls drawing or enumerating content on a page with optional content: • Content that is marked as optional content is drawn or not drawn according to the PDOCDrawEnumType and the visibility state as determined by the Optional Content Groups (OCGs) and OCMDs. • Content that is not marked as optional content is drawn when `NonOCDrawing` is `true`, and not drawn when `NonOCDrawing` is `false`. **Values** - `kPDOC_VisibleOC = 0`: Draw or enumerate optional content that is visible, according to the current state of Optional Content Groups (OCGs) and Optional Content Membership Dictionaries (OCMDs). This is the normal default mode. - `kPDOC_AllOC = 1`: Draw or enumerate all optional content, regardless of its visibility state. If the context's `NonOCDrawing` is `true`, all contents of document are shown. - `kPDOC_NoOC = 2`: Draw or enumerate no optional content, regardless of its visibility state. If the context's `NonOCDrawing` is `false`, nothing is drawn, resulting in a blank page. - `kPDOC_LastDrawEnumType = kPDOC_NoOC` **See also:** [`PDOCContextGetOCDrawEnumType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextGetOCDrawEnumType), [`PDOCContextSetOCDrawEnumType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextSetOCDrawEnumType), [`PDOCContextGetNonOCDrawing`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextGetNonOCDrawing), [`PDOCContextSetNonOCDrawing`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextSetNonOCDrawing) ## PDOCG ### Functions (24) #### PDOCGCreate ```cpp PDOCG PDOCGCreate(PDDoc pdDoc, ASConstText name) ``` Header: `PDProcs.h:8805` Creates a new optional-content group (OCG) object in the document. The order of the groups (as returned by PDDocGetOCGs()) is not guaranteed, and is not the same as the display order (see PDOCConfigGetOCGOrder()). **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document in which the group is used. - `name` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): The name of the optional-content group. **Returns:** [`PDOCG`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG) The newly created group object. **See also:** [`PDDocGetOCGs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetOCGs), [`PDOCGCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGCreateFromCosObj), [`PDOCGDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGDestroy) #### PDOCGCreateFromCosObj ```cpp PDOCG PDOCGCreateFromCosObj(CosObj ocgObj) ``` Header: `PDProcs.h:8817` Creates a new optional-content group (OCG) object from a Cos object. **Parameters** - `ocgObj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The Cos object. **Returns:** [`PDOCG`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG) The newly created OCG object. **See also:** [`PDOCGCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGCreate), [`PDOCGGetCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGGetCosObj), [`PDOCGDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGDestroy) #### PDOCGDestroy ```cpp void PDOCGDestroy(PDOCG pdocg) ``` Header: `PDProcs.h:8829` Destroys an optional-content group (OCG) object. This does not delete any content, but deletes the PDOCG object, destroys the corresponding Cos object, and invalidates references from optional-content membership dictionaries (OCMDs). **Parameters** - `pdocg` ([`PDOCG`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG)): The optional-content group object. **Returns:** `void` **See also:** [`PDOCGCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGCreate), [`PDOCGCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGCreateFromCosObj) #### PDOCGGetCosObj ```cpp CosObj PDOCGGetCosObj(PDOCG pdocg) ``` Header: `PDProcs.h:8839` Gets the Cos object associated with the optional-content group (OCG) object. **Parameters** - `pdocg` ([`PDOCG`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG)): The optional-content group object. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) The Cos object. **See also:** [`PDOCGCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGCreateFromCosObj) #### PDOCGGetCurrentState ```cpp ASBool PDOCGGetCurrentState(PDOCG pdocg, PDOCContext ocContext) ``` Header: `PDProcs.h:9093` Gets the current `ON-OFF` state of the optional-content group (OCG) object in a given context. **Parameters** - `pdocg` ([`PDOCG`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG)): The optional-content group object. - `ocContext` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The context for which to get the group's state. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the state is `ON`, `false` if it is `OFF`. **See also:** [`PDOCGGetInitialState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGGetInitialState), [`PDOCGGetUsageEntry`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGGetUsageEntry), [`PDOCContextGetOCGStates`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextGetOCGStates), [`PDOCContextSetOCGStates`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextSetOCGStates), [`PDOCGSetCurrentState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGSetCurrentState) #### PDOCGGetFromCosObj ```cpp PDOCG PDOCGGetFromCosObj(CosObj obj) ``` Header: `PDProcs.h:8853` Gets an optional-content group (OCG) object from the associated Cos object. If you call this multiple times for the same PDOCG, it returns the same object. **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The Cos object. **Returns:** [`PDOCG`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG) The OCG object. **See also:** [`PDOCGCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGCreate), [`PDOCGCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGCreateFromCosObj), [`PDOCGGetCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGGetCosObj), [`PDOCGDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGDestroy) #### PDOCGGetInitialState ```cpp ASBool PDOCGGetInitialState(PDOCG pdocg, PDOCConfig pdOCCfg, ASBool *initState) ``` Header: `PDProcs.h:8928` Gets a initial state (`ON` or `OFF`) of the optional-content group (OCG) object in a given configuration. If the configuration has a `BaseState` of `Unchanged`, and the OCG is not listed explicitly in its `ON` list or `OFF` list, then the initial state is taken from the OCG's current state in the document's default context, and the method returns `false`. **Parameters** - `pdocg` ([`PDOCG`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG)): The optional-content group object. - `pdOCCfg` ([`PDOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfig)): The configuration for which to get the group's initial state. - `initState` ([`ASBool *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): (Filled by the method) The initial state, `true` if the state is `ON`, `false` if it is `OFF`. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the initial state is unambiguously defined in the configuration, `false` otherwise. **See also:** [`PDOCGGetCurrentState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGGetCurrentState), [`PDOCGGetUsageEntry`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGGetUsageEntry), [`PDOCGRemoveInitialState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGRemoveInitialState), [`PDOCGSetInitialState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGSetInitialState), [`PDOCContextGetOCGStates`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextGetOCGStates), [`PDOCContextSetOCGStates`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextSetOCGStates) #### PDOCGGetIntent ```cpp ASAtom * PDOCGGetIntent(PDOCG pdocg) ``` Header: `PDProcs.h:9077` Gets the intent list for an optional-content group. An intent is an ASAtom value broadly describing the intended use, either `View` or `Design`. A group's content is considered to be optional (that is, the group's state is considered in its visibility) if any intent in its list matches an intent of the context. The intent list of the context is usually set from the intent list of the document configuration. **Parameters** - `pdocg` ([`PDOCG`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG)): The optional-content group object for which the intent is desired. **Returns:** [`ASAtom *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom) An array containing intent entries (ASAtom objects) terminated by ASAtomNull. The client is responsible for freeing it using ASfree(). **See also:** [`PDOCGSetIntent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGSetIntent), [`PDOCContextGetIntent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextGetIntent), [`PDOCConfigGetIntent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfigGetIntent), [`PDOCGUsedInOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGUsedInOCConfig), [`PDOCGUsedInOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGUsedInOCContext) #### PDOCGGetLocked ```cpp ASBool PDOCGGetLocked(PDOCG ocg, PDOCConfig pdOCCfg) ``` Header: `PDProcs.h:11150` Returns the locked state of an OCG in a given configuration. The on/off state of a locked OCG cannot be toggled by the user through the user interface. **Parameters** - `ocg` ([`PDOCG`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG)): IN The PDOCG whose locked state is requested. - `pdOCCfg` ([`PDOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfig)): IN The optional-content configuration. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) An ASBool that is `true` if the OCG is locked, and `false` if it is unlocked. **See also:** [`PDOCGSetLocked`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGSetLocked), [`PDOCConfigGetLockedArray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfigGetLockedArray), [`PDOCConfigSetLockedArray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfigSetLockedArray) #### PDOCGGetName ```cpp ASText PDOCGGetName(PDOCG pdocg) ``` Header: `PDProcs.h:8886` Gets the name of an optional-content group. The returned ASText is a copy of the OCG's name. The client is free to modify it and responsible for destroying it. **Parameters** - `pdocg` ([`PDOCG`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG)): The optional-content group object for which the name is desired. **Returns:** [`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText) The name string. **See also:** [`PDOCGSetName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGSetName) #### PDOCGGetPDDoc ```cpp PDDoc PDOCGGetPDDoc(PDOCG pdocg) ``` Header: `PDProcs.h:8865` Gets the document that contains an optional-content group. **Parameters** - `pdocg` ([`PDOCG`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG)): The optional-content group object for which the document is desired. **Returns:** [`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc) The document object. **See also:** [`PDDocGetOCGs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetOCGs), [`PDOCMDGetPDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMDGetPDDoc) #### PDOCGGetUsageEntry ```cpp CosObj PDOCGGetUsageEntry(PDOCG pdocg, ASAtom entry) ``` Header: `PDProcs.h:9028` Gets usage information from an optional-content group (OCG) object. A Usage dictionary entry provides more specific intended usage information than an intent entry. The possible key values are: `CreatorInfo` `Language` `Export` `Zoom` `Print` `View` `User` `PageElement` **Parameters** - `pdocg` ([`PDOCG`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG)): The optional-content group object. - `entry` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The usage key in the usage dictionary entry. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) The usage information associated with the given key in the Usage dictionary for the group, or a `NULL` Cos object if the operation fails (because the OCG is malformed or has no dictionary, or because the dictionary has no entry corresponding to the given key). **See also:** [`PDOCGHasUsageInfo`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGHasUsageInfo), [`PDOCGSetUsageDictEntry`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGSetUsageDictEntry) #### PDOCGGetUserOverride ```cpp ASBool PDOCGGetUserOverride(PDOCG ocg, PDOCContext ctx) ``` Header: `PDProcs.h:10431` Tests whether the optional-content group is marked as having had its state set directly by client code in the specified context (as opposed to automatically by the optional-content AutoState mechanism). When a group is so marked, automatic state changes caused by the `View` event are prevented. When a group's automatic state change is caused by the `Export` or `Print` event, the user-override setting for the group is ignored. A configuration's AS array defines how usage entries are used to automatically manipulate the OCG states. It associates an event (`View`, `Print`, or `Export`) with a list of OCGs and a category, or list of usage keys identifying OCG usage dictionary entries. @since **Parameters** - `ocg` ([`PDOCG`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG)): The optional-content group object. - `ctx` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The context for which the group is tested. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) **See also:** [`PDOCGSetUserOverride`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGSetUserOverride), [`PDOCContextClearAllUserOverrides`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextClearAllUserOverrides), [`PDOCContextFindAutoStateChanges`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextFindAutoStateChanges), [`PDOCContextApplyAutoStateChanges`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextApplyAutoStateChanges), [`PDOCContextMakeCopyWithAutoStateChanges`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextMakeCopyWithAutoStateChanges) #### PDOCGHasUsageInfo ```cpp ASBool PDOCGHasUsageInfo(PDOCG pdocg) ``` Header: `PDProcs.h:8998` Tests whether an optional-content group (OCG) object is associated with a Usage dictionary. **Parameters** - `pdocg` ([`PDOCG`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG)): The optional-content group object. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the group has a Usage dictionary, `false` otherwise. **See also:** [`PDOCGGetUsageEntry`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGGetUsageEntry), [`PDOCGSetUsageDictEntry`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGSetUsageDictEntry) #### PDOCGRemoveInitialState ```cpp void PDOCGRemoveInitialState(PDOCG pdocg, PDOCConfig pdOCCfg) ``` Header: `PDProcs.h:8945` Removes the initial `ON-OFF` state information for the optional-content group (OCG) object in a given configuration. **Parameters** - `pdocg` ([`PDOCG`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG)): The optional-content group object. - `pdOCCfg` ([`PDOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfig)): The configuration for which to remove the group's initial state. **Returns:** `void` **See also:** [`PDOCGGetCurrentState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGGetCurrentState), [`PDOCGGetInitialState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGGetInitialState), [`PDOCGGetUsageEntry`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGGetUsageEntry), [`PDOCContextGetOCGStates`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextGetOCGStates), [`PDOCContextSetOCGStates`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextSetOCGStates), [`PDOCGSetCurrentState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGSetCurrentState), [`PDOCGSetInitialState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGSetInitialState) #### PDOCGSetCurrentState ```cpp void PDOCGSetCurrentState(PDOCG pdocg, PDOCContext ocContext, ASBool newState) ``` Header: `PDProcs.h:9111` Sets the current `ON-OFF` state of the optional-content group (OCG) object in a given context. **Parameters** - `pdocg` ([`PDOCG`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG)): The optional-content group object. - `ocContext` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The context for which to set the group's state. - `newState` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): The new state. **Returns:** `void` **See also:** [`PDOCContextGetOCGStates`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextGetOCGStates), [`PDOCContextSetOCGStates`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextSetOCGStates), [`PDOCGGetCurrentState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGGetCurrentState), [`PDOCGGetInitialState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGGetInitialState), [`PDDocGetOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetOCContext), [`PDOCGRemoveInitialState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGRemoveInitialState), [`PDOCGSetInitialState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGSetInitialState) #### PDOCGSetInitialState ```cpp void PDOCGSetInitialState(PDOCG pdocg, PDOCConfig pdOCCfg, ASBool onOff) ``` Header: `PDProcs.h:8904` Sets the initial state (`ON` or `OFF`) of the optional-content group (OCG) object in a given configuration. **Parameters** - `pdocg` ([`PDOCG`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG)): The optional-content group object. - `pdOCCfg` ([`PDOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfig)): The configuration for which to set the group's initial state. - `onOff` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): The new initial state, `true` if the state is `ON`, `false` if it is `OFF`. **Returns:** `void` **See also:** [`PDOCContextGetOCGStates`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextGetOCGStates), [`PDOCContextSetOCGStates`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextSetOCGStates), [`PDOCGGetCurrentState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGGetCurrentState), [`PDOCGGetInitialState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGGetInitialState), [`PDOCGRemoveInitialState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGRemoveInitialState), [`PDOCGSetCurrentState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGSetCurrentState) #### PDOCGSetIntent ```cpp void PDOCGSetIntent(PDOCG pdocg, ASAtom *intent) ``` Header: `PDProcs.h:9052` Sets the Intent entry in an optional-content group's Cos dictionary. An intent is an ASAtom value broadly describing the intended use, which can be either `View` or `Design`. A group's content is considered to be optional (that is, the group's state is considered in its visibility) if any intent in its list matches an intent of the context. The intent list of the context is usually set from the intent list of the document configuration. **Parameters** - `pdocg` ([`PDOCG`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG)): The optional-content group object for which the intent is desired. - `intent` ([`ASAtom *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The new Intent entry value, an array of atoms terminated with ASAtomNull. **Returns:** `void` **See also:** [`PDOCGGetIntent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGGetIntent), [`PDOCContextSetIntent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextSetIntent), [`PDOCConfigSetIntent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfigSetIntent), [`PDOCGUsedInOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGUsedInOCConfig), [`PDOCGUsedInOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGUsedInOCContext) #### PDOCGSetLocked ```cpp void PDOCGSetLocked(PDOCG ocg, PDOCConfig pdOCCfg, ASBool locked) ``` Header: `PDProcs.h:11165` Sets the locked state of an OCG in a given configuration. The on/off state of a locked OCG cannot be toggled by the user through the user interface. **Parameters** - `ocg` ([`PDOCG`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG)): IN The PDOCG whose locked state is to be set. - `pdOCCfg` ([`PDOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfig)): IN/OUT The optional-content configuration. - `locked` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): IN An ASBool that is `true` if the OCG should be locked, and `false` if it should be unlocked. **Returns:** `void` **See also:** [`PDOCGGetLocked`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGGetLocked), [`PDOCConfigGetLockedArray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfigGetLockedArray), [`PDOCConfigSetLockedArray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfigSetLockedArray) #### PDOCGSetName ```cpp void PDOCGSetName(PDOCG pdocg, ASConstText name) ``` Header: `PDProcs.h:8874` Sets the name of an optional-content group. **Parameters** - `pdocg` ([`PDOCG`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG)): The optional-content group object. - `name` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): The new name string. **Returns:** `void` **See also:** [`PDOCGGetName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGGetName) #### PDOCGSetUsageDictEntry ```cpp void PDOCGSetUsageDictEntry(PDOCG pdocg, ASAtom usagekey, CosObj usageinfo) ``` Header: `PDProcs.h:8986` Sets a Usage dictionary entry in an optional-content group (OCG) object. The entry associates usage information with an entry key for retrieval. If a dictionary does not exist, the method creates one. A Usage dictionary entry provides more specific intended usage information than an intent entry. The possible key values are: • `CreatorInfo` • `Language` • `Export` • `Zoom` • `Print` • `View` • `User` • `PageElement` The usage value can act as a kind of metadata, describing the sort of things that belong to the group, such as text in French, fine detail on a map, or a watermark. The usage values can also be used by the `AutoState` mechanism to make decisions about what groups should be on and what groups should be off. The `AutoState` mechanism considers the usage information in the OCGs, the AS array of the configuration, and external factors; for example, the language the application is running in, the current zoom level on the page, or if the page is being printed. **Parameters** - `pdocg` ([`PDOCG`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG)): The optional-content group object. - `usagekey` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The usage entry key. - `usageinfo` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The usage information to associate with the key. **Returns:** `void` **See also:** [`PDOCGGetUsageEntry`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGGetUsageEntry), [`PDOCGHasUsageInfo`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGHasUsageInfo) #### PDOCGSetUserOverride ```cpp void PDOCGSetUserOverride(PDOCG ocg, PDOCContext ctx, ASBool overridden) ``` Header: `PDProcs.h:10402` Marks the optional-content group as having had its state set directly by client code in the specified context (as opposed to automatically by the optional-content AutoState mechanism). When a group is so marked, automatic state changes caused by the `View` event are prevented. When a group's automatic state change is caused by the `Export` or `Print` event, the user-override setting for the group is ignored. A configuration's AS array defines how usage entries are used to automatically manipulate the OCG states. It associates an event (`View`, `Print`, or `Export`) with a list of OCGs and a category, or list of usage keys identifying OCG usage dictionary entries. @since **Parameters** - `ocg` ([`PDOCG`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG)): The optional-content group object. - `ctx` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The context for which the group is marked. - `overridden` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): `true` to mark the group as having had its state set manually, `false` to clear the mark. **Returns:** `void` **See also:** [`PDOCGGetUserOverride`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGGetUserOverride), [`PDOCContextClearAllUserOverrides`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextClearAllUserOverrides), [`PDOCContextFindAutoStateChanges`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextFindAutoStateChanges), [`PDOCContextApplyAutoStateChanges`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextApplyAutoStateChanges), [`PDOCContextMakeCopyWithAutoStateChanges`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextMakeCopyWithAutoStateChanges) #### PDOCGUsedInOCConfig ```cpp ASBool PDOCGUsedInOCConfig(PDOCG pdocg, PDOCConfig pdoccfg) ``` Header: `PDProcs.h:9157` Tests whether an optional-content group (OCG) object is used in a context initialized using the given configuration. A group's content is considered to be optional (that is, the group's state is considered in its visibility) if any intent in its list matches an intent of the context. The intent list of the context is usually set from the intent list of the document configuration. **Parameters** - `pdocg` ([`PDOCG`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG)): The optional-content group object. - `pdoccfg` ([`PDOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfig)): The optional-content configuration. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the group is taken into consideration when determining the visibility of content, `false` otherwise. **See also:** [`PDOCConfigGetIntent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfigGetIntent), [`PDOCContextGetIntent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextGetIntent), [`PDOCGGetIntent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGGetIntent), [`PDOCGUsedInOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGUsedInOCContext) #### PDOCGUsedInOCContext ```cpp ASBool PDOCGUsedInOCContext(PDOCG pdocg, PDOCContext pdocctx) ``` Header: `PDProcs.h:9134` Tests whether an optional-content group (OCG) object is used in a given context. A group's content is considered to be optional (that is, the group's state is considered in its visibility) if any intent in its list matches an intent of the context. The intent list of the context is usually set from the intent list of the document configuration. **Parameters** - `pdocg` ([`PDOCG`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG)): The optional-content group object. - `pdocctx` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The optional-content context. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the group is taken into consideration when determining the visibility of content, `false` otherwise. **See also:** [`PDOCConfigGetIntent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCConfigGetIntent), [`PDOCContextGetIntent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContextGetIntent), [`PDOCGGetIntent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGGetIntent), [`PDOCGUsedInOCConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGUsedInOCConfig) ### Typedefs (1) #### PDOCGEnumProc ```cpp typedef ASBool(*) PDOCGEnumProc(PDOCG ocg, void *clientData)(PDOCG ocg, void *clientData) ``` Header: `PDExpT.h:5845` A callback used for enumerating optional-content groups (OCGs). Enumeration stops when all OCGs have been enumerated, or when the callback returns `false`. **See also:** [`PDDocEnumOCGs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocEnumOCGs), [`PDPageEnumOCGs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageEnumOCGs) ### Structures (1) #### PDOCG ```cpp typedef struct _t_PDOCG* PDOCG ``` Header: `PDExpT.h:5654` A PDOCG represents a named object whose state can be toggled in a user interface to affect changes in visibility of content. ## PDOCMD ### Functions (12) #### PDOCMDCreate ```cpp PDOCMD PDOCMDCreate(PDDoc pdDoc, PDOCG *ocgs, PDOCMDVisPolicy policy) ``` Header: `PDProcs.h:9230` Creates a new optional-content membership dictionary (OCMD) object in the given document for the given groups and visibility policy. To add a group to an existing OCMD, get the current OCG list, modify it, then create a new OCMD with the new list of groups. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document in which the dictionary is used. - `ocgs` ([`PDOCG *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG)): A `NULL`-terminated array of optional-content groups (OCGs) to be members of the dictionary. - `policy` ([`PDOCMDVisPolicy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMDVisPolicy)): The visibility policy that determines the visibility of content with respect to the `ON-OFF` state of OCGs listed in the dictionary. **Returns:** [`PDOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMD) The newly created dictionary object, or `NULL` if no groups are supplied. **See also:** [`PDOCMDFindOrCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMDFindOrCreate), [`PDOCMDGetFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMDGetFromCosObj) #### PDOCMDFindOrCreate ```cpp PDOCMD PDOCMDFindOrCreate(PDDoc pdDoc, PDOCG *ocgs, PDOCMDVisPolicy policy) ``` Header: `PDProcs.h:9264` Locates an existing optional-content membership dictionary (OCMD) object that references the given groups, and that uses the same visibility policy. If no such dictionary is found, the method creates one. If only one group is supplied, the policy is kOCMDVisibility_AnyOn or kOCMDVisibility_AllOn, and no matching dictionary is found, the method creates an OCMD that directly contains the group without the level of indirection normally introduced by an OCMD. If the indirection is needed to add more groups to the OCMD, use PDOCMDCreate(). To add a group to an existing OCMD, get the current OCG list, modify it, then create a new OCMD with the new list of groups. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document in which the dictionary is used. - `ocgs` ([`PDOCG *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG)): A `NULL`-terminated array of optional-content groups (OCGs) to be members of the dictionary. - `policy` ([`PDOCMDVisPolicy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMDVisPolicy)): The visibility policy that determines the visibility of content with respect to the `ON-OFF` state of OCGs listed in the dictionary. **Returns:** [`PDOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMD) The newly created or existing dictionary object, or `NULL` if no groups are supplied. **See also:** [`PDOCMDCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMDCreate), [`PDOCMDGetFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMDGetFromCosObj), [`PDAnnotGetOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotGetOCMD), [`PDEElementGetOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetOCMD) #### PDOCMDFindOrCreateEx ```cpp PDOCMD PDOCMDFindOrCreateEx(PDDoc pdDoc, PDOCG *ocgs, PDOCMDVisPolicy policy, CosObj veObj) ``` Header: `PDProcs.h:11215` Locates an existing optional-content membership dictionary (PDOCMD) object that references the given groups, uses the same visibility policy, and uses the same visibility expression. If no such PDOCMD is found, the method creates one. The fourth parameter, `veObj` must be a CosNull object or a CosArray object. If it is a CosNull object, this call is identical to PDOCMDFindOrCreate(). If it is an array object, it is used as the OCMD's visibility expression. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The PDDoc in which to create the PDOCMD. - `ocgs` ([`PDOCG *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG)): A list of OCGs, or `NULL` if only a visibility expression is to be used. - `policy` ([`PDOCMDVisPolicy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMDVisPolicy)): The visibility policy to use. unused if `ocgs` is `NULL`. - `veObj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): A CosObj containing a visibility expression. **Returns:** [`PDOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMD) **See also:** [`PDOCMDFindOrCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMDFindOrCreate) #### PDOCMDGetCosObj ```cpp CosObj PDOCMDGetCosObj(PDOCMD pdocmd) ``` Header: `PDProcs.h:9274` Gets the Cos object associated with the optional-content membership dictionary (OCMD) object. **Parameters** - `pdocmd` ([`PDOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMD)): The dictionary object. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) The Cos object. **See also:** [`PDOCMDGetFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMDGetFromCosObj) #### PDOCMDGetFromCosObj ```cpp PDOCMD PDOCMDGetFromCosObj(CosObj obj) ``` Header: `PDProcs.h:9297` Gets an optional-content membership dictionary (OCMD) object from the associated Cos object. **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The Cos object. **Returns:** [`PDOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMD) The dictionary object. **See also:** [`PDOCMDCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMDCreate), [`PDOCMDGetCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMDGetCosObj) #### PDOCMDGetOCGs ```cpp PDOCG * PDOCMDGetOCGs(PDOCMD pdocmd) ``` Header: `PDProcs.h:9309` Gets the optional-content groups listed in a membership dictionary. **Parameters** - `pdocmd` ([`PDOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMD)): The membership dictionary whose OCGs are obtained. **Returns:** [`PDOCG *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG) A `NULL`-terminated array of the document's optional-content groups. The client is responsible for freeing the array using ASfree(). #### PDOCMDGetPDDoc ```cpp PDDoc PDOCMDGetPDDoc(PDOCMD pdocmd) ``` Header: `PDProcs.h:9286` Gets the document that contains an optional-content membership dictionary. **Parameters** - `pdocmd` ([`PDOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMD)): The dictionary for which the document is desired. **Returns:** [`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc) The document object. **See also:** [`PDDocGetOCGs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetOCGs), [`PDOCGGetPDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGGetPDDoc) #### PDOCMDGetVisPolicy ```cpp PDOCMDVisPolicy PDOCMDGetVisPolicy(PDOCMD pdocmd) ``` Header: `PDProcs.h:9322` Gets the optional-content membership dictionary's visibility policy, which determines the visibility of content with respect to the `ON-OFF` state of OCGs listed in the dictionary. **Parameters** - `pdocmd` ([`PDOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMD)): The dictionary whose policy is obtained. **Returns:** [`PDOCMDVisPolicy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMDVisPolicy) The visibility policy. **See also:** [`PDOCMDIsCurrentlyVisible`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMDIsCurrentlyVisible), [`PDOCMDsAreCurrentlyVisible`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMDsAreCurrentlyVisible) #### PDOCMDGetVisibilityExpression ```cpp ASBool PDOCMDGetVisibilityExpression(PDOCMD ocmd, CosObj *veObj) ``` Header: `PDProcs.h:11229` If the PDOCMD has a visibility expression entry, the function returns `true`, and if `veObj` is non-`NULL`, `*veObj` is set to the CosObj for the visibility expression. If the PDOCMD does not have a visibility expression entry, the function returns `false`. **Parameters** - `ocmd` ([`PDOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMD)): The PDOCMD in which to check for a visibility expression. - `veObj` ([`CosObj *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The cos object in which to return the visibility expression. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if there is a visibility expression, `false` otherwise. **See also:** [`PDOCMDFindOrCreateEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMDFindOrCreateEx) #### PDOCMDIsCurrentlyVisible ```cpp ASBool PDOCMDIsCurrentlyVisible(PDOCMD pdocmd, PDOCContext ocContext) ``` Header: `PDProcs.h:9382` Based on the optional-content groups listed in the dictionary, the current `ON-OFF` state of those groups within the specified context, and the dictionary's visibility policy, test whether the content tagged with this dictionary would be visible. It ignores the context's current PDOCDrawEnumType and NonOCDrawing settings. **Parameters** - `pdocmd` ([`PDOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMD)): The dictionary. - `ocContext` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The context in which the visibility of content is tested. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if content tagged with this dictionary is visible in the given context, `false` if it is hidden. **See also:** [`PDOCMDGetVisPolicy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMDGetVisPolicy), [`PDOCMDsAreCurrentlyVisible`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMDsAreCurrentlyVisible) #### PDOCMDsAreCurrentlyVisible ```cpp ASBool PDOCMDsAreCurrentlyVisible(PDOCMD *pdocmds, PDOCContext ocContext) ``` Header: `PDProcs.h:9401` Tests a set of optional-content membership dictionaries to determine whether contents tagged with any of them is visible in a given optional-content context. The method calls PDOCMDIsCurrentlyVisible() on each of the dictionaries. If content is visible in the given context in any of the dictionaries, this method returns `true`. **Parameters** - `pdocmds` ([`PDOCMD *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMD)): A `NULL`-terminated array of dictionaries to test. - `ocContext` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The context in which visibility is tested. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if content using any of the dictionaries is visible in the given context, `false` if it is hidden for all of the dictionaries. **See also:** [`PDOCMDGetVisPolicy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMDGetVisPolicy), [`PDOCMDIsCurrentlyVisible`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMDIsCurrentlyVisible) #### PDOCMDsMakeContentVisible ```cpp ASBool PDOCMDsMakeContentVisible(PDOCMD *ocmds, PDOCContext ocContext) ``` Header: `PDProcs.h:9449` Makes content that uses any of a set of optional-content membership dictionaries visible in a given optional-content context. The method manipulates the states of optional-content groups in the dictionaries so that any content controlled by any of the dictionaries will be visible in the given context. There can be more than one combination of states that satisfies the request. The particular combination of states is not guaranteed from one call to the next. The method returns `false` if it is not possible to make the content visible (for example, if there are nested dictionaries where one specifies `"show if the group state is ON"` and the other specifies `"show if the group state is OFF"`). In such a case, visibility is always off, so no state setting can make the content visible. This method ignores the context's draw type. **Parameters** - `ocmds` ([`PDOCMD *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMD)): A `NULL`-terminated array of dictionaries to act upon. - `ocContext` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The context in which the contents are made visible. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if successful or if the OCMD list is empty, `false` otherwise. **See also:** [`PDOCMDGetVisPolicy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMDGetVisPolicy), [`PDOCMDIsCurrentlyVisible`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMDIsCurrentlyVisible) ### Typedefs (1) #### PDOCMDVisPolicy ```cpp typedef ASUns8 PDOCMDVisPolicy ``` Header: `PDExpT.h:5697` ### Structures (1) #### PDOCMD ```cpp typedef struct _t_PDOCMD* PDOCMD ``` Header: `PDExpT.h:5659` A PDOCMD is an object that is attached to content to indicate membership in an OCG or group of OCGs. ### Enums (1) #### PDOCMDVisPolicies Header: `PDExpT.h:5687` PDOCMDVisPolicy represents the four legal values for the /P key in an Optional Content Membership Dictionary (OCMD) dictionary. They specify the visibility of content with respect to the on/off state of the Optional Content Groups (OCGs) listed in the OCMD. **Values** - `kOCMDVisibility_AllOn = 0` - `kOCMDVisibility_AnyOn = 1` - `kOCMDVisibility_AnyOff = 2` - `kOCMDVisibility_AllOff = 3` ## PDPage ### Functions (72) #### PDPageAcquirePDEContent ```cpp PDEContent PDPageAcquirePDEContent(IN PDPage pdPage, IN ASExtension self) ``` Header: `PgCntProcs.h:50` Creates a PDEContent from the PDPage object's contents and resources. The PDEContent is cached, so that subsequent calls on the same PDPage return the same PDEContent, even if the request is from another PDFEdit client. The PDEContent remains in the cache as long as someone has it acquired - until someone not using the PDFEdit API changes the PDPage object's contents, such as the viewer rotating a page 90 degrees. Requires ‘Export’ permission on PDDoc. Do not call PDERelease() on PDEContent you have acquired with PDPageAcquirePDEContent(); call PDPageReleasePDEContent() to release it. **Parameters** - `pdPage` (`IN PDPage`): The page whose content object is acquired. - `self` (`IN ASExtension`): Identifies the caller or client. For plug-ins, this should be the gExtensionID extension. For the Adobe PDF Library, if there is only one client of the PDFEdit subsystem, this should be zero. If there are multiple clients, each should specify a nonzero, non-negative value. (A negative value is reserved for the implementation.) **Returns:** [`PDEContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContent) A PDEContent representing the page's contents. **See also:** [`PDEContentCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentCreateFromCosObj), [`PDPageReleasePDEContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageReleasePDEContent), [`PDPageSetPDEContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageSetPDEContent) #### PDPageAcquirePage ```cpp void PDPageAcquirePage(PDPage pdPage) ``` Header: `PDProcs.h:11135` 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. **Parameters** - `pdPage` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): IN The page whose reference count is to be incremented. **Returns:** `void` **See also:** `CSmartPDPage`, [`PDPageRelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageRelease) **Since:** `0 .` #### PDPageAddAnnot ```cpp void PDPageAddAnnot(PDPage aPage, ASInt32 addAfter, PDAnnot annot) ``` Header: `PDProcs.h:3412` Adds an annotation at the specified location in a page's annotation array. You can find this document on the web store of the International Standards Organization (ISO). The first annotation in the array has an index of zero. Passing a value of `-2` adds the annotation to the end of the array. Passing other negative values produces undefined results. **Parameters** - `aPage` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page to which the annotation is added. - `addAfter` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The index into the page's annotation array where the annotation is added. See the description of Annotations in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 12.5, page 381. - `annot` ([`PDAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnot)): The annotation to add. **Returns:** `void` **Exceptions** - `pdErrOpNotPermitted`: is raised if: • The annotation is of subtype Text and the document's permissions do not include pdPermEditNotes (see PDPerms). • The annotation is of any other subtype and the document's permissions do not include pdPermEdit. @notify PDPageWillAddAnnot @notify PDPageDidAddAnnot **See also:** [`PDPageCreateAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageCreateAnnot), [`PDPageAddNewAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageAddNewAnnot), [`PDPageRemoveAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageRemoveAnnot) #### PDPageAddCosContents ```cpp void PDPageAddCosContents(PDPage page, CosObj newContents) ``` Header: `PDProcs.h:3541` Completely replaces the contents of the specified page with `newContents`. **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): IN/OUT The page whose Cos contents are replaced. - `newContents` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): IN/OUT A stream Cos object or an array Cos object containing the new contents (stream Cos objects) for `page`. @notify PDDocDidChangePages **Returns:** `void` **See also:** [`PDPageRemoveCosContents`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageRemoveCosContents) #### PDPageAddCosResource ```cpp void PDPageAddCosResource(PDPage page, const char *resType, const char *resName, CosObj resObj) ``` Header: `PDProcs.h:3527` Adds a Cos resource to a page object. See the description of Resource Dictionaries in ISO 32000-1:2008, Document Management- Portable Document Format-Part 1: PDF 1.7, section 7.8.3, page 82. You can find this document on the web store of the International Standards Organization (ISO). The necessary dictionaries are created automatically if the page does not already have any resources of the type specified by `resType`, or does not have a Resources dictionary. For example, if you specify a font resource, but the page does not already have a font resource dictionary, this method automatically creates one and puts the font you specify into it. ProcSet resources cannot be added using this method; they must be added using Cos-level methods to: • Get the page's Resources dictionary. • Get the ProcSet array from the Resources dictionary. • Add an element to the ProcSet array. **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page to which a resource is added. - `resType` (`const char *`): The resource type. The named resource types in PDF are: ExtGState, ColorSpace, Pattern, Shading, XObject, Font, and Properties. Although ProcSet is also a valid resource type, it cannot be added by this method. - `resName` (`const char *`): The resource name (for example, the name of a font might be `F1`). - `resObj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The Cos object being added as a resource to page. @notify PDDocDidChangePages **Returns:** `void` **See also:** [`PDPageRemoveCosResource`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageRemoveCosResource), [`PDPageGetCosResources`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetCosResources) #### PDPageAddNewAnnot ```cpp PDAnnot PDPageAddNewAnnot(PDPage aPage, ASInt32 addAfter, ASAtom subType, const ASFixedRect *initialRect) ``` Header: `PDProcs.h:3381` Adds an annotation to the page. To make the annotation visible after adding it, convert the coordinates of `initialRect` to device coordinates using AVPageViewRectToDevice(), then call AVPageViewInvalidateRect() using the converted rectangle. This method is equivalent to calling PDPageCreateAnnot() followed by PDPageAddAnnot(). The PDPageWillAddAnnot() and PDPageDidAddAnnot() notifications are broadcast before the PDPageAddNewAnnot() method returns. If you want to finish formatting the annotation before these notifications are called, for example, by adding additional key-value pairs to the annotation dictionary, you should call PDPageCreateAnnot() followed by PDPageAddAnnot() instead of PDPageAddNewAnnot(). You can find this document on the web store of the International Standards Organization (ISO). Passing a value of `-2` adds the annotation to the end of the array (this is generally what you should do unless you have a need to place the annotation at a special location in the array). Passing a value of `-1` adds the annotation to the beginning of the array. Passing other negative values produces undefined results. • The annotation is of subtype Text and the document's permissions do not include pdPermEditNotes (see PDPerms). • The annotation is of any other subtype and the document's permissions do not include pdPermEdit. @notify PDPageWillAddAnnot @notify PDPageDidAddAnnot **Parameters** - `aPage` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page to which the annotation is added. - `addAfter` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): Where to add the annotation in the page's annotation array. See the description of Annotations in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 12.5, page 381. - `subType` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The subtype of the annotation to add. - `initialRect` (`const ASFixedRect *`): A pointer to a rectangle specifying the annotation's bounds, specified in user space coordinates. **Returns:** [`PDAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnot) The newly created annotation. **Exceptions** - `pdErrOpNotPermitted`: is raised if: **See also:** [`PDPageCreateAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageCreateAnnot), [`PDPageAddAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageAddAnnot), [`PDPageRemoveAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageRemoveAnnot) #### PDPageCreateAnnot ```cpp PDAnnot PDPageCreateAnnot(PDPage aPage, ASAtom subType, const ASFixedRect *initialLocation) ``` Header: `PDProcs.h:312` Creates a new annotation, associated with the specified page's CosDoc, but not added to the page. Use PDPageAddAnnot() to add the annotation to the page. If you want to create an annotation that prints even if the annotation handler is not present, you must provide an appearance for it. To do this, add an appearance key (AP) to the annotation dictionary, in which you place the Forms XObject for the Normal (N), Rollover (R), and Down (D) appearances; only the Normal appearance is required. Also, add a flags field (F) to the annotation dictionary and set the appropriate value for the bit field. A value of `4`, which displays the annotation if the handler is not present, shows the annotation, and allows printing it, is recommended. @notify PDAnnotWasCreated **Parameters** - `aPage` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page to whose PDDoc the annotation is added. - `subType` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The subtype of annotation to create. - `initialLocation` (`const ASFixedRect *`): A pointer to a rectangle specifying the annotation's bounds, specified in user space coordinates. **Returns:** [`PDAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnot) The newly created annotation. **Exceptions** - `pdErrOpNotPermitted`: is raised if: • The annotation is of subtype Text and the document's permissions do not include pdPermEditNotes (see PDPerms), or • The annotation is of any other subtype and the document's permissions do not include pdPermEdit. **See also:** [`PDPageAddAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageAddAnnot), [`PDPageAddNewAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageAddNewAnnot) #### PDPageDrawContentsToWindow ```cpp void PDPageDrawContentsToWindow(PDPage page, void *window, void *displayContext, ASBool isDPS, ASFixedMatrix *matrix, ASFixedRect *updateRect, CancelProc cancelProc, void *cancelProcClientData) ``` Header: `PDProcs.h:3314` Draws the contents of a page into the specified window. This method just draws a bitmap to the window. If you want a live document, you need to open an AVDoc for the PDF file. The page can also be derived from a PDDoc. On UNIX, this method cannot be used to draw into a window. UNIX developers should instead use AVDocOpenFromASFileWithParamString() to draw PDF files into their own window from a client. **Note:** This method cannot be reliably used to print to a device. **Note:** Platform: ((!MAC_PLATFORM || (MAC_PLATFORM && !AS_ARCH_64BIT))) && ((!MAC_PLATFORM)) **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page to draw into `window`. - `window` (`void *`): A pointer to a platform-dependent window object (`HWND` on Windows, or `WindowPtr`). On Windows, to draw into an offscreen `DC`, pass `NULL` for `window`. - `displayContext` (`void *`): A platform-dependent display context structure (`HDC` on Windows). Note that `displayContext` cannot be reliably used as the `hDC` for a printer device. - `isDPS` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): Currently unused. Always set it to `false`. - `matrix` (`ASFixedMatrix *`): A pointer to the matrix to concatenate onto the default page matrix. It is useful for converting from page to window coordinates and for scaling. - `updateRect` (`ASFixedRect *`): A pointer to the rectangle to draw, defined in user space coordinates. Any objects outside of `updateRect` will not be drawn. All objects are drawn if `updateRect` is `NULL`. - `cancelProc` ([`CancelProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#CancelProc)): The procedure called periodically to check for the user's cancelling of the drawing operation. The default cancel proc can be obtained using AVAppGetCancelProc(). It may be `NULL`, in which case no cancel proc is used. - `cancelProcClientData` (`void *`): A pointer to user-supplied data to pass to `cancelProc` each time it is called. It should be `NULL` if `cancelProc` is `NULL`. **Returns:** `void` **See also:** `AVAppGetCancelProc`, [`PDDrawCosObjToWindow`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDrawCosObjToWindow), [`PDPageDrawContentsToWindowEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageDrawContentsToWindowEx) #### PDPageDrawContentsToWindowEx ```cpp void PDPageDrawContentsToWindowEx(PDPage page, void *window, void *displayContext, ASBool isDPS, ASFixedMatrix *matrix, ASUns32 flags, ASFixedRect *updateRect, CancelProc cancelProc, void *cancelProcClientData) ``` Header: `PDProcs.h:8045` Provides control over the rendering of annotations on the page to be drawn into `window`. It provides the ability to specify the flags passed in to the PDPageDrawContentsToWindows() function. **Note:** This function can only be called with a flags value of `0`. The function is not supported with any other values for `flags`. `flags = 0` means do not render the annotation faces. If you want to draw to a window with annotations, you should call the original PDPageDrawContentsToWindow(). In general, Adobe recommends that you not use PDPageDrawContentsToWindowsEx() unless you have a specific need to prevent the drawing of annotations. **Note:** Platform: ((!MAC_PLATFORM || (MAC_PLATFORM && !AS_ARCH_64BIT))) && ((!MAC_PLATFORM)) **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page to draw into `window`. - `window` (`void *`): A pointer to a platform-dependent window object (`HWND` on Windows, or `WindowPtr`). On Windows, to draw into an offscreen `DC`, pass `NULL` for `window`. - `displayContext` (`void *`): A platform-dependent display context structure (`HDC` on Windows). Note that `displayContext` cannot be reliably used as the `hDC` for a printer device. - `isDPS` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): Currently unused. Always set it to `false`. - `matrix` (`ASFixedMatrix *`): A pointer to the matrix to concatenate onto the default page matrix. It is useful for converting from page to window coordinates and for scaling. - `flags` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): See PDPageDrawFlagsPI for possible values. - `updateRect` (`ASFixedRect *`): A rectangle represented by the coordinates of its four sides. - `cancelProc` ([`CancelProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#CancelProc)): A procedure called periodically to check for the user's cancelling of the drawing operation. The default cancel procedure can be obtained using AVAppGetCancelProc(). It may be `NULL` in which case no cancel procedure is used. - `cancelProcClientData` (`void *`): A pointer to user-supplied data to pass to `cancelProc` each time it is called. It should be `NULL` if `cancelProc` is `NULL`. **Returns:** `void` **Exceptions** - `pdPErrUnableToCreateRasterPort` **See also:** `AVAppGetCancelProc`, [`PDDrawCosObjToWindow`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDrawCosObjToWindow), [`PDPageDrawContentsToWindow`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageDrawContentsToWindow) #### PDPageDrawContentsToWindowEx2 ```cpp void PDPageDrawContentsToWindowEx2(PDPage page, void *window, void *displayContext, ASBool isDPS, ASDoubleMatrix *matrix, ASCab flags, ASDoubleRect *updateRect, ASCancelProc cancelProc, void *cancelProcClientData) ``` Header: `PDProcs.h:12780` Draws the contents of a page into the specified window. This method just draws a bitmap to the window. If you want a live document, you need to open an AVDoc for the PDF file. The page can also be derived from a PDDoc. On UNIX, this method cannot be used to draw into a window. UNIX developers should instead use AVDocOpenFromASFileWithParamString() to draw PDF files into their own window from a client. **Note:** This method cannot be reliably used to print to a device. **Note:** Platform: ((!MAC_PLATFORM || (MAC_PLATFORM && !AS_ARCH_64BIT))) && ((!MAC_PLATFORM)) **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page to draw into `window`. - `window` (`void *`): A pointer to a platform-dependent window object (`HWND` on Windows, or `WindowPtr`). On Windows, to draw into an offscreen `DC`, pass `NULL` for `window`. - `displayContext` (`void *`): A platform-dependent display context structure (`HDC` on Windows). Note that `displayContext` cannot be reliably used as the `hDC` for a printer device. - `isDPS` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): Currently unused. Always set it to `false`. - `matrix` (`ASDoubleMatrix *`): A pointer to the matrix to concatenate onto the default page matrix. It is useful for converting from page to window coordinates and for scaling. - `flags` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)): See PDPageDrawFlagsPI for possible values. - `updateRect` (`ASDoubleRect *`): A pointer to the rectangle to draw, defined in user space coordinates. Any objects outside of `updateRect` will not be drawn. All objects are drawn if `updateRect` is `NULL`. - `cancelProc` ([`ASCancelProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCancelProc)): The procedure called periodically to check for the user's cancelling of the drawing operation. The default cancel proc can be obtained using AVAppGetCancelProc(). It may be `NULL`, in which case no cancel proc is used. - `cancelProcClientData` (`void *`): A pointer to user-supplied data to pass to `cancelProc` each time it is called. It should be `NULL` if `cancelProc` is `NULL`. **Returns:** `void` **See also:** `AVAppGetCancelProc`, [`PDDrawCosObjToWindow`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDrawCosObjToWindow), [`PDPageDrawContentsToWindowEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageDrawContentsToWindowEx) #### PDPageDrawContentsWithParams ```cpp void PDPageDrawContentsWithParams(PDPage page, PDDrawParams params) ``` Header: `PDProcs.h:10514` Provides control over the rendering of contents on the page, including both those parameters you would pass to PDPageDrawContentsToWindowEx(), and an optional-content context that determines which contents are visible. **Note:** Platform: ((!MAC_PLATFORM || (MAC_PLATFORM && !AS_ARCH_64BIT))) && ((!MAC_PLATFORM)) **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page to draw. - `params` (`PDDrawParams`): The parameters with which to draw the page, including the optional-content context to use for content visibility. **Returns:** `void` **Exceptions** - `pdPErrUnableToCreateRasterPort` **See also:** [`PDPageDrawContentsToWindow`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageDrawContentsToWindow), [`PDPageDrawContentsToWindowEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageDrawContentsToWindowEx) #### PDPageEnumContents ```cpp void PDPageEnumContents(PDPage page, PDGraphicEnumMonitor mon, void *clientData) ``` Header: `PDProcs.h:3619` Enumerates the contents of a page, calling a procedure for each drawing object in the page description. **Note:** This method is provided only for backwards compatibility. It has not been updated beyond PDF Version 1.1 and may not work correctly for newly created PDF 1.2 or later files. You should use the PDFEdit API to enumerate page contents. **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): IN/OUT The page whose contents are enumerated. - `mon` ([`PDGraphicEnumMonitor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDGraphicEnumMonitor)): IN/OUT A pointer to a structure containing user-supplied callbacks that are called for each drawing operator on a page. Enumeration ends if any procedure returns `false`. - `clientData` (`void *`): IN/OUT A pointer to user-supplied data to pass to `mon` each time it is called. **Returns:** `void` #### PDPageEnumInks ```cpp void PDPageEnumInks(PDPage pdPage, PDPageEnumInksCallback proc, void *clientData, ASBool includeOPI) ``` Header: `PDProcs.h:8322` Enumerates the inks for a page, calling the supplied procedure for each PDPageInk structure. For the DeviceCMYK_K process color model, it always finds the four inks Cyan, Magenta, Yellow, and Black, which are marked as process inks. The RGB values in the PDPageInk structure are the RGB equivalents (in system monitor space) of 100% of the ink, which can be used to show color swatches for a given ink. If the inks are part of a DeviceN colorspace which has not been defined in a Colorants dictionary or elsewhere in a Separation colorspace, the color of the swatch is undefined. This call finds all color spaces that are in a color space dictionary within the page, even if they are not used by the page contents. **Parameters** - `pdPage` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page whose contents are enumerated. - `proc` ([`PDPageEnumInksCallback`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageEnumInksCallback)): The user-supplied callback procedure to be applied to each ink. Enumeration ends if any procedure returns `false`. - `clientData` (`void *`): A pointer to user-supplied data to pass to `proc` each time it is called. - `includeOPI` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): If `true`, enumerate inks contained in OPI dictionaries. **Returns:** `void` **See also:** [`PDPageMakeSeparations`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageMakeSeparations), `AVPageViewGetNumVisibleInks`, `AVPageViewGetVisibleInks`, `AVPageViewGetPixelInformationAtPoint`, `AVPageViewSetInkPreview`, `AVPageViewSetVisibleInks` #### PDPageEnumInksEx ```cpp void PDPageEnumInksEx(PDPage pdPage, PDPageEnumInksCallback proc, void *clientData, ASBool includeOPI, ASAtom colorModel) ``` Header: `PDProcs.h:11305` Enumerates the inks for a page, calling the supplied procedure for each PDPageInk structure. This differs from PDPageEnumInks() in that it allows the process color model to be passed in. For the DeviceCMYK_K process color model, it always finds the four inks Cyan, Magenta, Yellow, and Black, which are marked as process inks. The RGB values in the PDPageInk structure are the RGB equivalents (in system monitor space) of 100% of the ink, which can be used to show color swatches for a given ink. If the inks are part of a DeviceN color space which has not been defined in a Colorants dictionary or elsewhere in a Separation color space, the color of the swatch is undefined. This call finds all color spaces that are in a color space dictionary within the page, even if they are not used by the page contents. **Parameters** - `pdPage` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page whose contents are enumerated. - `proc` ([`PDPageEnumInksCallback`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageEnumInksCallback)): The user-supplied callback procedure to be applied to each ink. Enumeration ends if any procedure returns `false`. - `clientData` (`void *`): A pointer to user-supplied data to pass to `proc` each time it is called. - `includeOPI` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): If `true`, enumerate inks contained in OPI dictionaries. - `colorModel` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): `CMYK_K`, `RGB_K`, or `Gray_K`. **Returns:** `void` **See also:** [`PDPageMakeSeparations`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageMakeSeparations), `AVPageViewGetNumVisibleInks`, `AVPageViewGetVisibleInks`, `AVPageViewGetPixelInformationAtPoint`, `AVPageViewSetInkPreview`, `AVPageViewSetVisibleInks` #### PDPageEnumOCGs ```cpp void PDPageEnumOCGs(PDPage pdPage, PDOCGEnumProc enumProc, void *clientData) ``` Header: `PDProcs.h:9174` Enumerates the optional-content groups for the page, 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 the page. **Parameters** - `pdPage` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page whose groups are enumerated. - `enumProc` ([`PDOCGEnumProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCGEnumProc)): A user-supplied callback to call for each group. Enumeration terminates if `proc` returns `false`. - `clientData` (`void *`): A pointer to user-supplied data to pass to `enumProc` each time it is called. **Returns:** `void` **See also:** [`PDDocEnumOCGs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocEnumOCGs), [`PDPageGetOCGs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetOCGs) #### PDPageEnumResources ```cpp void PDPageEnumResources(PDPage page, PDResourceEnumMonitor mon, void *clientData) ``` Header: `PDProcs.h:3599` (Obsolete, provided only for backwards compatibility) Enumerates the page's resources, calling an enumeration procedure for each resource. Instead of this method, use PDDocEnumOCGs(). **Note:** This method is provided only for backwards compatibility. It has not been updated beyond PDF Version 1.1 and may not work correctly for newly created PDF 1.2 or later files. **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page whose Cos resources are enumerated. - `mon` ([`PDResourceEnumMonitor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDResourceEnumMonitor)): A pointer to a structure containing user-supplied callbacks that are called for each of the page's resources. Enumeration ends if any procedure returns `false`. - `clientData` (`void *`): A pointer to user-supplied data to pass to each procedure in `mon` when it is called. **Returns:** `void` **See also:** [`PDDocEnumOCGs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocEnumOCGs), [`PDPageGetCosResources`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetCosResources) #### PDPageFlattenOC ```cpp ASBool PDPageFlattenOC(PDPage pdPage, PDOCContext context) ``` Header: `PDProcs.h:10477` Replaces the page's contents with a version that has no optional content, containing only what was visible on the page when the call was made. **Parameters** - `pdPage` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page to be modified. - `context` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The optional-content context in which content is checked for visibility. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the operation is successful, `false` otherwise. **See also:** [`PDDocFlattenOC`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocFlattenOC), [`PDEContentFlattenOC`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentFlattenOC) #### PDPageGetAnnot ```cpp PDAnnot PDPageGetAnnot(PDPage aPage, ASInt32 annotIndex) ``` Header: `PDProcs.h:3332` Gets the `annotIndex` annotation on the page. **Parameters** - `aPage` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): IN/OUT The page on which the annotation is located. - `annotIndex` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN/OUT The index of the annotation to get on a page. The first annotation on a page has an index of zero. **Returns:** [`PDAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnot) The indexed annotation object. **See also:** [`PDPageGetNumAnnots`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetNumAnnots) #### PDPageGetAnnotIndex ```cpp ASInt32 PDPageGetAnnotIndex(PDPage aPage, PDAnnot anAnnot) ``` Header: `PDProcs.h:3457` Gets the index of a given annotation object on a given page. **Parameters** - `aPage` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): IN/OUT The page to which the annotation is attached. - `anAnnot` ([`PDAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnot)): IN/OUT The annotation whose index is obtained. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The annotation's index. It returns `-1` if the annotation is not on the page. **See also:** [`PDPageGetAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetAnnot), [`PDPageGetAnnotSequence`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetAnnotSequence) #### PDPageGetAnnotSequence ```cpp ASInt32 PDPageGetAnnotSequence(PDPage page, PDAnnot annot) ``` Header: `PDProcs.h:6867` Returns the sequence number of the specified annotation for the given page. It is applicable only to annotations that are listed in Acrobat's Comments pane and therefore cannot be summarized using Summarize command (as would be the case for link and widget annotations, for example). This method is similar to PDPageGetAnnotIndex() but it checks the information flags from the annotation handler's PDAnnotHandlerGetAnnotInfoFlagsProc() to determine whether the PDAnnotOperationSummarize flag is set, meaning that the annotation has a sequence number. **Note:** The sequence number is one-based, while the index returned by PDPageGetAnnotIndex() is zero-based. **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page on which the annotation exists. - `annot` ([`PDAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnot)): The annotation for which the sequence number is desired. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The sequence number of the specified annotation; or `-1` if the annotation is not in the page or if it is an annotation that cannot be summarized. **See also:** [`PDPageGetAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetAnnot), [`PDPageGetAnnotIndex`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetAnnotIndex) #### PDPageGetBBox ```cpp void PDPageGetBBox(PDPage page, ASFixedRect *bboxP) ``` Header: `PDProcs.h:3237` Gets the bounding box for a page. The bounding box is the rectangle that encloses all text, graphics, and images on the page. **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page whose bounding box is obtained. - `bboxP` (`ASFixedRect *`): (Filled by the method) A pointer to a rectangle specifying the page's bounding box, specified in user space coordinates. **Returns:** `void` **See also:** [`PDPageGetMediaBox`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetMediaBox), [`PDPageGetCropBox`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetCropBox), [`PDPageGetVisibleBBox`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetVisibleBBox) #### PDPageGetBox ```cpp ASBool PDPageGetBox(PDPage page, ASAtom boxName, ASFixedRect *box) ``` Header: `PDProcs.h:7879` Returns the box specified for the page object intersected with the media box. If the value for `boxName` is `CropBox`, this call is equivalent to PDPageGetCropBox(); if the value is `MediaBox`, this call is equivalent to PDPageGetMediaBox(). **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page whose box is obtained. - `boxName` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): An ASAtom representing the type of box. It can have values such as `ArtBox`, `BleedBox`, `CropBox`, `TrimBox`, or `MediaBox`. - `box` (`ASFixedRect *`): (Filled by the method) An `ASFixedRect` specifying the page's box. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the requested box was specified for the page, `false` otherwise. **See also:** [`PDPageSetBox`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageSetBox) #### PDPageGetCosObj ```cpp CosObj PDPageGetCosObj(PDPage page) ``` Header: `PDProcs.h:3122` Gets the dictionary Cos object associated with a page. This method does not copy the object, but is instead the logical equivalent of a type cast. **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): IN/OUT The page whose Cos object is obtained. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) The dictionary Cos object associated with page. #### PDPageGetCosResources ```cpp CosObj PDPageGetCosResources(PDPage page) ``` Header: `PDProcs.h:3487` Gets the Cos object corresponding to a page's resource dictionary. A page's resource Cos object may either be directly in the Page Cos object and apply only to the page. Or, it may be in the Pages tree, be shared by multiple pages, and applies to all Page nodes below the point in the Pages tree where it is located. **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): IN/OUT The page whose Cos resources are obtained. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) The dictionary Cos object associated with the page's resource. **See also:** [`PDPageAddCosResource`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageAddCosResource) #### PDPageGetCropBox ```cpp void PDPageGetCropBox(PDPage page, ASFixedRect *cropBoxP) ``` Header: `PDProcs.h:3206` Gets the crop box for a page. The crop box is the region of the page to display and print. **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page whose crop box is obtained. - `cropBoxP` (`ASFixedRect *`): (Filled by the method) A pointer to a rectangle specifying the page's crop box, specified in user space coordinates. **Returns:** `void` **See also:** [`PDPageSetCropBox`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageSetCropBox), [`PDPageGetMediaBox`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetMediaBox), [`PDPageGetBBox`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetBBox) #### PDPageGetDefaultMatrix ```cpp void PDPageGetDefaultMatrix(PDPage pdPage, ASFixedMatrix *defaultMatrix) ``` Header: `PDProcs.h:3252` Gets the matrix that transforms user space coordinates to rotated and cropped coordinates. The origin of this space is the bottom-left of the rotated, cropped page. `Y` is increasing. **Parameters** - `pdPage` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page whose default transformation matrix is obtained. - `defaultMatrix` (`ASFixedMatrix *`): (Filled by the method) A pointer to the default transformation matrix. **Returns:** `void` **See also:** [`PDPageGetFlippedMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetFlippedMatrix) #### PDPageGetDoc ```cpp PDDoc PDPageGetDoc(PDPage page) ``` Header: `PDProcs.h:3111` Gets the document that contains the specified page. **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): IN/OUT The page whose document is obtained. **Returns:** [`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc) The document that contains the page. **See also:** [`PDDocAcquirePage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocAcquirePage) #### PDPageGetDuration ```cpp ASFixed PDPageGetDuration(PDPage pdp) ``` Header: `PDProcs.h:5867` Gets the page's automatic-advance timing value, which is the maximum amount of time the page is displayed before the viewer automatically advances to the next page. **Parameters** - `pdp` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page whose timing value is obtained. **Returns:** [`ASFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixed) The automatic-advance timing for the page, in seconds. If the page does not have an advance timing value, fxDefaultPageDuration is returned (representing positive infinity, meaning that it never advances). **See also:** [`PDPageSetDuration`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageSetDuration) #### PDPageGetFlippedMatrix ```cpp void PDPageGetFlippedMatrix(PDPage pdPage, ASFixedMatrix *flipped) ``` Header: `PDProcs.h:3267` Gets the matrix that transforms user space coordinates to rotated and cropped coordinates. The origin of this space is the top-left of the rotated, cropped page. `Y` is decreasing. **Parameters** - `pdPage` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page whose flipped transformation matrix is obtained. - `flipped` (`ASFixedMatrix *`): (Filled by the method) A pointer to the flipped transformation matrix. **Returns:** `void` **See also:** [`PDPageGetDefaultMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetDefaultMatrix) #### PDPageGetMediaBox ```cpp void PDPageGetMediaBox(PDPage page, ASFixedRect *mediaBoxP) ``` Header: `PDProcs.h:3175` Gets the media box for a page. The media box is the *natural size* of the page (for example, the dimensions of an A4 sheet of paper). **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): IN/OUT The page whose media box is obtained. - `mediaBoxP` (`ASFixedRect *`): IN/OUT (Filled by the method) A pointer to a rectangle specifying the page's media box, specified in user space coordinates. **Returns:** `void` **See also:** [`PDPageSetMediaBox`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageSetMediaBox), [`PDPageGetCropBox`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetCropBox), [`PDPageGetBBox`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetBBox) #### PDPageGetNumAnnots ```cpp ASInt32 PDPageGetNumAnnots(PDPage aPage) ``` Header: `PDProcs.h:3470` Gets the number of annotations on a page. Annotations associated with pop-up windows (such as strikeouts) are counted as two annotations. Widget annotations (form fields) are included in the count. **Parameters** - `aPage` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page for which the number of annotations is obtained. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The number of annotations on `aPage`. **See also:** [`PDPageGetAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetAnnot) #### PDPageGetNumber ```cpp ASInt32 PDPageGetNumber(PDPage page) ``` Header: `PDProcs.h:3090` Gets the page number for the specified page. **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): IN/OUT The page whose page number is obtained. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The page within the document. The first page is `0`. **See also:** [`PDPageNumFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageNumFromCosObj) #### PDPageGetOCGs ```cpp PDOCG * PDPageGetOCGs(PDPage pdPage) ``` Header: `PDProcs.h:9206` Gets the optional-content groups for the document. **Parameters** - `pdPage` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page whose OCGs are obtained. **Returns:** [`PDOCG *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCG) A `NULL`-terminated array of PDOCG objects. The client is responsible for freeing the array with ASfree(). **See also:** [`PDDocGetOCGs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetOCGs), [`PDPageEnumOCGs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageEnumOCGs) #### PDPageGetPDEContentFilters ```cpp ASBool PDPageGetPDEContentFilters(IN PDPage pdPage, OUT ASInt32 *numFilters, OUT ASAtom **filters) ``` Header: `PgCntProcs.h:260` Gets filters used by PDPageSetPDEContent(). The caller is responsible for allocating the filter array `filters` that receives the filters. `filters` can be `NULL` to just obtain the number of filters. **Parameters** - `pdPage` (`IN PDPage`): The page whose content filters are obtained. - `numFilters` (`OUT ASInt32 *`): (Filled by the method) The number of filters used by PDPageSetPDEContent(). - `filters` (`OUT ASAtom **`): (Filled by the method) The filters used by PDPageSetPDEContent(). If it is `NULL`, `numFilters` contains the number of filters. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if `filters` are obtained, `false` if the page's contents are not cached. **See also:** [`PDPageSetPDEContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageSetPDEContent), [`PDPageSetPDEContentFilters`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageSetPDEContentFilters) #### PDPageGetPDEContentFlags ```cpp ASBool PDPageGetPDEContentFlags(IN PDPage pdPage, OUT ASUns32 *flags) ``` Header: `PgCntProcs.h:218` Gets flags used by PDPageSetPDEContent(). **Parameters** - `pdPage` (`IN PDPage`): The page whose content flags are obtained. - `flags` (`OUT ASUns32 *`): (Filled by the method) PDEContentToCosObjFlags flags. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if flags obtained, `false` if the page's contents are not cached. **See also:** [`PDPageSetPDEContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageSetPDEContent), [`PDPageSetPDEContentFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageSetPDEContentFlags) #### PDPageGetPalette ```cpp ASBool PDPageGetPalette(PDPage page, void *displayContext, char *table) ``` Header: `PDProcs.h:8280` Useful for obtaining the static, platform-specific palette; the bitmap must be already selected into the `displayContext` to get the palette. This API was exposed for the purpose of the ImageConversion plug-in. When that code uses PDPageDrawContentsToWindow() to get a bitmap from AGM, it needs the palette that AGM used in order to get the correct results. **Note:** Platform: ((!MAC_PLATFORM || (MAC_PLATFORM && !AS_ARCH_64BIT))) && ((!MAC_PLATFORM)) **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page whose palette is obtained. - `displayContext` (`void *`): The bitmap. - `table` (`char *`): (Filled by the method) The palette. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the palette was returned, `false` otherwise. #### PDPageGetRotate ```cpp PDRotate PDPageGetRotate(PDPage page) ``` Header: `PDProcs.h:3146` Gets the rotation value for a page. **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): IN/OUT The page whose rotation is obtained. **Returns:** [`PDRotate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRotate) Rotation value for the given page. It must be one of the PDRotate values. **See also:** [`PDPageSetRotate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageSetRotate) #### PDPageGetTransition ```cpp PDTrans PDPageGetTransition(PDPage pdp) ``` Header: `PDProcs.h:5842` Gets the transition for a given page. **Parameters** - `pdp` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page whose transition is obtained. **Returns:** [`PDTrans`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTrans) The page's transition. If the page has no transition, it returns a `NULL` transition. **See also:** [`PDPageSetTransition`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageSetTransition), [`PDTransNull`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTransNull) #### PDPageGetUserUnitSize ```cpp float PDPageGetUserUnitSize(PDPage page) ``` Header: `PDProcs.h:11238` Returns the UserUnit value for the page. If the key is not present in the page dictionary the default of `1.0` is returned. **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page whose UserUnit value is being obtained. **Returns:** `float` The value of UserUnit from the page dictionary, or a default value of `1.0` if not present. #### PDPageGetVisibleBBox ```cpp void PDPageGetVisibleBBox(PDPage page, PDOCContext ocContext, ASBool includeAnnots, ASFixedRect *fr) ``` Header: `PDProcs.h:10741` Gets the bounding box for a given page for those contents that are visible in the given optional-content context. The bounding box is the rectangle that encloses the visible text, graphics, and images on the page. **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page whose visible-content bounding box is obtained. - `ocContext` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The context within which the contents are visible. - `includeAnnots` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): When `true`, include annotations as content that must be visible to affect the bounding box. When `false`, annotations are not considered at all. - `fr` (`ASFixedRect *`): (Filled by the method) A pointer to a rectangle specifying the page's visible content bounding box, specified in user space coordinates. The client must not pass `NULL`. **Returns:** `void` **See also:** [`PDPageGetBBox`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetBBox) #### PDPageHasOverprintExt ```cpp ASBool PDPageHasOverprintExt(PDPage pdPage) ``` Header: `PDProcs.h:11836` Checks whether a page contains overprint (with qualifications). **Parameters** - `pdPage` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page to check. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` only if the page contains overprint. #### PDPageHasTransition ```cpp ASBool PDPageHasTransition(PDPage pdp) ``` Header: `PDProcs.h:5830` Tests whether a page has a transition. **Parameters** - `pdp` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page to test. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the page has a transition, `false` otherwise. #### PDPageHasTransparency ```cpp ASBool PDPageHasTransparency(PDPage pdPage, ASBool includeAnnotAppearances) ``` Header: `PDProcs.h:8157` Checks whether a page uses any transparency features. **Note:** To determine whether the page uses transparency, the resources of the page must be enumerated (though the page contents do not need to be parsed). The page resources may not be optimized for slow (browser-based) connections, so calling PDPageHasTransparency() before the page has been downloaded may cause unpleasant read behavior and performance problems. **Parameters** - `pdPage` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page to check. - `includeAnnotAppearances` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): If `true`, annotation appearances are included in the check; if `false` annotation appearances will be ignored. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` only if the page uses any transparency features. #### PDPageMakeSeparations ```cpp void PDPageMakeSeparations(PDPage pdPage, PDHostSepsSpec spec) ``` Header: `PDProcs.h:8352` Generates print color separations for a page. This is the entry point for creating separations for a single page. The spec structure contains an array of PDHostSepsPlate pointers, (typically based on the page inks reported by PDPageEnumInks()), with settings such as what to do on each plate and the output stream for plates that are being produced. The client owns the memory for the array and all of the records in it, and is responsible for disposing of all allocated memory. On completion, the marked flags in the `wasColorSet` field of the plates indicate whether each plate was marked, meaning that any marking operation happened, even if it was clipped away or knocked out later. The special All colorant in a Separation color space does not affect the marked flags. For Adobe Reader and Acrobat, this method does nothing. **Parameters** - `pdPage` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page. - `spec` (`PDHostSepsSpec`): The separation specification structure containing parameters for the generation. **Returns:** `void` **See also:** `AVDocPrintSeparations`, [`PDPageEnumInks`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageEnumInks), [`PDPageMakeSeparations`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageMakeSeparations) #### PDPageNotifyContentsDidChange ```cpp void PDPageNotifyContentsDidChange(PDPage page) ``` Header: `PDProcs.h:3080` Broadcasts a PDPageContentsDidChange() notification. If the Acrobat viewer is version 2.1 or later, also broadcasts a PDPageContentsDidChangeEx() notification with `invalidateViews` set to `true`. You must use this method after using Cos methods to change a page's contents. Do not use this method if you use PDPageAddCosContents() or PDPageRemoveCosContents() to change a page's contents, because those methods automatically generate the appropriate notifications. Use PDPageNotifyContentsDidChangeEx() instead of this method if you wish to suppress the Acrobat viewer's immediate redraw of the page. **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): IN/OUT The page that changed. @notify PDPageContentsDidChange @notify PDPageContentsDidChangeEx (in version 2.1 and later) **Returns:** `void` **See also:** [`PDPageAddCosContents`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageAddCosContents), [`PDPageRemoveCosContents`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageRemoveCosContents), [`PDPageNotifyContentsDidChangeEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageNotifyContentsDidChangeEx) #### PDPageNotifyContentsDidChangeEx ```cpp void PDPageNotifyContentsDidChangeEx(PDPage page, ASBool invalidateViews) ``` Header: `PDProcs.h:5418` Broadcasts a PDPageContentsDidChange() notification and a PDPageContentsDidChangeEx() notification. These notify the Acrobat viewer that a page's contents have been modified, and tells the Acrobat viewer whether to redraw the page immediately. You must use this method after using Cos methods to change a page's contents. Do not use this method if you use PDPageAddCosContents() or PDPageRemoveCosContents() to change a page's contents, because those methods automatically generate the appropriate notifications. If your plug-in must be compatible with version 2.0 of the Acrobat viewer, you must use PDPageNotifyContentsDidChange() instead. **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page that changed. - `invalidateViews` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): `true` if the Acrobat viewer redraws the page view, `false` otherwise. This allows plug-ins to make a sequence of modifications to a page's contents, without having the entire page flash after each modification. Passing `true` for `invalidateViews` is equivalent to calling PDPageNotifyContentsDidChange(). @notify PDPageContentsDidChange @notify PDPageContentsDidChangeEx **Returns:** `void` **See also:** [`PDPageAddCosContents`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageAddCosContents), [`PDPageRemoveCosContents`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageRemoveCosContents), [`PDPageNotifyContentsDidChange`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageNotifyContentsDidChange) #### PDPageNumFromCosObj ```cpp ASInt32 PDPageNumFromCosObj(CosObj pageObj) ``` Header: `PDProcs.h:3135` Gets the page number of the page specified by a Cos object. **Note:** Do not call this method with a `NULL` Cos object. **Parameters** - `pageObj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): IN/OUT The dictionary Cos object for the page whose number is obtained. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The page within the document (the first page in a document is page number zero). **See also:** [`PDPageGetNumber`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetNumber) #### PDPagePDEContentWasChanged ```cpp void PDPagePDEContentWasChanged(IN PDPage pdPage, IN ASExtension self) ``` Header: `PgCntProcs.h:125` Indicates a page's PDEContent has changed. Call this after you alter a PDPage object's PDEContent but do not call PDPageSetPDEContent(), so others who have acquired the PDEContent know it has changed. **Parameters** - `pdPage` (`IN PDPage`): The page whose content was changed. - `self` (`IN ASExtension`): Identifies the caller or client. For plug-ins, this should be the gExtensionID extension. For the Adobe PDF Library, if there is only one client of the PDFEdit subsystem, this should be zero. If there are multiple clients, each should specify a nonzero, non-negative value. (A negative value is reserved for the implementation.) @notify PagePDEContentDidChange **Returns:** `void` **See also:** [`PDPageSetPDEContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageSetPDEContent) #### PDPageRegisterForPDEContentChanged ```cpp void PDPageRegisterForPDEContentChanged(IN PagePDEContentDidChangeNPROTO proc, IN ASExtension self) ``` Header: `PgCntProcs.h:143` Registers for the PagePDEContentDidChange() notification. **Parameters** - `proc` (`IN PagePDEContentDidChangeNPROTO`): A callback for the function to call when an acquired PDPage object's PDEContent has changed. - `self` (`IN ASExtension`): Identifies the caller or client. For plug-ins, this should be the gExtensionID extension. For the Adobe PDF Library, if there is only one client of the PDFEdit subsystem, this should be zero. If there are multiple clients, each should specify a nonzero, non-negative value. (A negative value is reserved for the implementation.) @notify PagePDEContentDidChange **Returns:** `void` **See also:** [`PDPageRegisterForPDEContentNotCached`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageRegisterForPDEContentNotCached), [`PDPageUnRegisterForPDEContentChanged`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageUnRegisterForPDEContentChanged) #### PDPageRegisterForPDEContentNotCached ```cpp void PDPageRegisterForPDEContentNotCached(IN PagePDEContentNotCachedNPROTO proc, IN ASExtension self) ``` Header: `PgCntProcs.h:187` Register for the PagePDEContentNotCached() notification. This notification is also sent when others change (or delete) a PDPage object's contents without using PDFEdit methods. For instance, rotating or deleting a page in the viewer results in this notification being sent. PDFEdit registers for almost a half dozen different notifications for the different ways Acrobat can alter page contents; you may need only this notification. **Parameters** - `proc` (`IN PagePDEContentNotCachedNPROTO`): A callback for the function to call when an acquired PDPage object's PDEContent is no longer valid. - `self` (`IN ASExtension`): Identifies the caller or client. For plug-ins, this should be the gExtensionID extension. For the Adobe PDF Library, if there is only one client of the PDFEdit subsystem, this should be zero. If there are multiple clients, each should specify a nonzero, non-negative value. (A negative value is reserved for the implementation.) @notify PagePDEContentNotCached **Returns:** `void` **See also:** [`PDPageRegisterForPDEContentChanged`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageRegisterForPDEContentChanged), [`PDPageUnRegisterForPDEContentNotCached`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageUnRegisterForPDEContentNotCached) #### PDPageRelease ```cpp void PDPageRelease(PDPage page) ``` Header: `PDProcs.h:3101` Decrements the specified page's reference count. **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): IN/OUT The page whose reference count is decremented. **Returns:** `void` **See also:** [`PDBeadAcquirePage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBeadAcquirePage), [`PDDocAcquirePage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocAcquirePage) #### PDPageReleasePDEContent ```cpp ASInt32 PDPageReleasePDEContent(IN PDPage pdPage, IN ASExtension self) ``` Header: `PgCntProcs.h:77` Decrements a PDPage object's PDEContent internal reference count. The PDEContent is not automatically deleted when the reference count becomes zero: it remains in the cache until the cache slot is needed for another PDPage. Thus, you do not need to keep a PDEContent acquired for performance reasons. There is a notification for which you can register that is sent when a PDEContent is actually removed from the cache, thus enabling the use of PDFEdit object's tagging methods PDEAddTag(), PDEGetTag(), and PDERemoveTag() on the PDEContent object. **Parameters** - `pdPage` (`IN PDPage`): The page whose content object's use count is decremented. - `self` (`IN ASExtension`): Identifies the caller or client. For plug-ins, this should be the gExtensionID extension. For the Adobe PDF Library, if there is only one client of the PDFEdit subsystem, this should be zero. If there are multiple clients, each should specify a nonzero, non-negative value. (A negative value is reserved for the implementation.) **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The updated reference count. **See also:** [`PDPageAcquirePDEContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageAcquirePDEContent), [`PDPageSetPDEContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageSetPDEContent) #### PDPageRemoveAnnot ```cpp void PDPageRemoveAnnot(PDPage aPage, ASInt32 annotIndex) ``` Header: `PDProcs.h:3441` Removes an annotation from the specified page. Annotations are stored in Cos arrays, which are automatically compressed when an annotation is removed (see CosArrayRemove()). For this reason, if you use a loop in which you remove annotations, structure the code so the loop processes from the highest to the lowest index. If you loop the other direction, you will skip over annotations immediately following ones you remove. **Parameters** - `aPage` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page from which the annotation is removed. - `annotIndex` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The index (into the page's annotation array) of the annotation to remove. **Returns:** `void` **Exceptions** - `pdErrOpNotPermitted`: is raised if: • The annotation is of subtype Text and the document's permissions do not include pdPermEditNotes (see PDPerms). • The annotation is of any other subtype and the document's permissions do not include pdPermEdit. @notify PDPageWillRemoveAnnot @notify PDPageDidRemoveAnnot **See also:** [`PDPageGetAnnotIndex`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetAnnotIndex), [`PDPageAddNewAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageAddNewAnnot), [`PDPageAddAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageAddAnnot) #### PDPageRemoveCosContents ```cpp void PDPageRemoveCosContents(PDPage page) ``` Header: `PDProcs.h:3572` Removes the contents of the specified page. **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): IN/OUT The page whose Cos contents are removed. @notify PDDocDidChangePages **Returns:** `void` **See also:** [`PDPageAddCosContents`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageAddCosContents) #### PDPageRemoveCosResource ```cpp void PDPageRemoveCosResource(PDPage page, const char *resType, const char *resName) ``` Header: `PDProcs.h:3562` Removes a Cos resource from a page object. See the description of Resource Dictionaries in ISO 32000-1:2008, Document Management- Portable Document Format-Part 1: PDF 1.7, section 7.8.3, page 82. You can find this document on the web store of the International Standards Organization (ISO). **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page whose Cos resources are removed. - `resType` (`const char *`): The resource type. The named resource types in PDF are: ExtGState, ColorSpace, Pattern, Shading, XObject, Font, ProcSet, and Properties. - `resName` (`const char *`): The resource name (for example, the name of a font might be `F1`). @notify PDDocDidChangePages **Returns:** `void` **See also:** [`PDPageAddCosResource`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageAddCosResource), [`PDPageGetCosResources`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetCosResources) #### PDPageResumePDEContentChanged ```cpp void PDPageResumePDEContentChanged(IN PDPage pdPage) ``` Header: `PgCntProcs.h:303` Resumes destruction of PDEContent objects when a PDPageContentsDidChange() notification occurs. Only use this API if you called PDPageSuspendPDEContentChanged(). **Parameters** - `pdPage` (`IN PDPage`): IN/OUT The page whose content is changed. **Returns:** `void` **See also:** [`PDPageSuspendPDEContentChanged`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageSuspendPDEContentChanged) #### PDPageSetBox ```cpp void PDPageSetBox(PDPage page, ASAtom boxName, ASFixedRect box) ``` Header: `PDProcs.h:7905` Sets the box specified by `boxName` for the page. This method may throw exceptions. **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): IN/OUT The page for which the box is to be set. - `boxName` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): IN/OUT An ASAtom representing the type of box. The box names are: • `ArtBox` • `BleedBox` • `CropBox` • `TrimBox` • `MediaBox` - `box` (`ASFixedRect`): IN/OUT An `ASFixedRect` specifying the coordinates to set for the box. @notify PDDocWillChangePages @notify PDDocDidChangePages **Returns:** `void` **See also:** [`PDPageGetBox`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetBox) #### PDPageSetCropBox ```cpp void PDPageSetCropBox(PDPage page, ASFixedRect cropBox) ``` Header: `PDProcs.h:3222` Sets the crop box for a page. The crop box is the region of the page to display and print. This method ignores the request if either the width or height of cropBox is less than 72 points (one inch). **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page whose crop box is set. - `cropBox` (`ASFixedRect`): A rectangle specifying the page's crop box, specified in user space coordinates. @notify PDDocWillChangePages @notify PDDocDidChangePages **Returns:** `void` **See also:** [`PDPageGetCropBox`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetCropBox), [`PDPageSetMediaBox`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageSetMediaBox) #### PDPageSetDuration ```cpp void PDPageSetDuration(PDPage pdp, ASFixed fxDuration) ``` Header: `PDProcs.h:5881` Sets the page's automatic-advance timing value, which is the maximum amount of time the page is displayed before the viewer automatically advances to the next page. **Parameters** - `pdp` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page whose timing is set. - `fxDuration` ([`ASFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixed)): The auto-advance timing, in seconds. If no advance timing is desired, `fxDuration` should be set to fxDefaultPageDuration. **Returns:** `void` **See also:** [`PDPageGetDuration`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetDuration) #### PDPageSetMediaBox ```cpp void PDPageSetMediaBox(PDPage page, ASFixedRect mediaBox) ``` Header: `PDProcs.h:3192` Sets the media box for a page. The media box is the *natural size* of the page, for example, the dimensions of an A4 sheet of paper. **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): IN/OUT The page whose media box is set. - `mediaBox` (`ASFixedRect`): IN/OUT Rectangle specifying the page's media box, specified in user space coordinates. @notify PDDocWillChangePages @notify PDDocDidChangePages **Returns:** `void` **See also:** [`PDPageGetMediaBox`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetMediaBox), [`PDPageSetCropBox`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageSetCropBox), [`PDPageGetBBox`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetBBox) #### PDPageSetPDEContent ```cpp ASBool PDPageSetPDEContent(IN PDPage pdPage, IN ASExtension self) ``` Header: `PgCntProcs.h:105` Sets the page's PDEContent back into the PDPage object's Cos object, using the same compression filters with which the content was previously encoded. In order to properly synchronize the page's contents after setting them with PDPageSetPDEContent(), you must call PDPageNotifyContentsDidChange(). If you do not call PDPageNotifyContentsDidChange(), the page displayed will use the old page contents. @notify PDPageContentsDidChangeEx **Parameters** - `pdPage` (`IN PDPage`): The page whose PDEContent is set. - `self` (`IN ASExtension`): Identifies the caller or client. For plug-ins, this should be the gExtensionID extension. For the Adobe PDF Library, if there is only one client of the PDFEdit subsystem, this should be zero. If there are multiple clients, each should specify a nonzero, non-negative value. (A negative value is reserved for the implementation.) **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if PDEContent successfully set, `false` otherwise. **See also:** [`PDEContentToCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentToCosObj), [`PDPageAcquirePDEContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageAcquirePDEContent), [`PDPageGetPDEContentFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetPDEContentFlags), [`PDPageNotifyContentsDidChange`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageNotifyContentsDidChange) #### PDPageSetPDEContentCanRaise ```cpp void PDPageSetPDEContentCanRaise(IN PDPage pdPage, IN ASExtension self) ``` Header: `PgCntProcs.h:328` Sets the page's PDEContent back into the PDPage object's Cos object, using the same compression filters with which the content was previously encoded. This method calls PDPageNotifyContentsDidChangeEx(). This method differs from PDPageSetPDEContent() in that it returns no value, but does raise an exception if it is unable to set the content. **Parameters** - `pdPage` (`IN PDPage`): The page whose PDEContent is set. - `self` (`IN ASExtension`): Identifies the caller or client. For plug-ins, this should be the gExtensionID extension. For the Adobe PDF Library, if there is only one client of the PDFEdit subsystem, this should be zero. If there are multiple clients, each should specify a nonzero, non-negative value. (A negative value is reserved for the implementation.) @notify PDPageContentsDidChangeEx **Returns:** `void` **See also:** [`PDEContentToCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentToCosObj), [`PDPageAcquirePDEContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageAcquirePDEContent), [`PDPageGetPDEContentFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetPDEContentFlags), [`PDPageSetPDEContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageSetPDEContent) #### PDPageSetPDEContentFilters ```cpp ASBool PDPageSetPDEContentFilters(IN PDPage pdPage, IN ASInt32 numFilters, IN ASAtom *filters) ``` Header: `PgCntProcs.h:276` Sets the filters used by PDPageSetPDEContent(). The filters are not instantiated until PDPageSetPDEContent() is called. **Parameters** - `pdPage` (`IN PDPage`): The page whose content filters are set. - `numFilters` (`IN ASInt32`): The number of filters used by PDPageSetPDEContent(). - `filters` (`IN ASAtom *`): An array of filters to use by PDPageSetPDEContent(). **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if filters were set, `false` if the page's contents are not cached (meaning that nothing was done). **See also:** [`PDPageGetPDEContentFilters`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetPDEContentFilters), [`PDPageSetPDEContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageSetPDEContent) #### PDPageSetPDEContentFlags ```cpp ASBool PDPageSetPDEContentFlags(IN PDPage pdPage, IN ASUns32 flags) ``` Header: `PgCntProcs.h:238` Sets flags used by PDPageSetPDEContent(). The flags are not instantiated until PDPageSetPDEContent() is called. **Parameters** - `pdPage` (`IN PDPage`): The page whose content flags are set. - `flags` (`IN ASUns32`): PDEContentToCosObjFlags flags. The following flags are ignored, since the content is always a page: kPDEContentToForm kPDEContentToCharProc **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) **See also:** [`PDPageGetPDEContentFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetPDEContentFlags), [`PDPageSetPDEContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageSetPDEContent) #### PDPageSetRotate ```cpp void PDPageSetRotate(PDPage page, PDRotate angle) ``` Header: `PDProcs.h:3159` Sets the rotation value for a page. **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page whose rotation is set. - `angle` ([`PDRotate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRotate)): Rotation value to be set for a given page. It must be one of the PDRotate values. @notify PDDocWillChangePages @notify PDDocDidChangePages **Returns:** `void` **See also:** [`PDPageGetRotate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetRotate) #### PDPageSetTransition ```cpp void PDPageSetTransition(PDPage pdp, PDTrans pdt) ``` Header: `PDProcs.h:5853` Sets the transition for a given page. **Parameters** - `pdp` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page whose transition is set. - `pdt` ([`PDTrans`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTrans)): The transition for the page. **Returns:** `void` **See also:** [`PDPageGetTransition`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetTransition), [`PDTransNull`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTransNull) #### PDPageSetUserUnitSize ```cpp void PDPageSetUserUnitSize(PDPage page, float unitSize) ``` Header: `PDProcs.h:11246` Set the UserUnit value for a page. **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page whose UserUnit value is being set. - `unitSize` (`float`): UserUnit value to be set for the page dictionary. The default value is `1.0`. **Returns:** `void` **Exceptions** - `genErrBadParm`: is raised if `unitSize <= 0.0` . #### PDPageStmGetInlineImage ```cpp ASUns32 PDPageStmGetInlineImage(ASStm stm, ASUns32 flags, CosDoc cosDoc, CosObj resDict, PDPageStmImageDataProc proc, void *procClientData, ASUns32 *imageRawDataStmOffsetP, ASUns32 *imageRawDataLenP, CosObj *imageDict) ``` Header: `PDProcs.h:5720` Reads a PDF page content inline image from a stream. The stream is typically obtained by getting the Cos stream for a page contents or a Form contents, and calling CosStreamOpenStm() to open the stream using the *filtered* mode. This method is called after a BI token has been read from the stream. BI indicates that the following tokens comprise an inline image dictionary and data. It begins reading at the current stream position. It returns the number of bytes read. This is the number of bytes read from the stream and indicates the amount by which the stream position has advanced. The image attributes dictionary is returned in `imageDict`. The image data is passed to the PDPageStmImageDataProc(); if `proc` is not provided, the image data is discarded. `imageRawDataStmOffsetP` and `imageRawDataLenP` may be `NULL`, in which case they are ignored. The caller should call CosObjDestroy() on `imageDict` when it is done. This method can raise memory, I/O, and parsing exceptions. @since **Parameters** - `stm` ([`ASStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStm)): The stream from which data is read. - `flags` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): Currently unused by this method (used by PDPageStmGetToken().) - `cosDoc` ([`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc)): The CosDoc with the PDPage that contains the inline image. - `resDict` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The Resources dictionary in which to look up ColorSpace resources for inline images. - `proc` ([`PDPageStmImageDataProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageStmImageDataProc)): A callback method to handle inline image data.`proc`. - `procClientData` (`void *`) - `imageRawDataStmOffsetP` ([`ASUns32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): (Filled by the method) The offset of the data stream, after BI, relative to the beginning of `stm`. - `imageRawDataLenP` ([`ASUns32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): (Filled by the method) The offset of the last byte of the data stream between the BI and EI PDF operators. - `imageDict` ([`CosObj *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): (Filled by the method) The returned image dictionary.`stm`. **Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32) **See also:** [`CosStreamOpenStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosStreamOpenStm), [`PDPageGetBox`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetBox), [`PDPageStmGetToken`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageStmGetToken) #### PDPageStmGetToken ```cpp ASUns32 PDPageStmGetToken(ASStm stm, ASUns32 flags, PDPageStmStringOverflowProc proc, void *procClientData, PDPageStmToken pageStmToken) ``` Header: `PDProcs.h:5669` Reads a PDF page content token from a stream. The stream is typically obtained by getting the Cos stream for a page contents or a Form contents, and calling CosStreamOpenStm() to open the stream using the *filtered* mode. It begins reading at the current stream position, and reads exactly one token. It returns the number of bytes read. This is the number of bytes read from the stream and indicates the amount by which the stream position has advanced. The end-of-stream criteria (loop terminating condition) is the following: A `NULL` object is returned (an object of type CosNull). The number of bytes read (return value) is `1`. If the token is an integer, real (ASFixed), or ASBool, then the value is returned in `pageStmToken.iVal`. If the token is a string or a name, the value is returned in `pageStmToken.sVal`, and the length of the token is in `pageStmToken.sValLen`. Strings are not `NULL`-terminated, but names are `NULL`-terminated. If a string length is greater than kPDPageStmStringMax, the PDPageStmStringOverflowProc() is called repeatedly with portions of the string. On return from PDPageStmGetToken, the value of `pageStmToken.sValLen` is zero, and `pageStmToken.sVal` is empty (`ival`, `sVal`, and `sValLen` are components of the PDPageStmToken). If there is no overflow proc, then the first kPDPageStmStringMax bytes of the string will be returned in `pageStmToken.sVal`, and the remaining bytes are lost. The value of `pageStmToken.sValLen` is kPDPageStmStringMax in this case. If the token is BI (begin inline image), PDPageStmGetInlineImage() should be called to parse the inline image. This method can raise memory, I/O, and parsing exceptions. @since **Parameters** - `stm` ([`ASStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStm)): The stream from which data is read. - `flags` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): A bit field of options such as 'skip comments' (kPDPageStmSkipComments means skip comments during token generation). - `proc` ([`PDPageStmStringOverflowProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageStmStringOverflowProc)): A callback method to handle long strings. - `procClientData` (`void *`): Client data passed to the callback method. - `pageStmToken` (`PDPageStmToken`): The returned token. **Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32) **See also:** [`CosStreamOpenStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosStreamOpenStm), [`PDPageGetCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetCosObj), [`PDPageStmGetInlineImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageStmGetInlineImage) #### PDPageSuspendPDEContentChanged ```cpp void PDPageSuspendPDEContentChanged(IN PDPage pdPage) ``` Header: `PgCntProcs.h:292` Suspends destruction of PDEContent objects when a PagePDEContentDidChange() notification occurs. Only use this API if you are about to call PDPageNotifyContentsDidChange() and you do not want PDFEdit to destroy all PDEContent objects associated with that PDPage. This is used, for example, when AVAppSetPreference() is called. Make sure to call PDPageSuspendPDEContentChanged() on the PDPage object after you call PDPageNotifyContentsDidChange(). **Parameters** - `pdPage` (`IN PDPage`): IN/OUT The page whose content is changed. **Returns:** `void` **See also:** [`PDPageResumePDEContentChanged`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageResumePDEContentChanged) #### PDPageUnRegisterForPDEContentChanged ```cpp void PDPageUnRegisterForPDEContentChanged(IN PagePDEContentDidChangeNPROTO proc, IN ASExtension self) ``` Header: `PgCntProcs.h:160` Un-registers for the PagePDEContentDidChange() notification. **Parameters** - `proc` (`IN PagePDEContentDidChangeNPROTO`): A callback for the function to call when an acquired PDPage object's PDEContent has changed. - `self` (`IN ASExtension`): Identifies the caller or client. For plug-ins, this should be the gExtensionID extension. For the Adobe PDF Library, if there is only one client of the PDFEdit subsystem, this should be zero. If there are multiple clients, each should specify a nonzero, non-negative value. (A negative value is reserved for the implementation.) @notify PagePDEContentDidChange **Returns:** `void` **See also:** [`PDPageRegisterForPDEContentChanged`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageRegisterForPDEContentChanged) #### PDPageUnRegisterForPDEContentNotCached ```cpp void PDPageUnRegisterForPDEContentNotCached(IN PagePDEContentNotCachedNPROTO proc, IN ASExtension self) ``` Header: `PgCntProcs.h:205` Un-registers for the PagePDEContentNotCached() notification. @notify PagePDEContentNotCached **Parameters** - `proc` (`IN PagePDEContentNotCachedNPROTO`): IN/OUT A callback for the function to call when an acquired PDPage object's PDEContent is no longer valid. - `self` (`IN ASExtension`): IN/OUT Identifies the caller/client. For plug-ins, this should be the gExtensionID extension. For the Adobe PDF Library, if there is only one client of the PDFEdit subsystem, `clientID` should be zero. If there are multiple clients, each should specify a nonzero, non-negative `clientID`. (A negative `clientID` is reserved for the implementation.) **Returns:** `void` **See also:** [`PDPageRegisterForPDEContentNotCached`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageRegisterForPDEContentNotCached) ### Typedefs (8) #### PDPageArea ```cpp typedef ASEnum16 PDPageArea ``` Header: `PDExpT.h:6374` #### PDPageDrawFlagsPI ```cpp typedef ASUns32 PDPageDrawFlagsPI ``` Header: `PDExpT.h:6821` #### PDPageMode ```cpp typedef ASEnum8 PDPageMode ``` Header: `PDExpT.h:2027` #### PDPageNumber ```cpp typedef ASInt32 PDPageNumber ``` Header: `PDExpT.h:61` A `0`-based page number for use in AVPageView and AVDoc methods. Negative for special values. **See also:** `AVDocGetPageText`, `AVDocGetViewDef`, `AVPageViewGetFirstVisiblePageNum`, `AVPageViewGetLastVisiblePageNum`, `AVPageViewGetNextView`, `AVPageViewGetPageNum`, `AVPageViewGetSelectedAnnotPageNum`, `AVPageViewGetVisibleAnnotPage`, `AVPageViewGoTo`, `AVPageViewPageNumIsVisible`, `AVPageViewSetPageNum`, `AVDocSelectionGetAVRectProc`, `AVSelectionPageRangeEnumProc` #### PDRotate ```cpp typedef ASEnum16 PDRotate ``` Header: `PDExpT.h:2492` #### PDPageEnumInksCallback ```cpp typedef ASBool(*) PDPageEnumInksCallback(PDPageInk ink, void *clientData)(PDPageInk ink, void *clientData) ``` Header: `PDExpT.h:6026` Used for enumerating the inks on a page via PDPageEnumInks(). #### PDPageStmImageDataProc ```cpp typedef ASBool(*) PDPageStmImageDataProc(ASUns8 *data, ASSize_t dataLen, void *clientData)(ASUns8 *data, ASSize_t dataLen, void *clientData) ``` Header: `PDExpT.h:4057` A callback for PDPageStmGetInlineImage(). It should be called when inline image data is encountered in PDPageStmGetToken(). This method may be called multiple times for one inline image. If so, each call provides sequential data for the image. **See also:** [`PDPageStmGetInlineImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageStmGetInlineImage), [`PDPageStmGetToken`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageStmGetToken) #### PDPageStmStringOverflowProc ```cpp typedef void(*) PDPageStmStringOverflowProc(char *sVal, ASSize_t sValLen, void *clientData)(char *sVal, ASSize_t sValLen, void *clientData) ``` Header: `PDExpT.h:4033` A callback used by PDPageStmGetToken(). It is called when the length of a string token exceeds `kPDPageStmStringMax` bytes (see `PDExpT.h`) in PDPageStmGetToken(). **See also:** [`PDPageStmGetToken`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageStmGetToken) ### Structures (1) #### PDPage ```cpp typedef struct _t_PDPage* PDPage ``` Header: `PDBasicExpT.h:88` A single page in the PDF representation of a document. Just as PDF files are partially composed of their pages, PDDoc objects are composed of PDPage objects. A page contains a series of objects representing the objects drawn on the page (PDGraphic), a list of resources used in drawing the page, annotations (PDAnnot), an optional thumbnail image of the page, and the beads used in any articles that occur on the page. The first page in a PDDoc is page `0`. **See also:** [`PDDocCreatePage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreatePage), [`PDBeadAcquirePage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBeadAcquirePage), [`PDDocAcquirePage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocAcquirePage), `AVPageViewGetPage`, [`PDDocDeletePages`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocDeletePages), [`PDPageRelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageRelease) ### Enums (4) #### PDPageAreas Header: `PDExpT.h:6363` Different logical areas on a page. **Values** - `kPDPageArea = 0` - `kPDClipArea = 1` - `kPDNumAreas = 2` #### PDPageDrawFlagsPIs Header: `PDExpT.h:6762` **Values** - `kPDPageDoLazyErasePI = 0x00000001`: Erase the page while rendering only as needed. - `kPDPageIgnoreIsolatedAndKnockoutTransparencyGroupPI = 0x00000010`: Ignore Isolated and Knockout transparency at page boundary. - `kPDPageUseAnnotFacesPI = 0x00000040`: Draw annotation appearances. - `kPDPageIsPrintingPI = 0x00000080`: The page is being printed. - `kPDPageDisplayOverPrintPreviewPI = 0x00000100`: Display overprint preview. - `kPDPageUseTrapAnnotsPI = 0x00002000`: Use trap network annotations. - `kPDPageDirectlyImposedPI = 0x00004000`: Directly imposed page. - `kPDPageIsPSPrintingPI = 0x00008000`: PostScript printing. - `kPDPageEmitPageGroupPI = 0x00010000`: Emit a page group. - `kPDPageUsePrinterMarkAnnotsPI = 0x00020000`: User printer's mark annotations. - `kPDPagePassOPItoAGMPortPI = 0x00040000`: Pass open prepress interface (OPI) to AGM port. - `kPDPagePassMetadatatoAGMPortPI = 0x00080000`: Pass metadata to AGM port. - `kPDPagePassOCtoAGMPortPI = 0x00100000`: Pass optional content to AGM port. - `kPDPageDoNotSubstituteWorkingSpacesPI = 0x00800000`: Do not substitute working spaces. - `kPDPageSwapComponentsPI = 0x01000000`: Render colors in BGR order rather than RGB. It is only valid for calls to PDPageDrawContentsToMemory() and only when outputing to an RGB colorspace. - `kPDPageSuppressRasterAlphaPI = 0x02000000`: Suppress raster alpha. - `kPDPageWorkingSpacesOnlyForChangePI = 0x04000000`: If this is set, only use a working space instead of a device space if the process color model of the target device is different than that of the source - `kPDPageUseStampAnnotsOnlyPI = 0x08000000`: If set, only consider Stamp annotations. This overrides kPDPageUseAnnotFaces. #### PDPageModes Header: `PDExpT.h:1998` An enumerated data type that specifies whether thumbnail images or bookmarks are shown. **Values** - `PDDontCare = 0`: Leaves the view mode as is. - `PDUseNone = 1`: Displays the document, but displays neither thumbnails nor bookmarks. - `PDUseThumbs = 2`: Displays the document plus thumbnails. - `PDUseBookmarks = 3`: Displays the document plus bookmarks. - `PDFullScreen = 4`: Displays the document in full-screen viewing mode. This is equivalent to AVAppBeginFullScreen(). - `PDContents = 5` - `PDUseOC = 6`: Displays the document plus layers. - `PDUseAttachments = 7`: Displays the document plus attachments. **See also:** `AVDocGetViewMode`, `AVDocSetViewMode`, [`PDDocGetPageMode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetPageMode), [`PDDocSetPageMode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetPageMode) #### PDPageRotation Header: `PDExpT.h:2479` Specifies page rotation, in degrees. It is used for routines that set or get the value of a page's Rotate key. **Values** - `pdRotate0 = 0` - `pdRotate90 = 90` - `pdRotate180 = 180` - `pdRotate270 = 270` **See also:** [`PDPageGetRotate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetRotate), [`PDPageSetRotate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageSetRotate) ### Definitions (8) #### PDAllPages Header: `PDExpT.h:2182` Value: `((PDPageNumber)-3)` #### PDBeforeFirstPage Header: `PDExpT.h:2180` Value: `((PDPageNumber)-1)` #### PDEvenPagesOnly Header: `PDExpT.h:2184` Value: `((PDPageNumber)-5)` #### PDLastPage Header: `PDExpT.h:2181` Value: `((PDPageNumber)-2)` #### PDOddPagesOnly Header: `PDExpT.h:2183` Value: `((PDPageNumber)-4)` #### kPDPageStmSkipComments Header: `PDExpT.h:3989` Value: `0x0001` #### kPDPageStmStringMax Header: `PDExpT.h:3986` Value: `256` #### kPDPageStmTokenHexString Header: `PDExpT.h:3995` Value: `0x0001` ## PDPageLabel ### Functions (10) #### PDPageLabelEqual ```cpp ASBool PDPageLabelEqual(PDPageLabel pdlOne, PDPageLabel pdlTwo) ``` Header: `PDProcs.h:7132` Compares two page labels to see if they are equivalent. Two labels are equivalent if they have the same style, starting number (the numeric value of the first page associated with the label), and prefix strings which are the same byte-for-byte. **Parameters** - `pdlOne` ([`PDPageLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageLabel)): A page label. - `pdlTwo` ([`PDPageLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageLabel)): Another page label. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the two labels are valid and equivalent, `false` otherwise. **See also:** [`PDPageLabelIsValid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageLabelIsValid) #### PDPageLabelFromCosObj ```cpp PDPageLabel PDPageLabelFromCosObj(CosObj cosLabel) ``` Header: `PDProcs.h:7159` Creates a type cast of the CosObj to a PDPageLabel object. **Parameters** - `cosLabel` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): IN/OUT The Cos object level representation of a page label. **Returns:** [`PDPageLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageLabel) The page label representation of `cosLabel`. **Exceptions** - `pdErrBadBaseObj`: is raised if `cosLabel` is not a valid page label. **See also:** [`PDPageLabelGetCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageLabelGetCosObj) #### PDPageLabelGetCosObj ```cpp CosObj PDPageLabelGetCosObj(PDPageLabel pdl) ``` Header: `PDProcs.h:7145` Creates a type cast of the page label object to a Cos object. **Parameters** - `pdl` ([`PDPageLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageLabel)): IN/OUT A PDPageLabel representation of a page label. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) A CosObj representation of `pdl` if the page label is valid, `NULL` CosObj otherwise. **See also:** [`PDPageLabelFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageLabelFromCosObj) #### PDPageLabelGetPrefix ```cpp const char * PDPageLabelGetPrefix(PDPageLabel pgLabel, ASInt32 *prefixLen) ``` Header: `PDProcs.h:7189` Returns the prefix string for the label. The prefix string is transitory and should be copied immediately. **Parameters** - `pgLabel` ([`PDPageLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageLabel)): The label for the page whose prefix is desired. - `prefixLen` ([`ASInt32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): (Filled by the method) The length, in bytes, of the prefix string. It is zero if the page label is not valid. **Returns:** `const char *` The prefix string for the label, or `NULL` if none is specified. **See also:** [`PDPageLabelGetStart`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageLabelGetStart), [`PDPageLabelGetStyle`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageLabelGetStyle) #### PDPageLabelGetPrefixASText ```cpp void PDPageLabelGetPrefixASText(PDPageLabel pgLabel, ASText prefix) ``` Header: `PDProcs.h:11797` Returns the prefix string for the label as an ASText object. The prefix string is transitory and should be copied immediately. **Parameters** - `pgLabel` ([`PDPageLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageLabel)): The label for the page whose prefix is desired. - `prefix` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): (Filled by the method) The text object containing the prefix string. The client must pass a valid ASText object title. The routine does not allocate it. **Returns:** `void` **See also:** [`PDPageLabelGetPrefix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageLabelGetPrefix), [`PDPageLabelGetStart`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageLabelGetStart), [`PDPageLabelGetStyle`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageLabelGetStyle) #### PDPageLabelGetStart ```cpp ASInt32 PDPageLabelGetStart(PDPageLabel pgLabel) ``` Header: `PDProcs.h:7202` Gets the starting number of a given page label. **Parameters** - `pgLabel` ([`PDPageLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageLabel)): The page label for the page whose starting number is desired. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The starting number of the page label; that is, the numeric value of the first page associated with the label. It returns `1` if the page label is not valid or unknown. **See also:** [`PDPageLabelGetPrefix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageLabelGetPrefix), [`PDPageLabelGetStyle`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageLabelGetStyle) #### PDPageLabelGetStyle ```cpp ASAtom PDPageLabelGetStyle(PDPageLabel pgLabel) ``` Header: `PDProcs.h:7174` Returns an ASAtom for the style of the label. It raises an exception if storage is exhausted or file access fails. **Parameters** - `pgLabel` ([`PDPageLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageLabel)): IN/OUT The page label whose style is desired. **Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom) An ASAtom for the label style. If no style is specified, it returns `ASAtomFromString(" None")`. **See also:** [`PDPageLabelGetPrefix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageLabelGetPrefix), [`PDPageLabelGetStart`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageLabelGetStart) #### PDPageLabelIsValid ```cpp ASBool PDPageLabelIsValid(PDPageLabel pgLabel) ``` Header: `PDProcs.h:7117` Determines whether a page label is valid. A page label is valid if its values correspond to the specification for page label dictionaries. See the description of Page labels in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 12.4.2, page 374. You can find this document on the web store of the International Standards Organization (ISO). It raises an exception if storage is exhausted or file access fails. **Parameters** - `pgLabel` ([`PDPageLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageLabel)): The page label whose validity is determined. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the label is valid, `false` otherwise. **See also:** [`PDPageLabelEqual`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageLabelEqual) #### PDPageLabelNew ```cpp PDPageLabel PDPageLabelNew(PDDoc pdDoc, ASAtom style, const char *prefix, ASInt32 prefixLen, ASInt32 startAt) ``` Header: `PDProcs.h:7262` Constructs a new label object in the document with the specified style, prefix, and starting page number. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document that contains the new page label. - `style` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The numbering system to use for the numeric portion of each label in this range of pages. The possible values are `D` for decimal numbers, `R` for upper-case Roman numbers, `r` for lower-case Roman numbers, `A` for upper-case alphabetic numbers, or `a` for lower-case alphabetic numbers. If it is `None`, the labels for this range will not have a numeric portion. None is specified by providing ASAtomFromString("None") as the style parameter. - `prefix` (`const char *`): A string to prefix to the numeric portion of the page label. It may be a `NULL` string. - `prefixLen` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The length in bytes of the prefix string. - `startAt` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The value to use when generating the numeric portion of the first label in this range; it must be greater than or equal to `1`. **Returns:** [`PDPageLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageLabel) The newly created page label. **Exceptions** - `pdErrBadBaseObj`: is raised if the base pages object is missing or invalid. **See also:** [`PDDocRemovePageLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocRemovePageLabel), [`PDDocGetPageLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetPageLabel), [`PDDocFindPageNumForLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocFindPageNumForLabel), [`PDDocGetLabelForPageNum`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetLabelForPageNum), [`PDDocSetPageLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetPageLabel) #### PDPageLabelNewASText ```cpp PDPageLabel PDPageLabelNewASText(PDDoc pdDoc, ASAtom style, const ASText prefix, ASInt32 startAt) ``` Header: `PDProcs.h:11782` Constructs a new label object in the document with the specified style, prefix, and starting page number. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document that contains the new page label. - `style` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The numbering system to use for the numeric portion of each label in this range of pages. The possible values are: ValueDescription `D`Decimal numbers. `R`Upper-case Roman numbers. `r`Lower-case Roman numbers. `A`Upper-case alphabetic numbers. `a`Lower-case alphabetic numbers. If it is `None`, the labels for this range will not have a numeric portion. None is specified by providing ASAtomFromString("None") as the style parameter. - `prefix` ([`const ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): The text object containing the string to prefix to the numeric portion of the page label. - `startAt` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The value to use when generating the numeric portion of the first label in this range; it must be greater than or equal to `1`. **Returns:** [`PDPageLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageLabel) **Exceptions** - `pdErrBadBaseObj`: is raised if the base pages object is missing or invalid. **See also:** [`PDPageLabelNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageLabelNew), [`PDDocRemovePageLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocRemovePageLabel), [`PDDocGetPageLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetPageLabel), [`PDDocFindPageNumForLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocFindPageNumForLabel), [`PDDocGetLabelForPageNum`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetLabelForPageNum), [`PDDocSetPageLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSetPageLabel) ### Typedefs (1) #### PDPageLabel ```cpp typedef OPAQUE_64_BITS PDPageLabel ``` Header: `PDExpT.h:5574` A label used to describe a page. This is used to allow for non-sequential page numbering or the addition of arbitrary labels for a page (such as the inclusion of Roman numerals at the beginning of a book). A PDPageLabel specifies the numbering style to use (for example, upper-case or lower-case Roman, decimal, and so on), the starting number for the first page, and an arbitrary prefix to be preappended to each number (for example, `"A-"` is used to generate `"A-1"`, `"A-2"`, `"A-3"`, and so on). **See also:** [`PDDocGetPageLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetPageLabel), [`PDDocGetLabelForPageNum`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetLabelForPageNum), [`PDPageLabelFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageLabelFromCosObj), [`PDPageLabelNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageLabelNew), [`PDDocRemovePageLabel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocRemovePageLabel) ## PDPath ### Functions (2) #### PDPathEnum ```cpp void PDPathEnum(PDPath obj, PDPathEnumMonitor mon, void *clientData) ``` Header: `PDProcs.h:3708` Enumerates the specified path's operators, calling one of several user-supplied callbacks for each operator. The callback that is called depends on which operator is encountered. **Parameters** - `obj` ([`PDPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPath)): IN/OUT The path whose operators are enumerated. - `mon` ([`PDPathEnumMonitor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPathEnumMonitor)): IN/OUT A pointer to a structure that contains callbacks. One of the callbacks will be called for each path segment operator in the path. Enumeration ends if any of the monitor's callbacks returns `false`. - `clientData` (`void *`): IN/OUT A pointer to user-supplied data to pass to the monitor's callbacks each time one is called. **Returns:** `void` #### PDPathGetPaintOp ```cpp ASInt32 PDPathGetPaintOp(PDPath obj) ``` Header: `PDProcs.h:3721` Gets flags that indicate which paint/close/clip operators are used for the specified path. For a description of the path painting operators, see Section 4.4.2 in the *PDF Reference*. **Parameters** - `obj` ([`PDPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPath)): IN/OUT The path whose painting operators are obtained. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) A bit-wise `OR` of the PDPathPaintOp flags. ### Typedefs (9) #### PDPathPaintOp ```cpp typedef ASEnum8 PDPathPaintOp ``` Header: `PDExpT.h:2560` #### PDPathSegmentOp ```cpp typedef ASEnum8 PDPathSegmentOp ``` Header: `PDExpT.h:2534` #### PDPathClosePathProc ```cpp typedef ASBool(*) PDPathClosePathProc(void *clientData)(void *clientData) ``` Header: `PDExpT.h:3025` A callback for PDPathEnumMonitor. It is called for every path closing operator. **See also:** [`PDPathEnum`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPathEnum) #### PDPathCurveToProc ```cpp typedef ASBool(*) PDPathCurveToProc(ASFixedPoint *p1, ASFixedPoint *p2, ASFixedPoint *p3, void *clientData)(ASFixedPoint *p1, ASFixedPoint *p2, ASFixedPoint *p3, void *clientData) ``` Header: `PDExpT.h:2974` A callback for PDPathEnumMonitor. It is called for every c operator. **See also:** [`PDPathEnum`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPathEnum) #### PDPathLineToProc ```cpp typedef ASBool(*) PDPathLineToProc(ASFixedPoint *p1, void *clientData)(ASFixedPoint *p1, void *clientData) ``` Header: `PDExpT.h:2960` A callback for PDPathEnumMonitor. It is called for every l operator. **See also:** [`PDPathEnum`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPathEnum) #### PDPathMoveToProc ```cpp typedef ASBool(*) PDPathMoveToProc(ASFixedPoint *p1, void *clientData)(ASFixedPoint *p1, void *clientData) ``` Header: `PDExpT.h:2947` A callback for PDPathEnumMonitor. It is called for every m operator. **See also:** [`PDPathEnum`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPathEnum) #### PDPathRectProc ```cpp typedef ASBool(*) PDPathRectProc(ASFixedPoint *p1, ASFixedPoint *p2, void *clientData)(ASFixedPoint *p1, ASFixedPoint *p2, void *clientData) ``` Header: `PDExpT.h:3014` A callback for PDPathEnumMonitor. It is called for every re operator. **See also:** [`PDPathEnum`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPathEnum) #### PDPathVCurveToProc ```cpp typedef ASBool(*) PDPathVCurveToProc(ASFixedPoint *p1, ASFixedPoint *p2, void *clientData)(ASFixedPoint *p1, ASFixedPoint *p2, void *clientData) ``` Header: `PDExpT.h:2988` A callback for PDPathEnumMonitor. It is called for every v operator. **See also:** [`PDPathEnum`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPathEnum) #### PDPathYCurveToProc ```cpp typedef ASBool(*) PDPathYCurveToProc(ASFixedPoint *p1, ASFixedPoint *p2, void *clientData)(ASFixedPoint *p1, ASFixedPoint *p2, void *clientData) ``` Header: `PDExpT.h:3001` A callback for PDPathEnumMonitor. It is called for every y operator. **See also:** [`PDPathEnum`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPathEnum) ### Structures (2) #### PDPath ```cpp typedef struct _t_PDGraphic * PDPath ``` Header: `PDExpT.h:2499` #### PDPathEnumMonitor ```cpp typedef struct _t_PDPathEnumMonitor* PDPathEnumMonitor ``` Header: `PDExpT.h:3027` ### Enums (2) #### PDPathPaintOps Header: `PDExpT.h:2544` A path object consists of a sequence of segment operators (moveto, lineto, an so on), as well as a set of operations to be performed with the path. Note that the operations include doing nothing, closing, stroking, filling and using the path as a clip. **Values** - `pdPathNoPaint = 0`: The path is not painted. - `pdPathOpClose = 1`: The path contains a closepath operator. - `pdPathStroke = 2`: The path contains a stroke operator. - `pdPathFill = 4`: The path contains a fill operator. - `pdPathEOFill = 8`: The path contains an eofill operator. - `pdPathClip = 16`: The path contains a clip operator. - `pdPathEOClip = 32`: The path contains an eoclip operator. **See also:** [`PDPathSegmentOp`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPathSegmentOp), [`PDPathGetPaintOp`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPathGetPaintOp) #### PDPathSegmentOps Header: `PDExpT.h:2518` A path object consists of a sequence of segment operators (moveto, lineto, and so on), as well as a set of operations to be performed with the path. Note that the operations include doing nothing, closing, stroking, filling and using the path as a clip. **Values** - `pdSegMoveTo = 0` - `pdSegLineTo = 1` - `pdSegCurveTo = 2` - `pdSegVCurveTo = 3` - `pdSegYCurveTo = 4` - `pdSegRect = 5` - `pdSegClosePath = 6` **See also:** [`PDPathPaintOp`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPathPaintOp) ## PDPref ### Functions (13) #### PDPrefGetBlackPointCompensation ```cpp ASBool PDPrefGetBlackPointCompensation(void) ``` Header: `PDProcs.h:11884` Returns the black-point compensation flag. **Parameters** - (unnamed) (`void`) **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if black-point compensation is done. **See also:** [`PDPrefSetBlackPointCompensation`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPrefSetBlackPointCompensation) #### PDPrefGetColorCal ```cpp ASBool PDPrefGetColorCal(PDColorCalP colorCal) ``` Header: `PDProcs.h:5385` Gets the values to use for displaying the calibrated color and grayscale. These values are the chromaticity and gammas of the phosphors in the monitor. These values are used for rendering if calibrated color is enabled by the preferences file item avpDoCalibratedColor (see AVAppGetPreference()). **Parameters** - `colorCal` (`PDColorCalP`): IN/OUT (Filled by the method) A pointer to a structure that contains the color calibration information. For RGB devices, the red, green, and blue chromaticity and gammas are used; for grayscale, `whiteChrom` and `greenGamma` are used. You must allocate storage for the `colorCal` data structure and pass a pointer to the memory you allocated. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) Always returns `true`. **See also:** [`PDPrefSetColorCal`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPrefSetColorCal), `AVAppGetPreference` #### PDPrefGetDefaultBlendingColorSpace ```cpp ASInt32 PDPrefGetDefaultBlendingColorSpace(void) ``` Header: `PDProcs.h:12796` Get the default blending color space Index **Parameters** - (unnamed) (`void`) **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) value equal to 0 means default blending colorspace is Working CMYK, value equal to 1 means default blending colorspace is Working RGB. #### PDPrefGetInstallPatternParentGState ```cpp ASBool PDPrefGetInstallPatternParentGState(void) ``` Header: `PDProcs.h:12827` Get the preference whether to install the graphics state that was in effect at the beginning of the pattern's parent content stream **Parameters** - (unnamed) (`void`) **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) value equal to 0 means apply current GState, value equal to 1 means install GState was in effect at the beginning of the pattern's parent content stream. #### PDPrefGetUseOutputIntents ```cpp ASBool PDPrefGetUseOutputIntents(void) ``` Header: `PDProcs.h:11863` Returns the value of the Output Intent flag. When this flag is `true`, the system overrides the working space with the Output Intent, if it is present. **Parameters** - (unnamed) (`void`) **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) The Output Intent flag value. **See also:** [`PDPrefSetUseOutputIntents`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPrefSetUseOutputIntents) #### PDPrefSetBlackPointCompensation ```cpp void PDPrefSetBlackPointCompensation(ASBool kbpc) ``` Header: `PDProcs.h:11877` Sets the black-point compensation flag, which controls whether to adjust for differences in black points when converting colors between color spaces. When enabled, the full dynamic range of the source space is mapped into the full dynamic range of the destination space. When disabled, the dynamic range of the source space is simulated in the destination space (which can result in blocked or gray shadows). **Parameters** - `kbpc` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): `true` to enable black-point compensation, `false` otherwise. **Returns:** `void` **See also:** [`PDPrefGetBlackPointCompensation`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPrefGetBlackPointCompensation) #### PDPrefSetColorCal ```cpp ASBool PDPrefSetColorCal(PDColorCalP colorCal) ``` Header: `PDProcs.h:5362` Sets the values to use for displaying the calibrated color and grayscale. These values are the chromaticities and gammas of the phosphors in the monitor. These values do not necessarily correspond to the monitor being used; it is the responsibility of the client that sets these values to provide the correct values. These values are used for rendering if calibrated color is enabled by the preferences file item avpDoCalibratedColor (see AVAppSetPreference()). **Parameters** - `colorCal` (`PDColorCalP`): A pointer to a structure that contains the color calibration information. For RGB devices, the red, green, and blue chromaticities and gammas are used; for grayscale, `whiteChrom` and `greenGamma` are used. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the values were successfully set and installed for the currently active display device, `false` otherwise. **See also:** [`PDPrefGetColorCal`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPrefGetColorCal), `AVAppSetPreference` #### PDPrefSetDefaultBlendingColorSpace ```cpp void PDPrefSetDefaultBlendingColorSpace(ASInt32 dBCSIndex) ``` Header: `PDProcs.h:12790` Sets the default blending color space to working CMYK or working RGB **Parameters** - `dBCSIndex` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): An index to set blending color space. Pass 1 to set bcs as working RGB. Pass 0 or other value to set bcs as working CMYK. **Returns:** `void` #### PDPrefSetInstallPatternParentGState ```cpp void PDPrefSetInstallPatternParentGState(ASBool bInstallPatternParentGStateFlag) ``` Header: `PDProcs.h:12821` Sets the preference to install the graphics state that was in effect at the beginning of the pattern's parent content stream **Parameters** - `bInstallPatternParentGStateFlag` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): Pass 1 to install GState was in effect at the beginning of the pattern's parent content stream **Returns:** `void` #### PDPrefSetUseOutputIntents ```cpp void PDPrefSetUseOutputIntents(ASBool flag) ``` Header: `PDProcs.h:11854` Sets the Output Intent flag. **Parameters** - `flag` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): When `true`, use Output Intent to override a working space if it is present. **Returns:** `void` **See also:** [`PDPrefGetUseOutputIntents`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPrefGetUseOutputIntents) #### PDPrefSetWorkingCMYK ```cpp void PDPrefSetWorkingCMYK(void *profile, ASUns32 profileLength) ``` Header: `PDProcs.h:11908` Sets the current CMYK working space to a given ICC profile. A CMYK working space in PDF is defined as a profile to substitute for a corresponding `/DeviceCMYK` space. **Parameters** - `profile` (`void *`): A pointer to a buffer containing the ICC color profile. - `profileLength` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The length in bytes of the profile. **Returns:** `void` **See also:** [`PDPrefSetWorkingGray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPrefSetWorkingGray), [`PDPrefSetWorkingRGB`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPrefSetWorkingRGB) #### PDPrefSetWorkingGray ```cpp void PDPrefSetWorkingGray(void *profile, ASUns32 profileLength) ``` Header: `PDProcs.h:11922` Sets the current gray working space to a given ICC profile. A Gray working space in PDF is defined as a profile to substitute for a corresponding `/DeviceGray` space. When rendering with overprint preview, the gray substitution is suppressed, to avoid converting grayscale to *rich black*. **Parameters** - `profile` (`void *`): A pointer to a buffer containing the ICC color profile. - `profileLength` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The length in bytes of the profile. **Returns:** `void` **See also:** [`PDPrefSetWorkingCMYK`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPrefSetWorkingCMYK), [`PDPrefSetWorkingRGB`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPrefSetWorkingRGB) #### PDPrefSetWorkingRGB ```cpp void PDPrefSetWorkingRGB(void *profile, ASUns32 profileLength) ``` Header: `PDProcs.h:11896` Set the current RGB working space to a given ICC profile. An RGB working space in PDF is defined as a profile to substitute for a corresponding `/DeviceRGB` space. **Parameters** - `profile` (`void *`): A pointer to a buffer containing the ICC color profile. - `profileLength` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The length in bytes of the profile. **Returns:** `void` **See also:** [`PDPrefSetWorkingCMYK`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPrefSetWorkingCMYK), [`PDPrefSetWorkingGray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPrefSetWorkingGray) ## PDRedaction ### Functions (2) #### PDRedactionGetProps ```cpp ASBool PDRedactionGetProps(PDAnnot redactionAnnot, PDRedactParams redactionProps) ``` Header: `PDProcs.h:11964` Retrieves a set of properties for a given redaction mark. **Parameters** - `redactionAnnot` ([`PDAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnot)): IN The redaction mark whose properties are to be returned. - `redactionProps` (`PDRedactParams`): OUT The set of properties to be filled by this method. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the properties were successfully returned, `false` otherwise. **Exceptions** - `pdErrBadAnnotation` **See also:** [`PDDocApplyRedactions`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocApplyRedactions), [`PDDocCreateRedaction`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateRedaction), [`PDRedactionSetProps`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRedactionSetProps) #### PDRedactionSetProps ```cpp ASBool PDRedactionSetProps(PDAnnot redactionAnnot, PDRedactParams redactionProps) ``` Header: `PDProcs.h:11976` Assigns a set of properties to a given redaction mark. **Parameters** - `redactionAnnot` ([`PDAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnot)): IN/OUT The redaction mark whose properties are to be assigned. - `redactionProps` (`PDRedactParams`): IN The set of properties to be assigned by this method. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the properties were successfully assigned, `false` otherwise. **Exceptions** - `pdErrBadAnnotation` **See also:** [`PDDocApplyRedactions`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocApplyRedactions), [`PDDocCreateRedaction`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateRedaction), [`PDRedactionGetProps`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDRedactionGetProps) ## PDStyle ### Functions (3) #### PDStyleGetColor ```cpp void PDStyleGetColor(PDStyle obj, PDColorValue color) ``` Header: `PDProcs.h:5194` Gets a style's color. **Parameters** - `obj` ([`PDStyle`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDStyle)): IN/OUT The style whose color is obtained. - `color` (`PDColorValue`): IN/OUT (Filled by the method) A pointer to a structure that contains the style's color. **Returns:** `void` **See also:** [`PDStyleGetFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDStyleGetFont), [`PDStyleGetFontSize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDStyleGetFontSize) #### PDStyleGetFont ```cpp PDFont PDStyleGetFont(PDStyle obj) ``` Header: `PDProcs.h:5172` Gets the specified style's font. **Parameters** - `obj` ([`PDStyle`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDStyle)): IN/OUT The style whose font is obtained. **Returns:** [`PDFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFont) The font for the specified style. **See also:** [`PDStyleGetColor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDStyleGetColor), [`PDStyleGetFontSize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDStyleGetFontSize) #### PDStyleGetFontSize ```cpp ASFixed PDStyleGetFontSize(PDStyle obj) ``` Header: `PDProcs.h:5182` Get a style's font size. **Parameters** - `obj` ([`PDStyle`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDStyle)): The style whose font size is obtained. **Returns:** [`ASFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixed) The size of the font in points. **See also:** [`PDStyleGetColor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDStyleGetColor), [`PDStyleGetFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDStyleGetFont) ### Structures (1) #### PDStyle ```cpp typedef struct _t_PDStyle* PDStyle ``` Header: `PDExpT.h:3398` Provides access to information about the fonts, font sizes, and colors used in a PDWord. **See also:** [`PDWordGetNthCharStyle`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordGetNthCharStyle) ## PDText ### Functions (2) #### PDTextEnum ```cpp void PDTextEnum(PDText text, PDStringEnumProc enumProc, void *clientData) ``` Header: `PDProcs.h:3676` Enumerates the strings of a text object, calling a procedure for each string. The PDText object may be obtained from the PDGraphicEnumTextProc() callback of PDGraphicEnumMonitor. **Parameters** - `text` ([`PDText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDText)): IN/OUT The text object whose strings are enumerated. - `enumProc` ([`PDStringEnumProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDStringEnumProc)): IN/OUT A user-supplied callback to call for each text string in the text object. Enumeration ends if `enumProc` returns `false`. - `clientData` (`void *`): IN/OUT A pointer to user-supplied data to pass to `enumProc` each time it is called. **Returns:** `void` #### PDTextGetState ```cpp void PDTextGetState(PDText obj, PDTextStateP stateP, ASInt32 stateLen) ``` Header: `PDProcs.h:3690` Gets the text state for a text object. See Section 5.2 in the *PDF Reference* for a discussion of the text state parameters. **Parameters** - `obj` ([`PDText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDText)): IN/OUT The text object whose text state is obtained. - `stateP` (`PDTextStateP`): IN/OUT (Filled by the method) A pointer to a `PDTextState` structure containing the text state information. - `stateLen` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN/OUT It must be `sizeof(PDTextState)`. **Returns:** `void` ### Typedefs (1) #### PDStringEnumProc ```cpp typedef ASBool(*) PDStringEnumProc(PDFont font, char *string, ASInt32 stringLen, ASFixed delta, void *clientData)(PDFont font, char *string, ASInt32 stringLen, ASFixed delta, void *clientData) ``` Header: `PDExpT.h:3079` A callback for PDTextEnum(). It is called once for each string in a text object. You can find this document on the web store of the International Standards Organization (ISO). **See also:** [`PDTextEnum`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextEnum) ### Structures (1) #### PDText ```cpp typedef struct _t_PDGraphic * PDText ``` Header: `PDExpT.h:2499` ## PDTextAnnot ### Functions (6) #### PDTextAnnotGetContents ```cpp ASInt32 PDTextAnnotGetContents(PDTextAnnot aTextAnnot, char *buffer, ASInt32 bufSize) ``` Header: `PDProcs.h:588` Gets the text of a text annotation. @note This text is stored in either PDFDocEncoding or in Unicode. If it is stored in Unicode, a valid Byte Order Mark must be present. **Parameters** - `aTextAnnot` ([`PDTextAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextAnnot)): The text annotation whose text is obtained. - `buffer` (`char *`): (Filled by the method) A buffer into which the text is placed. If the text is encoded using `PDFDocEncoding`, it can be converted to a platform's native encoding using PDXlateToHost() or PDXlateToHostEx().`buffer` can hold.`buffer`. - `bufSize` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)) **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) **See also:** [`PDTextAnnotSetContents`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextAnnotSetContents), [`PDXlateToPDFDocEnc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXlateToPDFDocEnc), [`PDXlateToPDFDocEncEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXlateToPDFDocEncEx) #### PDTextAnnotGetContentsASText ```cpp void PDTextAnnotGetContentsASText(PDTextAnnot aTextAnnot, ASText contents) ``` Header: `PDProcs.h:11479` Gets the text of a text annotation as an ASText object. **Parameters** - `aTextAnnot` ([`PDTextAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextAnnot)): The text annotation whose text is obtained. - `contents` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): (Filled by the method) The text object containing the contents. The client must pass a valid ASText object title. The routine does not allocate it. **Returns:** `void` **See also:** [`PDTextAnnotGetContents`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextAnnotGetContents), [`PDTextAnnotSetContentsASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextAnnotSetContentsASText), [`PDTextAnnotSetContents`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextAnnotSetContents) #### PDTextAnnotIsOpen ```cpp ASBool PDTextAnnotIsOpen(PDTextAnnot aTextAnnot) ``` Header: `PDProcs.h:630` Tests whether a text annotation is open. **Note:** This method cannot always correctly determine a text annotation's open state. For the current version of Acrobat, text and other annotations have an associated Popup annotation which maintains the open state of the popup window; the method works correctly when you pass it the popup annotation itself. You can use Cos-level routines to find the Popup entry in the annotation dictionary, which is itself a dictionary containing an Open entry. **Parameters** - `aTextAnnot` ([`PDTextAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextAnnot)): The text annotation whose open/closed state is obtained. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the annotation is open, `false` otherwise. **See also:** [`PDTextAnnotSetOpen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextAnnotSetOpen) #### PDTextAnnotSetContents ```cpp void PDTextAnnotSetContents(PDTextAnnot aTextAnnot, const char *str, ASInt32 nBytes) ``` Header: `PDProcs.h:610` Sets the text of a text annotation. This method also sets the modification date of the annotation to the current date and time. @note The text must be encoded using `PDFDocEncoding` or Unicode. @notify PDAnnotWillChange @notify PDAnnotDidChange @since **Parameters** - `aTextAnnot` ([`PDTextAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextAnnot)): The text annotation whose text is set. - `str` (`const char *`): A string containing the new text. The string must be encoded using `PDFDocEncoding` or Unicode. The strings in a platform's native encoding can be converted to `PDFDocEncoding` using PDXlateToPDFDocEnc() or PDXlateToPDFDocEncEx().`str`. - `nBytes` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)) **Returns:** `void` **See also:** [`PDTextAnnotGetContents`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextAnnotGetContents), [`PDXlateToPDFDocEnc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXlateToPDFDocEnc), [`PDXlateToPDFDocEncEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXlateToPDFDocEncEx) #### PDTextAnnotSetContentsASText ```cpp void PDTextAnnotSetContentsASText(PDTextAnnot aTextAnnot, const ASText contents) ``` Header: `PDProcs.h:11494` Sets the text of a text annotation. @notify PDAnnotWillChange @notify PDAnnotDidChange **Parameters** - `aTextAnnot` ([`PDTextAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextAnnot)): The text annotation whose text is set. - `contents` ([`const ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): The text object containing the new text. **Returns:** `void` **See also:** [`PDTextAnnotSetContents`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextAnnotSetContents), [`PDTextAnnotGetContentsASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextAnnotGetContentsASText), [`PDTextAnnotGetContents`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextAnnotGetContents) #### PDTextAnnotSetOpen ```cpp void PDTextAnnotSetOpen(PDTextAnnot aTextAnnot, ASBool isOpen) ``` Header: `PDProcs.h:651` Opens or closes a text annotation. **Note:** This method cannot always correctly set a text annotation's open state. For the current version of Acrobat, text and other annotations have an associated Popup annotation which maintains the open state of the popup window; the method works correctly when you pass it the popup annotation itself. You can use Cos-level routines to find the Popup entry in the annotation dictionary, which is itself a dictionary containing an Open entry. **Parameters** - `aTextAnnot` ([`PDTextAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextAnnot)): The annotation to open or close. - `isOpen` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): `true` if the annotation is opened, `false` if the annotation is closed. @notify PDAnnotWillChange @notify PDAnnotDidChange **Returns:** `void` **See also:** [`PDTextAnnotIsOpen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextAnnotIsOpen) ### Typedefs (1) #### PDTextAnnot ```cpp typedef OPAQUE_64_BITS PDTextAnnot ``` Header: `PDExpT.h:345` A PDF text annotation on a page in a PDF file. You can use any PDAnnot method on a PDTextAnnot. Applications can: Get and set attributes including the rectangle, textual contents, and whether the annotation is open. Create new text annotations, and delete or move existing ones using PDAnnot methods. Manipulate the behavior of text annotations by modifying the Text Annotation Handler. To obtain a PDF text annotation, use any of the PDAnnot calls, followed by CastToPDTextAnnot(). The annotation passed to CastToPDTextAnnot() must be a text annotation; it will not convert other annotation types into text annotations. **See also:** [`CastToPDTextAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#CastToPDTextAnnot), [`PDPageRemoveAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageRemoveAnnot) ### Definitions (1) #### CastToPDTextAnnot Header: `PDExpT.h:440` Value: `*(PDTextAnnot *)&(a)` Casts a link annotation or a generic annotation to a text annotation. **See also:** [`CastToPDAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#CastToPDAnnot), [`CastToPDLinkAnnot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#CastToPDLinkAnnot) ## PDTextSelect ### Functions (14) #### PDTextSelectCreatePageHilite ```cpp PDTextSelect PDTextSelectCreatePageHilite(PDPage page, HiliteEntry *hList, ASInt32 listLen) ``` Header: `PDProcs.h:4616` Creates a text selection from a page and a list of highlights specified as character offsets from the start of the page. Character offsets are a well-defined quantity in the PDF file, and are therefore stable against revisions of the word-finding algorithm, which makes them a good way to isolate yourself from changes in the algorithm. This method does not highlight the text selection. That occurs when you pass the PDTextSelect returned by this method to AVDocSetSelection(). **Note:** As is the case with the Acrobat viewer, the text selection is always of whole words, not part of words. **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page on which the highlights appear. - `hList` (`HiliteEntry *`): A pointer to an array of highlight entries. If the `length` field of a `HiliteEntry` is `0`, the entire word is highlighted. `hList` should not contain multiple instances of the same highlight; the display appearance is undefined when it does. - `listLen` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The number of highlight entries in `hList`. **Returns:** [`PDTextSelect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelect) The newly created text selection. **See also:** `AVDocSetSelection`, [`PDTextSelectCreateWordHilite`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreateWordHilite), [`PDTextSelectCreateWordHiliteEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreateWordHiliteEx), [`PDTextSelectCreateRanges`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreateRanges), [`PDTextSelectCreateRangesEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreateRangesEx), [`PDTextSelectCreatePageHiliteEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreatePageHiliteEx), [`PDDocCreateTextSelect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateTextSelect), [`PDTextSelectDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectDestroy) #### PDTextSelectCreatePageHiliteEx ```cpp PDTextSelect PDTextSelectCreatePageHiliteEx(PDPage page, HiliteEntry *hList, ASInt32 listLen, ASInt16 WFVersion) ``` Header: `PDProcs.h:8194` Adds the `WFVersion` parameter to PDTextSelectCreatePageHilite(). It is the same as PDTextSelectCreatePageHilite(), but it creates a WordFinder using the specified version number. It is intended to be used by plug-ins that want to do text highlighting with previous versions of the word finder algorithm. Annotation Use WF_LATEST_VERSION To obtain the latest available version. WF_VERSION_2 Version used for Acrobat 3.x, 4.x. WF_VERSION_3 Available in Acrobat 5.0 without Accessibility enabled. Includes some improved word-piecing algorithms. WF_VERSION_4 For Acrobat 5.0 with Accessibility enabled. Includes advanced word-ordering algorithms in addition to improved word-piecing algorithms. **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page on which the highlights appear. - `hList` (`HiliteEntry *`): A pointer to an array of highlight entries. If the `length` field of a `HiliteEntry` is `0`, the entire word is highlighted. `hList` should not contain multiple instances of the same highlight; the display appearance is undefined when it does. - `listLen` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The number of highlight entries in `hList`. - `WFVersion` ([`ASInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16)): The WordFinder version: **Returns:** [`PDTextSelect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelect) The newly created text selection. **See also:** `AVDocSetSelection`, [`PDTextSelectCreateWordHilite`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreateWordHilite), [`PDTextSelectCreateWordHiliteEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreateWordHiliteEx), [`PDTextSelectCreatePageHilite`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreatePageHilite), [`PDTextSelectCreateRanges`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreateRanges), [`PDTextSelectCreateRangesEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreateRangesEx), [`PDDocCreateTextSelect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateTextSelect), [`PDTextSelectDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectDestroy) #### PDTextSelectCreateRanges ```cpp PDTextSelect PDTextSelectCreateRanges(PDPage page, PDTextSelectRange range, ASInt32 rangeCount) ``` Header: `PDProcs.h:4703` Creates a text selection from one or more ranges. This method does not highlight the text selection. That occurs when you pass the PDTextSelect returned by this method to AVDocSetSelection(). **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): IN/OUT The page on which the text appears. - `range` (`PDTextSelectRange`): IN/OUT A pointer to an array of ranges that are used to create a text selection. Each array element is a PDTextSelectRange structure. - `rangeCount` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN/OUT The number of ranges in range. **Returns:** [`PDTextSelect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelect) A text selection created from the specified ranges. **See also:** `AVDocSetSelection`, [`PDTextSelectCreateRangesEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreateRangesEx), [`PDTextSelectCreatePageHilite`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreatePageHilite), [`PDTextSelectCreatePageHiliteEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreatePageHiliteEx), [`PDTextSelectCreateWordHilite`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreateWordHilite), [`PDTextSelectCreateWordHiliteEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreateWordHiliteEx), [`PDTextSelectDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectDestroy) #### PDTextSelectCreateRangesEx ```cpp PDTextSelect PDTextSelectCreateRangesEx(PDPage page, PDTextSelectRange range, ASInt32 rangeCount, ASInt16 WFVersion) ``` Header: `PDProcs.h:8261` Adds the `WFVersion` parameter to PDTextSelectCreateRanges(). It is the same as PDTextSelectCreateRanges() but it creates a WordFinder using the specified version number. It is intended to be used by plug-ins that want to do text highlighting with previous versions of the word finder algorithm. Annotation Use WF_LATEST_VERSION To obtain latest the available version. WF_VERSION_2 Version used for Acrobat 3.x, 4.x. WF_VERSION_3 Available in Acrobat 5.0 without Accessibility enabled. Includes some improved word-piecing algorithms. WF_VERSION_4 For Acrobat 5.0 with Accessibility enabled. Includes advanced word-ordering algorithms in addition to improved word-piecing algorithms. **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): IN/OUT The page on which the text appears. - `range` (`PDTextSelectRange`): IN/OUT A pointer to an array of ranges that are used to create a text selection. Each array element is a PDTextSelectRange structure. - `rangeCount` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN/OUT The number of ranges in range. - `WFVersion` ([`ASInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16)): IN/OUT The WordFinder version: **Returns:** [`PDTextSelect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelect) A text selection created from the specified ranges. **See also:** `AVDocSetSelection`, [`PDTextSelectCreatePageHilite`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreatePageHilite), [`PDTextSelectCreatePageHiliteEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreatePageHiliteEx), [`PDTextSelectCreateRanges`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreateRanges), [`PDTextSelectCreateWordHilite`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreateWordHilite), [`PDTextSelectCreateWordHiliteEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreateWordHiliteEx), [`PDTextSelectDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectDestroy) #### PDTextSelectCreateWordHilite ```cpp PDTextSelect PDTextSelectCreateWordHilite(PDPage page, HiliteEntry *hList, ASInt32 listLen) ``` Header: `PDProcs.h:4647` Creates a text selection from a list of highlights specified as word offsets from the start of the page. Word offsets are not well-defined in PDF files, but are calculated by the word-finding algorithm. As a result, word offsets will, in general, differ in different versions of the word-finding algorithm. If you choose to store word offsets, you must also store the version of the word-finding algorithm from which they are obtained using PDWordFinderGetLatestAlgVersion(). This method does not highlight the text selection. That occurs when you pass the PDTextSelect returned by this method to AVDocSetSelection(). **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page on which the highlights appear. - `hList` (`HiliteEntry *`): A pointer to an array of highlight entries. `hList` should not contain multiple instances of the same highlight; the display appearance is undefined when it does. - `listLen` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The number of highlight entries in `hList`. **Returns:** [`PDTextSelect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelect) The newly created text selection. **See also:** `AVDocSetSelection`, [`PDTextSelectCreateRanges`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreateRanges), [`PDTextSelectCreateRangesEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreateRangesEx), [`PDTextSelectCreatePageHilite`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreatePageHilite), [`PDTextSelectCreatePageHiliteEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreatePageHiliteEx), [`PDTextSelectCreateWordHiliteEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreateWordHiliteEx), [`PDWordFinderGetLatestAlgVersion`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinderGetLatestAlgVersion), [`PDTextSelectDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectDestroy) #### PDTextSelectCreateWordHiliteEx ```cpp PDTextSelect PDTextSelectCreateWordHiliteEx(PDPage page, HiliteEntry *hList, ASInt32 listLen, ASInt16 WFVersion) ``` Header: `PDProcs.h:8226` Adds the `WFVersion` parameter to PDTextSelectCreateWordHilite(). Annotation Use WF_LATEST_VERSION To obtain the latest available version. WF_VERSION_2 Version used for Acrobat 3.x, 4.x. WF_VERSION_3 Available in Acrobat 5.0 without Accessibility enabled. Includes some improved word-piecing algorithms. WF_VERSION_4 For Acrobat 5.0 with Accessibility enabled. Includes advanced word-ordering algorithms in addition to improved word-piecing algorithms. **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page on which the highlights appear. - `hList` (`HiliteEntry *`): A pointer to an array of highlight entries. `hList` should not contain multiple instances of the same highlight; the display appearance is undefined when it does. - `listLen` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The number of highlight entries in `hList`. - `WFVersion` ([`ASInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16)): The WordFinder version: **Returns:** [`PDTextSelect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelect) The newly created text selection. **See also:** `AVDocSetSelection`, [`PDTextSelectCreateRanges`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreateRanges), [`PDTextSelectCreateRangesEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreateRangesEx), [`PDTextSelectCreatePageHilite`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreatePageHilite), [`PDTextSelectCreatePageHiliteEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreatePageHiliteEx), [`PDTextSelectCreateWordHilite`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreateWordHilite), [`PDWordFinderGetLatestAlgVersion`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinderGetLatestAlgVersion), [`PDTextSelectDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectDestroy) #### PDTextSelectDestroy ```cpp void PDTextSelectDestroy(PDTextSelect text) ``` Header: `PDProcs.h:4506` Deletes a text selection object (the text on the page remains unchanged). Do not use this method to destroy a text selection that was passed to AVDocSetSelection(); such text selections are automatically destroyed when a new selection is made or the selection is cleared. **Parameters** - `text` ([`PDTextSelect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelect)): IN/OUT The text selection to destroy. **Returns:** `void` **See also:** [`PDDocCreateTextSelect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateTextSelect), [`PDTextSelectCreatePageHilite`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreatePageHilite), [`PDTextSelectCreateRanges`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreateRanges), [`PDTextSelectCreateWordHilite`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreateWordHilite) #### PDTextSelectEnumQuads ```cpp void PDTextSelectEnumQuads(PDTextSelect text, PDTextSelectEnumQuadProc proc, void *procObj) ``` Header: `PDProcs.h:4526` Enumerates the bounding quads in a text selection. `proc` is called for each quad. If a word is on a curve it may have a quad for each character, but it may also have two characters per quad. An upright word will have only one quad for all the characters. An upright hyphenated word will have two quads. **Parameters** - `text` ([`PDTextSelect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelect)): IN/OUT The text selection whose bounding quads are enumerated. - `proc` ([`PDTextSelectEnumQuadProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectEnumQuadProc)): IN/OUT A user-supplied callback to call for each quad. Enumeration halts if `proc` returns `false`. - `procObj` (`void *`): IN/OUT A user-supplied data to pass to `proc` each time it is called. **Returns:** `void` **Exceptions** - `genErrBadParm` **See also:** [`PDDocCreateTextSelect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateTextSelect) #### PDTextSelectEnumText ```cpp void PDTextSelectEnumText(PDTextSelect text, PDTextSelectEnumTextProc proc, void *procObj) ``` Header: `PDProcs.h:4552` Enumerates the strings of the specified text select object, calling a procedure for each string. A string, in this context, is the set of like-styled characters within a word. It is never larger than a single word. A word containing three styles is enumerated as three strings. There is no guaranteed correspondence between these strings and the actual show strings in the PDF file. Acrobat enumerates text in the order it appears in the PDF file, which is often not the same as the order in which a person would read the text. **Parameters** - `text` ([`PDTextSelect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelect)): IN/OUT The text selection whose strings are enumerated. - `proc` ([`PDTextSelectEnumTextProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectEnumTextProc)): IN/OUT A user-supplied callback to call for each string in the text object. Enumeration ends if `proc` returns `false`. - `procObj` (`void *`): IN/OUT User-supplied data to pass to `proc` each time it is called. **Returns:** `void` **Exceptions** - `genErrBadParm` - `pdErrOpNotPermitted` **See also:** [`PDDocCreateTextSelect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateTextSelect) #### PDTextSelectEnumTextUCS ```cpp void PDTextSelectEnumTextUCS(PDTextSelect textP, PDTextSelectEnumTextProc proc, void *procData) ``` Header: `PDProcs.h:7998` Same as PDTextSelectEnumText(), except the output is forced to UCS. **Parameters** - `textP` ([`PDTextSelect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelect)): IN/OUT The text selection whose strings are enumerated. - `proc` ([`PDTextSelectEnumTextProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectEnumTextProc)): IN/OUT A user-supplied callback to call for each string in the text object. Enumeration ends if `proc` returns `false`. - `procData` (`void *`): IN/OUT User-supplied data to pass to `proc` each time it is called. **Returns:** `void` **Exceptions** - `genErrBadParm` **See also:** [`PDDocCreateTextSelect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateTextSelect), [`PDTextSelectEnumText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectEnumText) #### PDTextSelectGetBoundingRect ```cpp void PDTextSelectGetBoundingRect(PDTextSelect text, ASFixedRect *boundRectP) ``` Header: `PDProcs.h:4582` Gets a text selection's bounding rectangle. This is the smallest rectangle that completely encloses all characters in the selection. **Parameters** - `text` ([`PDTextSelect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelect)): IN/OUT The text selection whose bounding rectangle is determined. - `boundRectP` (`ASFixedRect *`): IN/OUT (Filled by the method) A pointer to the text selection's bounding rectangle, specified in user space coordinates. **Returns:** `void` **See also:** [`PDTextSelectGetPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectGetPage), [`PDTextSelectGetRange`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectGetRange), [`PDTextSelectGetRangeCount`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectGetRangeCount) #### PDTextSelectGetPage ```cpp ASInt32 PDTextSelectGetPage(PDTextSelect text) ``` Header: `PDProcs.h:4565` Gets the page number of a text selection's page. **Parameters** - `text` ([`PDTextSelect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelect)): IN/OUT The text selection whose page number is obtained. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The page number of the text selection's page. **See also:** [`PDTextSelectGetBoundingRect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectGetBoundingRect), [`PDTextSelectGetRange`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectGetRange), [`PDTextSelectGetRangeCount`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectGetRangeCount) #### PDTextSelectGetRange ```cpp void PDTextSelectGetRange(PDTextSelect textP, ASInt32 index, PDTextSelectRange range) ``` Header: `PDProcs.h:4665` Extracts the range specified by index from a text selection. Use PDTextSelectGetRangeCount() to determine the number of ranges in a text selection. **Parameters** - `textP` ([`PDTextSelect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelect)): IN/OUT The text selection from which a range is extracted. - `index` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN/OUT The index of the range to extract from `textP`. - `range` (`PDTextSelectRange`): IN/OUT (Filled by the method) A pointer to a structure that contains the specified range. **Returns:** `void` **See also:** [`PDTextSelectGetBoundingRect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectGetBoundingRect), [`PDTextSelectGetPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectGetPage), [`PDTextSelectGetRangeCount`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectGetRangeCount) #### PDTextSelectGetRangeCount ```cpp ASInt32 PDTextSelectGetRangeCount(PDTextSelect textP) ``` Header: `PDProcs.h:4679` Gets the number of ranges in a text selection. Use PDTextSelectGetRange() to extract a single range from a text selection. **Parameters** - `textP` ([`PDTextSelect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelect)): IN/OUT The text selection whose range count is obtained. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The number of ranges in the text selection. **See also:** [`PDTextSelectGetBoundingRect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectGetBoundingRect), [`PDTextSelectGetPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectGetPage), [`PDTextSelectGetRange`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectGetRange) ### Typedefs (3) #### PDTextSelectEnumQuadProc ```cpp typedef ASBool(*) PDTextSelectEnumQuadProc(void *procObj, ASInt32 page, ASFixedQuad *quad)(void *procObj, ASInt32 page, ASFixedQuad *quad) ``` Header: `PDExpT.h:3184` A callback for PDTextSelectEnumQuads(). It is called once for each quad in a text selection. **See also:** [`PDTextSelectEnumQuads`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectEnumQuads) #### PDTextSelectEnumRTFTextProc ```cpp typedef ASBool(*) PDTextSelectEnumRTFTextProc(void *procObj, PDFont font, ASFixed size, PDColorValue color, char *text, ASUns32 rtfCntFlag, ASInt32 textLen)(void *procObj, PDFont font, ASFixed size, PDColorValue color, char *text, ASUns32 rtfCntFlag, ASInt32 textLen) ``` Header: `PDExpT.h:3209` #### PDTextSelectEnumTextProc ```cpp typedef ASBool(*) PDTextSelectEnumTextProc(void *procObj, PDFont font, ASFixed size, PDColorValue color, char *text, ASInt32 textLen)(void *procObj, PDFont font, ASFixed size, PDColorValue color, char *text, ASInt32 textLen) ``` Header: `PDExpT.h:3204` A callback for PDTextSelectEnumText() and PDTextSelectEnumTextUCS(). It is called once for each text run (which is text in the same font, size, color, and on the same line) in a text selection. **See also:** [`PDTextSelectEnumText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectEnumText), [`PDTextSelectEnumTextUCS`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectEnumTextUCS) ### Structures (1) #### PDTextSelect ```cpp typedef struct _t_PDTextSelect* PDTextSelect ``` Header: `PDBasicExpT.h:131` A pointer to a PDTextSelect `struct`. ### Definitions (6) #### PDTextSelectCreatePageHilite Header: `PDCalls.h:161` Value: `PDTextSelectCreatePageHiliteHost` #### PDTextSelectCreateRanges Header: `PDCalls.h:163` Value: `PDTextSelectCreateRangesHost` #### PDTextSelectCreateWordHilite Header: `PDCalls.h:162` Value: `PDTextSelectCreateWordHiliteHost` #### PDTextSelectEnumQuads Header: `PDCalls.h:158` Value: `PDTextSelectEnumQuadsHost` #### PDTextSelectEnumText Header: `PDCalls.h:159` Value: `PDTextSelectEnumTextHost` #### PDTextSelectGetBoundingRect Header: `PDCalls.h:160` Value: `PDTextSelectGetBoundingRectHost` ## PDThread ### Functions (11) #### PDThreadDestroy ```cpp void PDThreadDestroy(PDThread thread) ``` Header: `PDProcs.h:4077` Deletes an article thread from its document. You must call PDDocRemoveThread() to remove the thread from the document (if it was added to one using PDDocAddThread()) before calling PDThreadDestroy(). **Parameters** - `thread` ([`PDThread`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThread)): IN/OUT The thread to destroy. **Returns:** `void` **See also:** [`PDThreadNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThreadNew), [`PDThreadFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThreadFromCosObj), [`PDDocRemoveThread`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocRemoveThread) #### PDThreadFromCosObj ```cpp PDThread PDThreadFromCosObj(CosObj obj) ``` Header: `PDProcs.h:4180` Gets the thread object corresponding to the specified Cos object. This method does not copy the object, but is instead the logical equivalent of a type cast. **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The dictionary Cos object for the thread. **Returns:** [`PDThread`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThread) The PDThread object for the thread. **Exceptions** - `pdErrBadThread`: is raised if the thread is not valid as defined by PDThreadIsValid. **See also:** [`PDThreadGetCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThreadGetCosObj) #### PDThreadGetCosObj ```cpp CosObj PDThreadGetCosObj(PDThread thread) ``` Header: `PDProcs.h:4167` Gets the Cos object corresponding to a thread. This method does not copy the object, but is instead the logical equivalent of a type cast. **Parameters** - `thread` ([`PDThread`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThread)): IN/OUT The thread whose Cos object is to obtained. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) The dictionary Cos object for the thread. The contents of the dictionary can be enumerated using CosObjEnum(). It returns a `NULL` Cos object if `PDThreadIsValid(thread)` returns `false`. **See also:** [`CosObjEnum`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjEnum), [`PDThreadFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThreadFromCosObj) #### PDThreadGetFirstBead ```cpp PDBead PDThreadGetFirstBead(PDThread thread) ``` Header: `PDProcs.h:4091` Gets an article thread's first bead. **Parameters** - `thread` ([`PDThread`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThread)): IN/OUT The thread whose first bead is obtained. **Returns:** [`PDBead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBead) The thread's first bead, or a `NULL` Cos object if the thread has no beads. **See also:** [`PDThreadSetFirstBead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThreadSetFirstBead), [`PDBeadGetNext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBeadGetNext), [`PDBeadGetPrev`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBeadGetPrev) #### PDThreadGetInfo ```cpp ASInt32 PDThreadGetInfo(PDThread thread, const char *infoKey, char *buffer, ASInt32 bufSize) ``` Header: `PDProcs.h:4123` Gets the specified article thread's info. @note This text is stored in either PDFDocEncoding or in Unicode. If it is stored in Unicode, a valid Byte Order Mark must be present. **Parameters** - `thread` ([`PDThread`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThread)): IN/OUT The thread whose thread info is obtained. - `infoKey` (`const char *`): IN/OUT The key whose value is obtained. - `buffer` (`char *`): IN/OUT (Filled by the method) The value associated with `infoKey`.`buffer` can hold.`buffer`. - `bufSize` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)) **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) **See also:** [`PDThreadSetInfo`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThreadSetInfo) #### PDThreadGetInfoASText ```cpp void PDThreadGetInfoASText(PDThread thread, const ASText infoKey, ASText value) ``` Header: `PDProcs.h:11685` Gets the specified article thread's info as an ASText object. **Parameters** - `thread` ([`PDThread`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThread)): The thread whose thread info is being obtained. - `infoKey` ([`const ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): The key whose value is being obtained. - `value` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): (Filled by the method) The text object containing the value associated with `infoKey` is set. The client must pass a valid ASText object value. The routine does not allocate it. **Returns:** `void` **See also:** [`PDThreadGetInfo`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThreadGetInfo), [`PDThreadSetInfoASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThreadSetInfoASText), [`PDThreadSetInfo`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThreadSetInfo) #### PDThreadIsValid ```cpp ASBool PDThreadIsValid(PDThread thread) ``` Header: `PDProcs.h:4150` Tests whether a thread is valid. This is intended only to ensure that the thread has not been deleted, not to ensure that all necessary information is present and valid. **Parameters** - `thread` ([`PDThread`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThread)): The thread whose validity is tested. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the thread is valid, `false` otherwise. #### PDThreadNew ```cpp PDThread PDThreadNew(PDDoc aDocP) ``` Header: `PDProcs.h:4063` Creates a new article thread. Use PDDocAddThread() to add the thread to a document. **Parameters** - `aDocP` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document in which the thread is created. **Returns:** [`PDThread`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThread) The newly created thread. **See also:** [`PDThreadDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThreadDestroy), [`PDThreadFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThreadFromCosObj), [`PDDocAddThread`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocAddThread) #### PDThreadSetFirstBead ```cpp void PDThreadSetFirstBead(PDThread thread, PDBead newFirstBead) ``` Header: `PDProcs.h:4103` Sets an article thread's first bead. **Parameters** - `thread` ([`PDThread`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThread)): IN/OUT The thread whose first bead is set. - `newFirstBead` ([`PDBead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBead)): IN/OUT The bead to use as the first in thread. **Returns:** `void` **See also:** [`PDThreadGetFirstBead`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThreadGetFirstBead), [`PDBeadInsert`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBeadInsert) #### PDThreadSetInfo ```cpp void PDThreadSetInfo(PDThread thread, const char *infoKey, const char *buffer, ASInt32 bufSize) ``` Header: `PDProcs.h:4140` Sets the specified article thread's info. @notify PDThreadDidChange @note This text is stored in either PDFDocEncoding or in Unicode. If it is stored in Unicode, a valid Byte Order Mark must be present. **Parameters** - `thread` ([`PDThread`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThread)): IN/OUT The thread whose thread info is set. - `infoKey` (`const char *`): IN/OUT The key whose value is set. - `buffer` (`const char *`): IN/OUT The value to set. - `bufSize` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN/OUT The number of characters in `buffer`. **Returns:** `void` **See also:** [`PDThreadGetInfo`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThreadGetInfo) #### PDThreadSetInfoASText ```cpp void PDThreadSetInfoASText(PDThread thread, const ASText infoKey, const ASText value) ``` Header: `PDProcs.h:11700` Sets the specified article thread's info. **Parameters** - `thread` ([`PDThread`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThread)): The thread whose thread info is being set. - `infoKey` ([`const ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): The key whose value is being set. - `value` ([`const ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): The text object containing the value to set. **Returns:** `void` **See also:** [`PDThreadSetInfo`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThreadSetInfo), [`PDThreadGetInfoASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThreadGetInfoASText), [`PDThreadGetInfo`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThreadGetInfo) ### Typedefs (1) #### PDThread ```cpp typedef OPAQUE_64_BITS PDThread ``` Header: `PDExpT.h:3230` An article in the Acrobat viewer's user interface. It contains an ordered sequence of rectangles that bound the article. Each rectangle is called a bead. Threads can be created either interactively, by the user, or programmatically. **See also:** [`PDDocGetThread`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetThread), [`PDThreadNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThreadNew), [`PDThreadFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThreadFromCosObj), [`PDBeadGetThread`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDBeadGetThread), [`PDDocRemoveThread`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocRemoveThread), [`PDThreadDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThreadDestroy) ## PDThumb ### Functions (2) #### PDThumbGetImageData ```cpp ASStm PDThumbGetImageData(PDThumb thumb, ASInt32 *height, ASInt32 *width, ASInt32 *bpc, ASAtom *csName) ``` Header: `PDProcs.h:11811` Gets an ASStm from a thumbnail data. **Parameters** - `thumb` ([`PDThumb`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThumb)): The thumb for which image data is to be retrieved. - `height` ([`ASInt32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): (Filled by the method) The height of the thumbnail. - `width` ([`ASInt32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): (Filled by the method) The width of the thumbnail. - `bpc` ([`ASInt32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): (Filled by the method) The number of bits per component in the thumbnail image's data. - `csName` ([`ASAtom *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): (Filled by the method) The color space in which thumnail data is represented. **Returns:** [`ASStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStm) An ASStm for the thumbnail data. **See also:** [`PDThumbGetIndexedColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThumbGetIndexedColorSpace), [`PDThumbCreationDrawThumbProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThumbCreationDrawThumbProc) #### PDThumbGetIndexedColorSpace ```cpp ASStm PDThumbGetIndexedColorSpace(PDThumb thumb, ASInt32 *hival, ASAtom *baseColorSpaceName) ``` Header: `PDProcs.h:11822` Gets an ASStm from a thumbnail's indexed color space table. **Parameters** - `thumb` ([`PDThumb`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThumb)): The thumb for which image data is to be retrieved. - `hival` ([`ASInt32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): (Filled by the method) The highest valid index in the lookup table for the Indexed color space. - `baseColorSpaceName` ([`ASAtom *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): (Filled by the method) The base color space in which the values in the color table are to be interpreted. **Returns:** [`ASStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStm) An ASStm from the thumbnail's indexed color space table. **See also:** [`PDThumbGetImageData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThumbGetImageData), [`PDThumbCreationDrawThumbProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThumbCreationDrawThumbProc) ### Typedefs (3) #### PDThumbCreationDrawThumbProc ```cpp typedef void(*) PDThumbCreationDrawThumbProc(PDThumb thumb, void *clientData)(PDThumb thumb, void *clientData) ``` Header: `PDExpT.h:3316` (Optional) A callback for PDThumbCreationServer. It is called after PDThumbCreationGetThumbDataProc() and after a PDThumb has been created. It gives the server a chance to draw the thumbnail image in a status window. It may be `NULL`. **See also:** [`PDThumbCreationGetThumbDataProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDThumbCreationGetThumbDataProc), [`PDDocCreateThumbs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateThumbs) #### PDThumbCreationGetThumbDataProc ```cpp typedef ASBool(*) PDThumbCreationGetThumbDataProc(PDPage page, ASFixed thumbScale, ASInt32 width, ASInt32 height, void *thumbData, void *clientData)(PDPage page, ASFixed thumbScale, ASInt32 width, ASInt32 height, void *thumbData, void *clientData) ``` Header: `PDExpT.h:3301` (Optional) A callback for PDThumbCreationServer. It is called for each page that does not currently contain a thumbnail image. It may be `NULL`. If it is `NULL`, the thumbnail data is generated by the default thumbnail generator. where `bitsPerPixel` is specified as `numComponents * bitsPerComponent`. `numComponents` is dependent upon the color space. For DeviceRGB, `numComponents` is `3`. For an indexed color space, `numComponents` is `1`. **See also:** [`PDDocCreateThumbs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateThumbs) #### PDThumbCreationNotifyPageProc ```cpp typedef ASBool(*) PDThumbCreationNotifyPageProc(ASInt32 pageNum, void *clientData)(ASInt32 pageNum, void *clientData) ``` Header: `PDExpT.h:3268` (Optional) A callback for PDThumbCreationServer. It is called before processing each page. It may be `NULL`. **See also:** [`PDDocCreateThumbs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateThumbs) ### Structures (2) #### PDThumb ```cpp typedef struct _t_PDThumb* PDThumb ``` Header: `PDBasicExpT.h:124` A thumbnail preview image of a page. **See also:** [`PDDocCreateThumbs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateThumbs), [`PDDocDeleteThumbs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocDeleteThumbs) #### PDThumbCreationServer ```cpp typedef struct _t_PDThumbCreationServer* PDThumbCreationServer ``` Header: `PDExpT.h:3318` ## PDTrans ### Functions (9) #### PDTransEqual ```cpp ASBool PDTransEqual(PDTrans pdtOne, PDTrans pdtTwo) ``` Header: `PDProcs.h:5814` Tests two transitions for equality. Two transitions are equal only if their Cos objects are equal (see CosObjEqual()). **Parameters** - `pdtOne` ([`PDTrans`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTrans)): A transition to test for equality. - `pdtTwo` ([`PDTrans`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTrans)): A transition to test for equality. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the transitions are equal, `false` otherwise. **See also:** [`CosObjEqual`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObjEqual) #### PDTransFromCosObj ```cpp PDTrans PDTransFromCosObj(CosObj coLayer) ``` Header: `PDProcs.h:5785` Converts the specified dictionary Cos object to a transition and verifies that the transition is valid. This method does not copy the object but is instead the logical equivalent of a type cast. **Parameters** - `coLayer` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The dictionary Cos object to convert to a transition. **Returns:** [`PDTrans`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTrans) The transition corresponding to the given dictionary object, `obj`. **Exceptions** - `pdErrBadBaseObj`: is raised if the transition is not valid as determined by PDTransIsValid(). **See also:** [`PDTransGetCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTransGetCosObj), [`PDTransIsValid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTransIsValid) #### PDTransGetCosObj ```cpp CosObj PDTransGetCosObj(PDTrans pdl) ``` Header: `PDProcs.h:5801` Gets the dictionary Cos object corresponding to the transition and verifies that the transition is valid. This method does not copy the object but is the logical equivalent of a type cast. **Parameters** - `pdl` ([`PDTrans`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTrans)): The transition whose Cos object is obtained. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) The dictionary Cos object corresponding to the transition. it returns the `NULL` Cos object if the transition is invalid as determined by PDTransIsValid(). **See also:** [`PDTransFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTransFromCosObj), [`PDTransIsValid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTransIsValid) #### PDTransGetDuration ```cpp ASFixed PDTransGetDuration(PDTrans pdt) ``` Header: `PDProcs.h:5959` Gets the duration for the given transition. **Note:** Standard durations are: Duration Meaning 0 seconds fast 1 second medium 2 seconds slow **Parameters** - `pdt` ([`PDTrans`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTrans)): IN/OUT The transition for which the duration is obtained. **Returns:** [`ASFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixed) The transition duration, specified in seconds. If no duration is specified in the transition, the return value is fxDefaultTransDuration (`1` second). **See also:** [`PDTransGetSubtype`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTransGetSubtype) #### PDTransGetSubtype ```cpp ASAtom PDTransGetSubtype(PDTrans pdt) ``` Header: `PDProcs.h:5936` Gets a transition's subtype. **Parameters** - `pdt` ([`PDTrans`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTrans)): IN/OUT The transition whose subtype is obtained. **Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom) The ASAtom for the transition's subtype. It can be converted to a string using ASAtomGetString(). **See also:** [`PDTransGetDuration`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTransGetDuration) #### PDTransIsValid ```cpp ASBool PDTransIsValid(PDTrans pdt) ``` Header: `PDProcs.h:5757` Tests whether a transition is valid, meaning that the transition has not been deleted. **Parameters** - `pdt` ([`PDTrans`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTrans)): The transition dictionary whose validity is tested. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the transition is valid, `false` otherwise. **See also:** [`PDTransEqual`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTransEqual) #### PDTransNew ```cpp PDTrans PDTransNew(PDDoc pdd, ASAtom asaSubtype, ASFixed fxDuration) ``` Header: `PDProcs.h:5925` Creates a new transition of the specified type and duration associated with the CosDoc of the given PDDoc. You can find this document on the web store of the International Standards Organization (ISO). All implementations that support transitions are required to support these transitions at a minimum. Plug-ins can register new types or provide a new handler for an existing type. **Parameters** - `pdd` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The PDDoc to whose CosDoc the transition is added. - `asaSubtype` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The transition subtype to create. It must be one of the transition effects described under "Presentations" in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 12.4.4, page 377. - `fxDuration` ([`ASFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixed)): The transition duration, in seconds. **Returns:** [`PDTrans`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTrans) The newly created transition. **Exceptions** - `pdErrBadBaseObj`: is raised if the transition is not valid as determined by PDTransIsValid(). **See also:** [`PDTransNewFromCosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTransNewFromCosDoc) #### PDTransNewFromCosDoc ```cpp PDTrans PDTransNewFromCosDoc(CosDoc cd, ASAtom asaSubtype, ASFixed fxDuration) ``` Header: `PDProcs.h:5900` Creates a new transition of the specified type and duration associated with the given CosDoc. **Parameters** - `cd` ([`CosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosDoc)): The CosDoc to which the transition is added. - `asaSubtype` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The transition subtype to create. This subtype is returned by the AVTransHandlerGetTypeProc() callback in AVTransHandler. - `fxDuration` ([`ASFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixed)): The transition duration, in seconds. **Returns:** [`PDTrans`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTrans) The newly created transition. **Exceptions** - `pdErrBadBaseObj`: is raised if the transition is not valid as determined by PDTransIsValid(). **See also:** [`PDTransNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTransNew) #### PDTransNull ```cpp PDTrans PDTransNull(void) ``` Header: `PDProcs.h:5768` Gets a `NULL` transition. This can be used in conjunction with PDTransEqual() to determine whether a transition is `NULL`. **Parameters** - (unnamed) (`void`) **Returns:** [`PDTrans`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTrans) A `NULL` transition. **See also:** [`PDTransNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTransNew) ### Typedefs (1) #### PDTrans ```cpp typedef OPAQUE_64_BITS PDTrans ``` Header: `PDExpT.h:4070` A transition to a page. The Trans key in a Page dictionary specifies a Transition dictionary, which describes the effect to use when going to a page and the amount of time the transition should take. **See also:** [`PDPageGetTransition`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageGetTransition), [`PDTransFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTransFromCosObj), [`PDTransNew`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTransNew), [`PDTransNewFromCosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTransNewFromCosDoc), [`PDTransNull`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTransNull) ### Definitions (2) #### fxDefaultPageDuration Header: `PDExpT.h:4072` Value: `-fixedOne` #### fxDefaultTransDuration Header: `PDExpT.h:4073` Value: `fixedOne` ## PDViewDest ### Functions (7) #### PDViewDestCreate ```cpp PDViewDestination PDViewDestCreate(PDDoc doc, PDPage initialPage, ASAtom initialFitType, const ASFixedRectP initialRect, const ASFixed initialZoom, ASInt32 pageNumber) ``` Header: `PDProcs.h:4407` Creates a new view destination object. For information about the Zoom Factor see page 365 of the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7. You can find this document on the web store of the International Standards Organization (ISO). **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document in which the destination is used. - `initialPage` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The destination page. - `initialFitType` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The destination fit type. It must be one of the View Destination Fit Types, which must be converted into an ASAtom with ASAtomFromString(). - `initialRect` (`const ASFixedRectP`): A pointer to an `ASFixedRect` specifying the destination rectangle, specified in user space coordinates. The appropriate information will be extracted from `initialRect`, depending on `initialFitType`, to create the destination. All four of the `initialRect` parameter's components should be set; using PDViewDestNULL for any components can result in incorrect results for rotated pages. - `initialZoom` ([`const ASFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixed)): The zoom factor to set for the destination. Used only if `initialFitType` is `XYZ`. Use the predefined value PDViewDestNULL (see `PDExpT.h`) to indicate a `NULL` zoom factor, described in Destinations in "Document-Level Navigation," in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 12.4.4, page 365. - `pageNumber` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): Currently unused. **Returns:** [`PDViewDestination`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDViewDestination) The newly created view destination. **See also:** [`PDViewDestFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDViewDestFromCosObj), `PDViewDestDestroy ViewDestinationFitTypes` #### PDViewDestDestroy ```cpp void PDViewDestDestroy(PDViewDestination dest) ``` Header: `PDProcs.h:4420` Deletes a view destination object. Before deleting a view destination, ensure that no link or bookmark refers to it. **Parameters** - `dest` ([`PDViewDestination`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDViewDestination)): IN/OUT The view destination to destroy. **Returns:** `void` **See also:** [`PDViewDestFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDViewDestFromCosObj), [`PDViewDestCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDViewDestCreate) #### PDViewDestFromCosObj ```cpp PDViewDestination PDViewDestFromCosObj(CosObj obj) ``` Header: `PDProcs.h:4490` Converts the specified Cos object to a view destination and verifies that the view destination is valid. This method does not copy the object, but is instead the logical equivalent of a type cast. **Parameters** - `obj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): IN/OUT The dictionary Cos object to convert to a view destination. **Returns:** [`PDViewDestination`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDViewDestination) An array Cos object for the view destination. **Exceptions** - `pdErrBadAction`: is raised if the destination is invalid, as determined by PDViewDestIsValid(). **See also:** [`PDViewDestGetCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDViewDestGetCosObj) #### PDViewDestGetAttr ```cpp void PDViewDestGetAttr(PDViewDestination dest, ASInt32 *pageNum, ASAtom *fitType, ASFixedRectP destRect, ASFixed *zoom) ``` Header: `PDProcs.h:4456` Gets a view destination's fit type, destination rectangle, and zoom factor. The destination must be represented by an array, which is the case for a GoToR action. **Parameters** - `dest` ([`PDViewDestination`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDViewDestination)): IN/OUT The view destination whose attributes are obtained. - `pageNum` ([`ASInt32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN/OUT (Filled by the method) The page number of the destination's page. - `fitType` ([`ASAtom *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): IN/OUT (Filled by the method) The destination fit type. One of the values listed in View Destination Fit Types. - `destRect` (`ASFixedRectP`): IN/OUT (Filled by the method) A pointer to a `ASFixedRect` containing the destination's rectangle, specified in user space coordinates. - `zoom` ([`ASFixed *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixed)): IN/OUT (Filled by the method) The destination's zoom factor. **Returns:** `void` **Exceptions** - `genErrBadParm`: is raised if the destination is not represented by an array. **See also:** `PDViewDestCreate ViewDestinationFitTypes` #### PDViewDestGetCosObj ```cpp CosObj PDViewDestGetCosObj(PDViewDestination dest) ``` Header: `PDProcs.h:4474` Gets the Cos object corresponding to a view destination and verifies that the view destination is valid. This method does not copy the object, but is instead the logical equivalent of a type cast. **Parameters** - `dest` ([`PDViewDestination`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDViewDestination)): IN/OUT The view destination whose Cos object is obtained. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) Array Cos object for the view destination. The contents of the array can be enumerated using CosObjEnum(). It returns a `NULL` Cos object if the view destination is invalid, as determined by PDViewDestIsValid(). **See also:** [`PDViewDestFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDViewDestFromCosObj), [`PDViewDestIsValid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDViewDestIsValid) #### PDViewDestIsValid ```cpp ASBool PDViewDestIsValid(PDViewDestination dest) ``` Header: `PDProcs.h:4432` Tests whether a view destination is valid. This is intended only to ensure that the view destination has not been deleted, not to ensure that all necessary information is present and valid. **Parameters** - `dest` ([`PDViewDestination`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDViewDestination)): The view destination whose validity is determined. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the view destination is valid, `false` otherwise. #### PDViewDestResolve ```cpp PDViewDestination PDViewDestResolve(PDViewDestination dest, PDDoc doc) ``` Header: `PDProcs.h:5744` Resolves a destination. `dest` is the value of the D key in an action. It can be a real destination (an array) or a name. If it is a name, look it up in the `doc` parameter's Dests dictionary. The value found there can be a real destination (an array) or a dictionary. If it is a dictionary, look up the D key in that dictionary. This method is useful for getting a PDViewDestination from an action, as provided by PDActionGetDest(), since this method may not return a PDViewDestination. This method can raise memory, I/O, and parsing exceptions. **Parameters** - `dest` ([`PDViewDestination`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDViewDestination)): IN/OUT The destination to resolve. - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The PDDoc that contains the destination. **Returns:** [`PDViewDestination`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDViewDestination) The resolved view destination. **See also:** [`PDActionGetDest`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionGetDest) ### Typedefs (1) #### PDViewDestination ```cpp typedef OPAQUE_64_BITS PDViewDestination ``` Header: `PDExpT.h:3360` A particular view of a page in a document. It contains a reference to a page, a rectangle on that page, and information specifying how to adjust the view to fit the window's size and shape. It corresponds to a PDF Dest array and can be considered a special form of a PDAction. **See also:** `AVPageViewToViewDest`, [`PDActionGetDest`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDActionGetDest), [`PDViewDestCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDViewDestCreate), [`PDViewDestFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDViewDestFromCosObj), [`PDViewDestResolve`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDViewDestResolve), [`PDViewDestDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDViewDestDestroy) ### Definitions (1) #### PDViewDestNULL Header: `PDExpT.h:3365` Value: `fixedNegativeInfinity` ## PDWord ### Functions (24) #### PDWordCreateTextSelect ```cpp PDTextSelect PDWordCreateTextSelect(PDPage page, PDWord *wList, ASUns32 wListLen) ``` Header: `PDProcs.h:8642` Creates a text selection object for a given page that includes all words in a word list, as returned from a `PDWordFinder` method. The text selection can then be set as the current selection using AVDocSetSelection(). **Note:** For consistent text selection behavior, avoid using other PDTextSelect creation methods which depend on the word finder versions and word offsets. These include PDTextSelectCreatePageHiliteEx(), PDTextSelectCreateRanges(), PDTextSelectCreateRangesEx(), PDTextSelectCreateWordHilite(), and PDTextSelectCreateWordHiliteEx(). **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page on which to select the words. - `wList` ([`PDWord *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWord)): The word list to be selected. - `wListLen` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The number of words in the word list. **Returns:** [`PDTextSelect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelect) The newly created text selection. **See also:** [`PDDocCreateTextSelect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateTextSelect), [`PDTextSelectDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectDestroy), `AVDocSetSelection`, [`PDTextSelectEnumQuads`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectEnumQuads), [`PDTextSelectEnumText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectEnumText) #### PDWordFilterString ```cpp ASBool PDWordFilterString(ASUns16 *infoArray, char *cNewWord, char *cOldWord) ``` Header: `PDProcs.h:5125` Removes leading and trailing spaces and leading and trailing punctuation (including soft hyphens) from the specified word. It does not remove wildcard characters (`'*'` and `'?'`) or any punctuation surrounded by alphanumeric characters within the word. The determination of which characters are alphanumeric, wildcard, punctuation, and so forth, is made by the values in `infoArray`. Although this method seems very similar to PDWordFilterWord(), the two methods treat letters and digits slightly differently. PDWordFilterWord() uses the encoding info array but also does a straight character code test for any characters that have not been mapped to anything. It does this to catch letters and digits from non-standard character sets, and is necessary to avoid removing words with non-standard character sets. PDWordFilterString(), on the other hand, was designed for known character sets such as WinAnsi and Mac Roman. For non-Roman character set viewers, this method currently supports only SHIFT-JIS encoding on a Japanese system. For descriptions of `WinAnsiEncoding` and `MacRomanEncoding`, 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). **Note:** In Acrobat 6.0, the method PDWordFinderEnumWordsStr() is preferred to this method, which remains for backward compatability. CharacterTypeCodes **Parameters** - `infoArray` ([`ASUns16 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASUns16)): An array specifying the type of each character in the font. Each entry in this table must be one of the Character Type Codes. If `infoArray` is set to `NULL`, a default table 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`. - `cNewWord` (`char *`): (Filled by the method) The filtered word. - `cOldWord` (`char *`): The unfiltered word. This value must be passed to the method. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the string required filtering, `false` if the filtered string is the same as the unfiltered string. **See also:** [`PDWordFilterWord`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFilterWord) #### PDWordFilterWord ```cpp ASBool PDWordFilterWord(PDWord word, char *buffer, ASInt16 bufferLen, ASInt16 *newLen) ``` Header: `PDProcs.h:5161` Removes leading and trailing spaces and leading and trailing punctuation (including soft hyphens) from the specified word. It does not remove wildcard characters (`'*'` and `'?'`) or any punctuation surrounded by alphanumeric characters within the word. It also converts ligatures to their constituent characters. The determination of which characters to remove is made by examining the flags in the `outEncInfo` array passed to PDDocCreateWordFinder(). As a result, this method is most useful after you have been called with words obtained by calling PDWordFinderGetNthWord(), in the callback for PDWordFinderEnumWords(), and words in the pXYSortTable returned by PDWordFinderAcquireWordList(). See the description of PDWordFilterString() for further information, and for a description of how the two methods differ. The Acrobat Catalog program uses this method to filter words before indexing them. This method works with non-Roman systems. **Note:** In Acrobat 6.0 and later, the method PDWordFinderEnumWords() is preferred to this method, which remains for backward compatability. **Parameters** - `word` ([`PDWord`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWord)): The PDWord to filter. - `buffer` (`char *`): (Filled by the method) The filtered string. - `bufferLen` ([`ASInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16)): The maximum number of characters that `buffer` can hold. - `newLen` ([`ASInt16 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16)): (Filled by the method) The number of characters actually written into `buffer`. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the word required filtering, `false` if the filtered string is the same as the unfiltered string. **See also:** [`PDWordFilterString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFilterString) #### PDWordGetASText ```cpp void PDWordGetASText(PDWord word, ASUns32 filter, ASText str) ``` Header: `PDProcs.h:8559` Copies the text from a word into an ASText object. It automatically performs the necessary encoding conversions from the specified word (either in Unicode or Host Encoding) to the ASText object. `PDWordGetASText(word, W_SOFT_HYPHEN + W_ACCENT, mystr);` **Parameters** - `word` ([`PDWord`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWord)): The word whose text becomes the new ASText. - `filter` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): Character types to be dropped from the output string. For example, the following returns text without soft hyphens and accent marks: - `str` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): An existing ASText object whose content will be replaced by the new text. **Returns:** `void` #### PDWordGetAttr ```cpp ASUns16 PDWordGetAttr(PDWord word) ``` Header: `PDProcs.h:4913` Gets a bit field containing information on the types of characters in a word. Use PDWordGetCharacterTypes() if you wish to check each character's type individually. **Note:** PDWordGetAttr() may return an attribute value greater than the maximum of all of the public attributes since there can be private attributes added on. It is recommended to `AND` the result with the attribute you are interested in. **Parameters** - `word` ([`PDWord`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWord)): IN/OUT The word whose character types are obtained. **Returns:** [`ASUns16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASUns16) A bit field containing information on the types of characters in word. The value is a logical `OR` of the Word Attributes. **See also:** [`PDWordGetCharacterTypes`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordGetCharacterTypes), [`PDWordGetStyleTransition`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordGetStyleTransition), [`PDWordGetNthCharStyle`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordGetNthCharStyle) #### PDWordGetAttrEx ```cpp ASUns16 PDWordGetAttrEx(PDWord word, ASUns32 groupID) ``` Header: `PDProcs.h:8617` This is a version 6.0 extension of PDWordGetAttr() that can be used only with a word finder created with algorithm version WF_VERSION_3 or higher. It can get an additional 16-bit flag group defined in Acrobat 6. It gets a bit field containing information on the types of characters in a word. Use PDWordGetCharacterTypes() if you wish to check each character's type individually. **Parameters** - `word` ([`PDWord`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWord)): The word whose character types are obtained. - `groupID` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The group number of the Word Attributes flags: - `0`, the default, is the first 16-bit group, and is the same as PDWordGetAttr(). `1` gets the second group defined in Acrobat 6. **Note:** PDWordGetAttr() may return an attribute value greater than the maximum of all of the public attributes, since there can be private attributes added on. It is recommended that you `AND` the result with the attribute you are interested in. **Returns:** [`ASUns16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASUns16) A bit field containing information on the types of characters in `word`. The value is a logical `OR` of the Word Attributes. **See also:** [`PDWordGetCharacterTypes`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordGetCharacterTypes), [`PDWordGetStyleTransition`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordGetStyleTransition), [`PDWordGetNthCharStyle`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordGetNthCharStyle) #### PDWordGetByteIdxFromHiliteChar ```cpp ASUns32 PDWordGetByteIdxFromHiliteChar(PDWord word, ASUns32 charIdx) ``` Header: `PDProcs.h:8542` Returns the byte offset within the specified word of the highlightable character at the specified character offset. The first character of a word is at byte offset `0`. This method can be used only with a word finder created with algorithm version WF_VERSION_3 or higher. The returned byte offset can be passed to PDWordGetCharOffsetEx() and PDWordGetCharQuad() to get additional information. Use PDWordGetNumHiliteChar() to get the number of highlightable characters in a word. **Parameters** - `word` ([`PDWord`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWord)): The word containing the character. - `charIdx` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The character index within the word. **Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32) The byte offset of the specified character within the word, or `0` if the character index is out of range. **See also:** [`PDWordGetCharOffsetEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordGetCharOffsetEx), [`PDWordGetCharQuad`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordGetCharQuad), [`PDWordGetNumHiliteChar`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordGetNumHiliteChar) #### PDWordGetCharDelta ```cpp ASInt8 PDWordGetCharDelta(PDWord word) ``` Header: `PDProcs.h:4974` Gets the difference between the word length (the number of printed characters in the word) and the PDF word length (the number of character codes in the word). For instance, if the PDF word is `fi (ligature) sh` the mapped word will be `"fish"`. The ligature occupies only one character code, so in this case the character delta will be `3-4 = -1`. If the PDWord's character set has no ligatures, such as on a non-Roman viewer supporting Japanese, returns `0`. **Parameters** - `word` ([`PDWord`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWord)): IN/OUT The word whose character delta is obtained. **Returns:** [`ASInt8`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt8) The character delta for word. Cast the return value to an ASInt8 before using. **See also:** [`PDWordGetLength`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordGetLength), [`PDWordGetCharOffset`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordGetCharOffset) #### PDWordGetCharEncFlags ```cpp void PDWordGetCharEncFlags(PDWord word, ASUns32 *fList, ASUns32 size) ``` Header: `PDProcs.h:8584` Gets the WordFinder Character Encoding Flags for each character in a word, which specify how reliably the word finder identified the character encoding. This method can be used only with a word finder created with algorithm version WF_VERSION_3 or higher. **Parameters** - `word` ([`PDWord`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWord)): The word whose character encoding flags are obtained. - `fList` ([`ASUns32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): (Filled by the method) An array of character encoding flags types. This array contains one element for each byte of text in the word. The byte length of the text can be determined with PDWordGetLength(). Each element is the logical `OR` of one or more of the character encoding flags. - `size` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The maximum number of elements in the array `fList`. **Returns:** `void` **See also:** [`PDWordGetAttrEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordGetAttrEx), `PDWordGetLength WordFinderCharacterEncodingFlags` #### PDWordGetCharOffset ```cpp ASUns16 PDWordGetCharOffset(PDWord word) ``` Header: `PDProcs.h:4953` Returns a word's character offset from the beginning of its page. This information, together with the character delta obtained from PDWordGetCharDelta(), can be used to highlight a range of words on a page, using PDTextSelectCreatePageHilite(). **Parameters** - `word` ([`PDWord`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWord)): IN/OUT The word whose character offset is obtained. **Returns:** [`ASUns16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASUns16) The word's character offset. On multi-byte systems, it points to the first byte. **See also:** [`PDWordGetCharDelta`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordGetCharDelta), [`PDWordGetLength`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordGetLength), [`PDTextSelectCreatePageHilite`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreatePageHilite) #### PDWordGetCharOffsetEx ```cpp ASUns32 PDWordGetCharOffsetEx(PDWord word, ASUns32 byteIdx, ASUns32 *bytesConsumed, ASUns32 *offsetLen) ``` Header: `PDProcs.h:8468` This is a version 6.0 extension of PDWordGetCharOffset() that can be used only with a word finder created with algorithm version WF_VERSION_3 or higher. It returns the character offset for a character identified by its index number, and the number of bytes (length) used for that character. The length is usually `1` for single-byte characters and `2` for double-byte characters. If multiple bytes are used to construct one character, only the first byte has valid character offset information and the other bytes have zero offset length with the same character offset of the first byte. If the returned offset length is zero, it means the specified byte in the word is a part (other than the first byte) of a multi-byte character. The character offset is the character position calculated in bytes from the beginning of a page. Because of the encoding conversions and character replacements applied by the word finder, some characters may have different byte lengths from the original PDF content. The character offset itself can locate a character in the PDF content. However, without the offset length (that is the number of bytes in the PDF content), clients cannot tell whether two characters are next to each other in the PDF content. For example, suppose you want to create a Text Select object of two characters at character offset `1` and `3`. You can create an object with two disconnected ranges of `[Offset 1, The length 1]` and `[Offset 3, The length 1]`. However, if you know that the offset length of both characters is `2`, you can create a simpler object with a single range of `[Offset 1, The length 4]`. **Parameters** - `word` ([`PDWord`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWord)): The word whose character offset is obtained. - `byteIdx` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The byte index within the word of the character whose offset is obtained. Valid values are `0` to `PDWordGetLength(word)-1`. - `bytesConsumed` ([`ASUns32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): (Filled by method) Returns the number of bytes in the word that are occupied by the specified character. It can be `NULL` if it is not needed. Use `(byteIdx + *bytesConsumed)` to get the byte index of the next character in the word. - `offsetLen` ([`ASUns32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): (Filled by the method) Returns the number of bytes occupied by the specified character in the original PDF content. This is `0` if the specified byte is not the starting byte of a character in the PDF content. It can be `NULL` if it is not needed. **Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32) The word's character offset and the number of bytes occupied by the character. **See also:** [`PDWordGetCharOffset`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordGetCharOffset), [`PDWordGetCharDelta`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordGetCharDelta), [`PDWordGetLength`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordGetLength), [`PDTextSelectCreatePageHilite`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreatePageHilite) #### PDWordGetCharQuad ```cpp ASBool PDWordGetCharQuad(PDWord word, ASUns32 byteIdx, ASFixedQuad *quad) ``` Header: `PDProcs.h:8496` Gets the quadrilateral bounding of the character at a given index position in the word. The `byteIdx` parameter should be a value returned from `PDWordGetByteIdxFromHiliteChar` where the `charIdx` parameter should be between `0` and `PDWordGetNumHiliteChar()-1`. However, if the specified character is constructed with multiple bytes, only the first byte returns a valid quad. Otherwise, this method returns `false`. **Parameters** - `word` ([`PDWord`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWord)): The word whose character offset is obtained. - `byteIdx` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The byte index within the word of the character whose quad is obtained. Valid values are `0` to `PDWordGetLength(word)-1`. - `quad` (`ASFixedQuad *`): (Filled by method) A pointer to an existing quad structure in which to return the character's quad specified in user-space coordinates. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the provided byte index is the beginning byte of a character and a valid quad is returned, `false` otherwise. **See also:** [`PDWordGetByteIdxFromHiliteChar`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordGetByteIdxFromHiliteChar), [`PDWordGetNumHiliteChar`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordGetNumHiliteChar), [`PDWordGetCharOffsetEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordGetCharOffsetEx), [`PDWordGetNthQuad`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordGetNthQuad), [`PDWordGetNumQuads`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordGetNumQuads) #### PDWordGetCharacterTypes ```cpp void PDWordGetCharacterTypes(PDWord word, ASUns16 *cArr, ASInt16 size) ``` Header: `PDProcs.h:4935` Gets the character type for each character in a word. **Parameters** - `word` ([`PDWord`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWord)): The word whose character types are obtained. - `cArr` ([`ASUns16 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASUns16)): (Filled by the method) An array of character types. This array contains one element for each character in the word. Use PDWordGetLength() to determine the number of elements that must be in the array. Each element is the logical `OR` of one or more of the Character Type Codes. For non-Roman character set viewers, meaningful values are returned only for Roman characters. For non-Roman characters, it returns `0`, which is the same as `W_CNTL`. If the character is 2 bytes, both bytes indicate the same character type. - `size` ([`ASInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16)): The number of elements in `cArr`. **Returns:** `void` **See also:** [`PDWordGetAttr`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordGetAttr), `PDWordGetLength CharacterTypeCodes` #### PDWordGetLength ```cpp ASUns8 PDWordGetLength(PDWord word) ``` Header: `PDProcs.h:4863` Gets the number of bytes in a word. This method also works on non-Roman systems. **Parameters** - `word` ([`PDWord`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWord)): IN/OUT The word object whose character count is obtained. **Returns:** [`ASUns8`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns8) The number of characters in word. **See also:** [`PDWordGetCharDelta`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordGetCharDelta), [`PDWordGetCharOffset`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordGetCharOffset) #### PDWordGetNthCharStyle ```cpp PDStyle PDWordGetNthCharStyle(PDWordFinder wObj, PDWord word, ASInt32 dex) ``` Header: `PDProcs.h:5010` Returns a PDStyle object for the nth style in a word. **Parameters** - `wObj` ([`PDWordFinder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinder)): IN/OUT A word finder object. - `word` ([`PDWord`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWord)): IN/OUT The word whose nth style is obtained. - `dex` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN/OUT The index of the style to obtain. The first style in a word has an index of zero. **Returns:** [`PDStyle`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDStyle) **Exceptions** - `genErrBadParm`: is raised if `dex < 0`. **See also:** [`PDWordGetStyleTransition`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordGetStyleTransition) #### PDWordGetNthQuad ```cpp ASBool PDWordGetNthQuad(PDWord word, ASInt16 nTh, ASFixedQuad *quad) ``` Header: `PDProcs.h:5060` Gets the specified word's nth quad, specified in user space coordinates. See PDWordGetNumQuads() for a description of a quad. The quad's height is the height of the font's bounding box, not the height of the tallest character used in the word. The font's bounding box is determined by the glyphs in the font that extend farthest above and below the baseline; it often extends somewhat above the top of `'A'` and below the bottom of `'y'`. The quad's width is determined from the characters actually present in the word. For example, the quads for the words `"AWAY"` and `"away"` have the same height, but generally do not have the same width unless the font is a mono-spaced font (a font in which all characters have the same width). Despite the names of the fields in an `ASFixedQuad` (`tl` for top left, `bl` for bottom left, and so forth) the corners of `quad` do not necessarily have these positions. **Parameters** - `word` ([`PDWord`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWord)): The word whose nth quad is obtained. - `nTh` ([`ASInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16)): The quad to obtain. A word's first quad has an index of zero. - `quad` (`ASFixedQuad *`): (Filled by the method) A pointer to the word's nth quad, specified in user-space coordinates. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the word has an nth quad, `false` otherwise. **See also:** [`PDWordGetNumQuads`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordGetNumQuads) #### PDWordGetNumHiliteChar ```cpp ASUns32 PDWordGetNumHiliteChar(PDWord word) ``` Header: `PDProcs.h:8519` Gets the number of *highlightable* characters in a word. A highlightable character is the minimum text unit that Acrobat can select and highlight. This method can be used only with a word finder created with algorithm version WF_VERSION_3 or higher. Because of the encoding conversion, the characters in a word finder word list do not have a 1-to-1 correspondence to the characters displayed by Acrobat. For example, if the word is `"fish"` and the text operation in PDF content is `"fi"`(ligature) `+ 's' + 'h'`, this method returns the number of highlightable characters as `3`, counting `"fi"` as one character. For the same word, the PDWordGetLength() method returns the byte-length as `4`. **Parameters** - `word` ([`PDWord`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWord)): The word whose highlightable character count is obtained. **Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32) The number of highlightable characters in `word`. **See also:** [`PDWordGetLength`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordGetLength) #### PDWordGetNumQuads ```cpp ASInt16 PDWordGetNumQuads(PDWord word) ``` Header: `PDProcs.h:5025` Gets the number of quads in a word. A quad is a quadrilateral bounding a contiguous piece of a word. Every word has at least one quad. A word has more than one quad, for example, if it is hyphenated and split across multiple lines or if the word is set on a curve rather than on a straight line. **Parameters** - `word` ([`PDWord`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWord)): IN/OUT The word whose quad count is obtained. **Returns:** [`ASInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16) The number of quads in word. **See also:** [`PDWordGetNthQuad`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordGetNthQuad) #### PDWordGetString ```cpp void PDWordGetString(PDWord word, char *str, ASInt32 len) ``` Header: `PDProcs.h:4892` This method gets a word's text. The string to return includes any word break characters (such as space characters) that follow the word, but not any that precede the word. The characters that are treated as word breaks are defined in the `outEncInfo` parameter of PDDocCreateWordFinder() method. Use PDWordFilterString() to subsequently remove the word break characters. This method produces a string in whatever encoding the PDWord uses, for both Roman and non-Roman systems. **Parameters** - `word` ([`PDWord`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWord)): The word whose string is obtained. - `str` (`char *`): (Filled by the method) The string. The encoding of the string is the encoding used by the `PDWordFinder` that supplied the PDWord. For instance, if PDDocCreateWordFinderUCS() is used to create the word finder, PDWordGetString() returns only Unicode. There is no way to detect Unicode strings returned by PDWordGetString(), since there is no UCS header (`FEFF`) added to each string returned. - `len` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The length of `str` in bytes. Up to `len` characters of word will be copied into `str`. If `str` is long enough, it will be `NULL`-terminated. **Returns:** `void` **Exceptions** - `genErrBadParm`: is raised if either `word` or `str` is `NULL`. **See also:** [`PDWordGetLength`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordGetLength), [`PDWordGetCharDelta`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordGetCharDelta), [`PDWordSplitString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordSplitString) #### PDWordGetStyleTransition ```cpp ASInt16 PDWordGetStyleTransition(PDWord word, ASInt16 *transTbl, ASInt16 size) ``` Header: `PDProcs.h:4995` Gets the locations of style transitions in a word. Every word has at least one style transition, at character position zero in the word. **Parameters** - `word` ([`PDWord`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWord)): IN/OUT The word whose style transition list is obtained. - `transTbl` ([`ASInt16 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16)): IN/OUT (Filled by the method) An array of style transitions. Each element is the character offset in word where the style changes. The offset specifies the first character in the word that has the new style. The first character in a word has an offset of zero. - `size` ([`ASInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16)): IN/OUT The number of entries that `transTbl` can hold. The word is searched only until this number of style transitions have been found. **Returns:** [`ASInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16) The number of style transition offsets copied to `transTbl`. **See also:** [`PDWordGetNthCharStyle`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordGetNthCharStyle) #### PDWordIsCurrentlyVisible ```cpp ASBool PDWordIsCurrentlyVisible(PDWord word, ASInt32 pageNum, PDOCContext ctx) ``` Header: `PDProcs.h:10668` Tests whether a word is visible in a given optional-content context on a given page. **Parameters** - `word` ([`PDWord`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWord)): The word to test. - `pageNum` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The page number for which the word is tested. - `ctx` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The context in which the word is tested, as returned by `PDDocGetOCContext(pdDoc)`. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the word is visible in the given context, `false` if it is hidden. **See also:** [`PDWordMakeVisible`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordMakeVisible), [`PDWordFinderAcquireVisibleWordList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinderAcquireVisibleWordList), [`PDWordFinderEnumVisibleWords`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinderEnumVisibleWords) #### PDWordIsRotated ```cpp ASBool PDWordIsRotated(PDWord word) ``` Header: `PDProcs.h:5069` Tests whether a word is rotated. **Parameters** - `word` ([`PDWord`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWord)): The word to test. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the word is rotated, `false` otherwise. **See also:** [`PDWordGetNthQuad`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordGetNthQuad) #### PDWordMakeVisible ```cpp ASBool PDWordMakeVisible(PDWord word, ASInt32 pageNum, PDOCContext ctx) ``` Header: `PDProcs.h:10685` Makes a word visible in a given optional-content context on a given page. **Parameters** - `word` ([`PDWord`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWord)): The word to test. - `pageNum` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The page number for which the word is to be made visible. - `ctx` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The context in which the word is to be made visible, as returned by `PDDocGetOCContext(pdDoc)`. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the word can be made visible in the given context, `false` otherwise. **See also:** [`PDWordIsCurrentlyVisible`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordIsCurrentlyVisible), [`PDWordFinderAcquireVisibleWordList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinderAcquireVisibleWordList), [`PDWordFinderEnumVisibleWords`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinderEnumVisibleWords) #### PDWordSplitString ```cpp ASUns16 PDWordSplitString(ASUns16 *infoArray, char *cNewWord, char *cOldWord, ASUns16 nMaxLen) ``` Header: `PDProcs.h:2252` Splits the specified string into words by substituting spaces for word separator characters. The list of characters considered to be word separators can be specified, or a default list can be used. The characters `','` and `'.'` are context-sensitive word separators. If surrounded by digits (for example, `654,096.345`), they are not considered word separators. For non-Roman character set viewers, this method currently supports only SHIFT-JIS encoding on a Japanese system. **Parameters** - `infoArray` ([`ASUns16 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASUns16)): A character information table. It specifies each character's type; word separator characters must be marked as `W_WORD_BREAK` (see Character Type Codes). This table can be identical to the table to pass to PDDocCreateWordFinder(). If `infoArray` is `NULL`, a default table is used (see Glyph Names of Word Separators). - `cNewWord` (`char *`): (Filled by the method) The word that has been split. Word separator characters have been replaced with spaces. - `cOldWord` (`char *`): The word to split. - `nMaxLen` ([`ASUns16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASUns16)): The number of characters that `cNewWord` can hold. Word splitting stops when `cOldWord` is completely processed or `nMaxLen` characters have been placed in `cNewWord`, whichever occurs first. **Returns:** [`ASUns16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASUns16) The number of splits that occurred. **Exceptions** - `genErrGeneral`: is raised if `infoArray` is `NULL`, but host encoding cannot be obtained. **See also:** `PDWordGetString CharacterTypeCodes` ### Typedefs (1) #### PDWordProc ```cpp typedef ASBool(*) PDWordProc(PDWordFinder wObj, PDWord wInfo, ASInt32 pgNum, void *clientData)(PDWordFinder wObj, PDWord wInfo, ASInt32 pgNum, void *clientData) ``` Header: `PDExpT.h:3412` A callback for PDWordFinderEnumWords. It is called once for each word. **See also:** [`PDWordFinderEnumWords`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinderEnumWords) ### Structures (1) #### PDWord ```cpp typedef struct _t_PDWord* PDWord ``` Header: `PDExpT.h:3391` A word in a PDF file. Each word contains a sequence of characters in one or more styles (see PDStyle). **See also:** [`PDWordFinderGetNthWord`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinderGetNthWord), [`PDWordFinderEnumWords`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinderEnumWords) ### Definitions (45) #### WXE_ADJACENT_TO_SPACE Header: `PDExpT.h:3600` Value: `0x800` The character following the end of the word is a space (either an explicit space character encoded in a string, or one that appears implicitly because the drawing point was moved). #### WXE_ENCODING_WARNING Header: `PDExpT.h:3635` Value: `0x02` #### WXE_ENC_MISSING Header: `PDExpT.h:3517` Value: `0x02` #### WXE_ENC_NO_UCS Header: `PDExpT.h:3521` Value: `0x04` #### WXE_ENC_UNMAPPED Header: `PDExpT.h:3514` Value: `0x01` #### WXE_EXT_CHAR_OFFSETS Header: `PDExpT.h:3642` Value: `0x10` #### WXE_FROM_ACTUALT Header: `PDExpT.h:3523` Value: `0x08` #### WXE_FRONT_TAB Header: `PDExpT.h:3633` Value: `0x01` #### WXE_HAS_DIGIT Header: `PDExpT.h:3546` Value: `0x8` One or more characters in the word are digits. #### WXE_HAS_HYPHEN Header: `PDExpT.h:3562` Value: `0x20` There is a hyphen in the word. #### WXE_HAS_LEADING_PUNC Header: `PDExpT.h:3579` Value: `0x100` The first character in the word is a punctuation mark. If this bit is set, `WXE_HAS_PUNCTUATION` will also be set. #### WXE_HAS_LETTER Header: `PDExpT.h:3536` Value: `0x2` The word contains a character between A-Z or a-z. #### WXE_HAS_LIGATURE Header: `PDExpT.h:3572` Value: `0x80` The word contains a ligature. #### WXE_HAS_NONALPHANUM Header: `PDExpT.h:3531` Value: `0X1` The word contains a character outside the range of A-Z, a-Z, 0-9. #### WXE_HAS_PUNCTUATION Header: `PDExpT.h:3557` Value: `0x10` One or more characters in the word are punctuation marks. Other flag bits can be checked to test whether the punctuation was at the beginning of the word (`WXE_HAS_LEADING_PUNC`), the end of the word (`WXE_HAS_TRAILING_PUNC`), or elsewhere in the word. #### WXE_HAS_SOFT_HYPHEN Header: `PDExpT.h:3567` Value: `0x40` There is a soft hyphen in the word. #### WXE_HAS_TRAILING_PUNC Header: `PDExpT.h:3586` Value: `0x200` The last character in the word is a punctuation mark. If this bit is set, `WXE_HAS_PUNCTUATION` will also be set. #### WXE_HAS_UNMAPPED_CHAR Header: `PDExpT.h:3592` Value: `0x400` One or more characters in the word cannot be represented in the output font encoding. #### WXE_HAS_UPPERCASE Header: `PDExpT.h:3541` Value: `0x4` The word contains a character between A-Z. #### WXE_LAST_WORD_ON_LINE Header: `PDExpT.h:3630` Value: `0x8000` The word is at the end of the current text line (for example, the word is followed by a line break). #### WXE_PDF_ORDER Header: `PDExpT.h:3653` Value: `0x2` #### WXE_RD_ORDER_SORT Header: `PDExpT.h:3661` Value: `0x8` #### WXE_REVERSE_DIRECTION Header: `PDExpT.h:3637` Value: `0x04` #### WXE_ROTATED Header: `PDExpT.h:3610` Value: `0x1000` The writing direction of the word is not in a multiple of 90 degrees, or the bounding box of the text is skewed. This flag indicates that the quads of the word should be used to specify the highlight area correctly. #### WXE_STREAM Header: `PDExpT.h:3649` Value: `0x1` #### WXE_VERTICAL_FLOW Header: `PDExpT.h:3619` Value: `0x2000` The writing direction of the word is either 90 or 180 degrees. This flag ignores the page rotation parameter of the page dictionary. Therefore, if the page is rotated 90 degrees, this flag will be set on each word that appears horizonally on the screen. #### WXE_WBREAK_WORD Header: `PDExpT.h:3624` Value: `0x4000` #### WXE_WORD_IS_UNICODE Header: `PDExpT.h:3638` Value: `0x08` #### WXE_XY_SORT Header: `PDExpT.h:3657` Value: `0x4` #### W_ACCENT Header: `PDExpT.h:3484` Value: `0x800` An accent mark. #### W_CNTL Header: `PDExpT.h:3425` Value: `0x1` A control code. #### W_COMMA Header: `PDExpT.h:3474` Value: `0x200` A comma. Commas and periods are treated separately from other punctuation marks because they are used both as word punctuation marks and as delimiters in numbers, and need to be treated differently in the two cases. #### W_DIGIT Header: `PDExpT.h:3440` Value: `0x8` A digit. #### W_END_PHRASE Header: `PDExpT.h:3494` Value: `0x2000` An end-of-phrase glyph (for example, `"."`, `"?"`, `"!"`, `":"`, and `";"`). #### W_HYPHEN Header: `PDExpT.h:3450` Value: `0x20` A hyphen. #### W_LETTER Header: `PDExpT.h:3430` Value: `0x2` A lowercase letter. #### W_LIGATURE Header: `PDExpT.h:3460` Value: `0x80` A ligature. #### W_PERIOD Header: `PDExpT.h:3479` Value: `0x400` A period. #### W_PUNCTUATION Header: `PDExpT.h:3445` Value: `0x10` A punctuation mark. #### W_SOFT_HYPHEN Header: `PDExpT.h:3455` Value: `0x40` A hyphen that is only present because a word is broken across two lines of text. #### W_UNMAPPED Header: `PDExpT.h:3489` Value: `0x1000` A glyph that cannot be represented in the destination font encoding. #### W_UPPERCASE Header: `PDExpT.h:3435` Value: `0x4` An uppercase letter. #### W_WHITE Header: `PDExpT.h:3465` Value: `0x100` A white space glyph. #### W_WILD_CARD Header: `PDExpT.h:3499` Value: `0x4000` A wildcard glyph (for example, `"*"` and `"?"`) that should not be treated as a normal punctuation mark. #### W_WORD_BREAK Header: `PDExpT.h:3505` Value: `0x8000` A glyph that acts as a delimiter between words. **See also:** `GlyphNamesofWordSeparators` ## PDWordFinder ### Functions (9) #### PDWordFinderAcquireVisibleWordList ```cpp void PDWordFinderAcquireVisibleWordList(PDWordFinder wObj, ASInt32 pgNum, PDOCContext ocContext, PDWord *wInfoP, PDWord **xySortTable, PDWord **rdOrderTable, ASInt32 *numWords) ``` Header: `PDProcs.h:10650` Finds all words on the specified page that are visible in the given optional-content context and returns one or more tables containing the words. One table contains the words sorted in the order in which they appear in the PDF file, while the other contains the words sorted by their x- and y-coordinates on the page. The list contains only words that are visible in the given context. If the word states change in the given context, the word list will have to be released and re-acquired to reflect the changed set of visible words. There can be only one word list in existence at a time; clients must release the previous word list, using PDWordFinderReleaseWordList(), before creating a new one. Use PDWordFinderEnumWords() instead of this method if you wish to find one word at a time instead of obtaining a table containing all visible words on a page. This procedure is intended to replace the call to PDWordFinderAcquireWordList() in most cases where you want to work only with the content that is visible on screen (such as a text selection). Change this call to update an application to work with the Optional Content feature. Access the acquired list through PDWordFinderGetNthWord(). The words are ordered in PDF order, which is the order in which they appear in the PDF file's data. This is often, but not always, the order in which a person would read the words. Use PDWordFinderGetNthWord to traverse this array; you cannot access this array directly. This array is always filled, regardless of the flags used in the call to PDDocCreateWordFinder() or PDDocCreateWordFinderUCS(). **Parameters** - `wObj` ([`PDWordFinder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinder)): The word finder (created using PDDocCreateWordFinder() or PDDocCreateWordFinderUCS()) used to acquire the word list. - `pgNum` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The page number for which words are found. First page is `0`, not `1` as designated in Acrobat. - `ocContext` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The context within which the words are in a visible state. `NULL` is equivalent to passing `PDDocGetOCContext(pdDoc)`. - `wInfoP` ([`PDWord *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWord)): (Filled by the method) A user-supplied PDWord variable. Acrobat will fill this in to point to an Acrobat-allocated array of PDWord objects, which should *never* be accessed directly. - `xySortTable` ([`PDWord **`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWord)): (Filled by the method) Acrobat fills in this user-supplied pointer to a pointer with the location of an Acrobat-allocated array of PDWords, sorted in x-y order, meaning that all words on the first *line*, from left to right, followed by all words on the next line. This array is only filled if the WXE_XY_SORT flag was set in the call to PDDocCreateWordFinder() or PDDocCreateWordFinderUCS(). PDWordFinderReleaseWordList() *must* be called to release allocated memory for this return or there will be a memory leak. As long as this parameter is non-`NULL`, the array is always filled regardless of the value of the rdFlags parameter in PDDocCreateWordFinder(). - `rdOrderTable` ([`PDWord **`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWord)): Currently unused. Pass `NULL` for its value. - `numWords` ([`ASInt32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): (Filled by the method) The number of visible words found on the page. **Returns:** `void` **Exceptions** - `pdErrOpNotPermitted` **See also:** [`PDDocCreateWordFinder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateWordFinder), [`PDDocCreateWordFinderUCS`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateWordFinderUCS), [`PDWordFinderAcquireWordList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinderAcquireWordList), [`PDWordFinderReleaseWordList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinderReleaseWordList), [`PDWordFinderEnumWords`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinderEnumWords), [`PDWordFinderGetNthWord`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinderGetNthWord) #### PDWordFinderAcquireWordList ```cpp void PDWordFinderAcquireWordList(PDWordFinder wObj, ASInt32 pgNum, PDWord *wInfoP, PDWord **xySortTable, PDWord **rdOrderTable, ASInt32 *numWords) ``` Header: `PDProcs.h:4767` Finds all words on the specified page and returns one or more tables containing the words. One table contains the words sorted in the order in which they appear in the PDF file, while the other contains the words sorted by their x- and y-coordinates on the page. Only words within or partially within the page's crop box (see PDPageGetCropBox()) are enumerated. Words outside the crop box are skipped. There can be only one word list in existence at a time; clients must release the previous word list, using PDWordFinderReleaseWordList(), before creating a new one. Use PDWordFinderEnumWords() instead of this method, if you wish to find one word at a time instead of obtaining a table containing all words on a page. Access the acquired list through PDWordFinderGetNthWord(). The words are ordered in PDF order, which is the order in which they appear in the PDF file's data. This is often, but not always, the order in which a person would read the words. Use PDWordFinderGetNthWord() to traverse this array; you cannot access this array directly. This array is always filled, regardless of the flags used in the call to PDDocCreateWordFinder() or PDDocCreateWordFinderUCS(). **Parameters** - `wObj` ([`PDWordFinder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinder)): The word finder (created using PDDocCreateWordFinder() or PDDocCreateWordFinderUCS()) used to acquire the word list. - `pgNum` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The page number for which words are found. The first page is `0`, not `1` as designated in Acrobat. - `wInfoP` ([`PDWord *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWord)): (Filled by the method) A user-supplied PDWord variable. Acrobat will fill this in to point to an Acrobat-allocated array of PDWord objects, which should *never* be accessed directly. - `xySortTable` ([`PDWord **`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWord)): (Filled by the method) Acrobat fills in this user-supplied pointer to a pointer with the location of an Acrobat-allocated array of PDWords, sorted in x-y order, meaning that all words on the first *line*, from left to right, are followed by all words on the next line. This array is only filled if the `WXE_XY_SORT` flag was set in the call to PDDocCreateWordFinder() or PDDocCreateWordFinderUCS(). PDWordFinderReleaseWordList() must be called to release allocated memory for this return or there will be a memory leak. As long as this parameter is non-`NULL`, the array is always filled regardless of the value of the `rdFlags` parameter in PDDocCreateWordFinder(). - `rdOrderTable` ([`PDWord **`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWord)): Currently unused. Pass `NULL` for this value. - `numWords` ([`ASInt32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): (Filled by the method) The number of words found on the page. **Returns:** `void` **Exceptions** - `pdErrOpNotPermitted` **See also:** [`PDDocCreateWordFinder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateWordFinder), [`PDDocCreateWordFinderUCS`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateWordFinderUCS), [`PDWordFinderReleaseWordList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinderReleaseWordList), [`PDWordFinderEnumWords`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinderEnumWords), [`PDWordFinderGetNthWord`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinderGetNthWord) #### PDWordFinderDestroy ```cpp void PDWordFinderDestroy(PDWordFinder wObj) ``` Header: `PDProcs.h:4814` Destroys a word finder. Use this when you are done extracting text in a file. **Parameters** - `wObj` ([`PDWordFinder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinder)): IN/OUT The word finder to destroy. **Returns:** `void` **See also:** [`PDDocCreateWordFinder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateWordFinder), [`PDDocCreateWordFinderUCS`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateWordFinderUCS), [`PDDocGetWordFinder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetWordFinder) #### PDWordFinderEnumVisibleWords ```cpp ASBool PDWordFinderEnumVisibleWords(PDWordFinder wObj, ASInt32 PageNum, PDOCContext ocContext, PDWordProc wordProc, void *clientData) ``` Header: `PDProcs.h:10723` Extracts visible words, one at a time, from the specified page or the entire document. It calls a user-supplied procedure once for each word found. If you wish to extract all text from a page at once, use PDWordFinderAcquireWordList() instead of this method. Only words that are visible in the given optional-content context are enumerated. **Parameters** - `wObj` ([`PDWordFinder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinder)): A word finder object. - `PageNum` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The page number from which to extract words. Pass PDAllPages (see `PDExpT.h`) to sequentially process all pages in the document. - `ocContext` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The context within which the words are in a visible state. `NULL` is equivalent to passing `PDDocGetOCContext(pdDoc)`. - `wordProc` ([`PDWordProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordProc)): A user-supplied callback to call once for each word found. Enumeration halts if `wordProc` returns `false`. - `clientData` (`void *`): A pointer to user-supplied data to pass to `wordProc` each time it is called. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if enumeration was successfully completed, `false` if enumeration was terminated because `wordProc` returned `false`. **Exceptions** - `genErrBadParm`: is raised if `wordProc` is `NULL`, or `pageNum` is less than zero or greater than the total number of pages in the document. - `pdErrOpNotPermitted` **See also:** [`PDDocCreateWordFinder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateWordFinder), [`PDDocCreateWordFinderUCS`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateWordFinderUCS), [`PDDocGetWordFinder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetWordFinder), [`PDWordFinderAcquireWordList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinderAcquireWordList), [`PDWordFinderEnumWords`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinderEnumWords), [`PDWordFinderEnumWordsStr`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinderEnumWordsStr) #### PDWordFinderEnumWords ```cpp ASBool PDWordFinderEnumWords(PDWordFinder wObj, ASInt32 PageNum, PDWordProc wordProc, void *clientData) ``` Header: `PDProcs.h:4850` Extracts words, one at a time, from the specified page or the entire document. It calls a user-supplied procedure once for each word found. If you wish to extract all text from a page at once, use PDWordFinderAcquireWordList() instead of this method. Only words within or partially within the page's crop box (see PDPageGetCropBox()) are enumerated. Words outside the crop box are skipped. **Parameters** - `wObj` ([`PDWordFinder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinder)): A word finder object. - `PageNum` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The page number from which to extract words. Pass PDAllPages (see PDExpT.h) to sequentially process all pages in the document. - `wordProc` ([`PDWordProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordProc)): A user-supplied callback to call once for each word found. Enumeration halts if `wordProc` returns `false`. - `clientData` (`void *`): A pointer to user-supplied data to pass to `wordProc` each time it is called.`true` if enumeration was successfully completed, `false` if enumeration was terminated because `wordProc` returned `false`. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) **Exceptions** - `pdErrOpNotPermitted` - `genErrBadParm`: is raised if `wordProc` is `NULL`, or `pageNum` is less than zero or greater than the total number of pages in the document. **See also:** [`PDDocCreateWordFinder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateWordFinder), [`PDDocCreateWordFinderUCS`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateWordFinderUCS), [`PDDocGetWordFinder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetWordFinder), [`PDWordFinderAcquireWordList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinderAcquireWordList), [`PDWordFinderEnumVisibleWords`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinderEnumVisibleWords), [`PDWordFinderEnumWordsStr`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinderEnumWordsStr) #### PDWordFinderEnumWordsStr ```cpp ASBool PDWordFinderEnumWordsStr(PDWordFinder wObj, const ASUTF16Val *ucsStr, ASUns32 strLen, ASUns32 charOffsetAdj, PDWordProc wordProc, void *clientData) ``` Header: `PDProcs.h:8689` Constructs a PDWord list from a Unicode string, and calls a user-supplied procedure once for each word found. The words extracted by this method do not have quads, text style, or text selection information. The character offset is calculated from the beginning of the input string, and is increased by `2` on every 16 bits of data (the character offset of a character in a PDWord is the byte offset of the character in the source Unicode string). For example: `PDWordFinderEnumWordsStr(wf, str1, stelen(str1), 0, wp, d);` `PDWordFinderEnumWordsStr(wf, str2, stelen(str2), stelen(str1), wp, d);` **Parameters** - `wObj` ([`PDWordFinder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinder)): A word finder object. - `ucsStr` ([`const ASUTF16Val *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUTF16Val)): A pointer to the Unicode string. - `strLen` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The length of the string in bytes. - `charOffsetAdj` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The character offset value of the first character in the input Unicode string. This value is added to the word character offsets, and is used to maintain contiguous word character offsets when multiple strings (and multiple calls to this method) are combined into one word list. - `wordProc` ([`PDWordProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordProc)): A user-supplied callback to call once for each word found. Enumeration halts if `wordProc` returns `false`. - `clientData` (`void *`): A pointer to user-supplied data to pass to `wordProc` each time it is called. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the enumeration was successfully completed, `false` if the enumeration was terminated because `wordProc` returned `false`. **Exceptions** - `genErrBadParm`: is raised if `wordProc` is `NULL`. - `pdErrOpNotPermitted` **See also:** [`PDDocCreateWordFinder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateWordFinder), [`PDDocCreateWordFinderUCS`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateWordFinderUCS), [`PDDocGetWordFinder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetWordFinder), [`PDWordFinderAcquireWordList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinderAcquireWordList), [`PDWordFinderEnumVisibleWords`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinderEnumVisibleWords), [`PDWordFinderEnumWords`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinderEnumWords) #### PDWordFinderGetLatestAlgVersion ```cpp ASInt16 PDWordFinderGetLatestAlgVersion(PDWordFinder wObj) ``` Header: `PDProcs.h:4785` Gets the version number of the specified word finder, or the version number of the latest word finder algorithm. **Parameters** - `wObj` ([`PDWordFinder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinder)): IN/OUT The word finder whose algorithm's version is obtained. Pass `NULL` to obtain the latest word finding algorithm version number. **Returns:** [`ASInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16) The algorithm version associated with `wObj`, or the version of the latest word finder algorithm if `wObj` is `NULL`. **See also:** [`PDDocCreateWordFinder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateWordFinder), [`PDDocCreateWordFinderUCS`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateWordFinderUCS), [`PDDocGetWordFinder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetWordFinder) #### PDWordFinderGetNthWord ```cpp PDWord PDWordFinderGetNthWord(PDWordFinder wObj, ASInt32 nTh) ``` Header: `PDProcs.h:2217` Gets the nth word in the word list obtained using PDWordFinderAcquireWordList(). **Parameters** - `wObj` ([`PDWordFinder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinder)): IN/OUT The word finder whose nth word is obtained. - `nTh` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN/OUT The index of the word to obtain. The first word on a page has an index of zero. Words are counted in PDF order. See the description of the `wInfoP` parameter in PDWordFinderAcquireWordList(). **Returns:** [`PDWord`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWord) The nth word. It returns `NULL` when the end of the list is reached. **See also:** [`PDWordFinderAcquireWordList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinderAcquireWordList), [`PDWordFinderEnumWords`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinderEnumWords) #### PDWordFinderReleaseWordList ```cpp void PDWordFinderReleaseWordList(PDWordFinder wObj, ASInt32 pgNum) ``` Header: `PDProcs.h:4802` Releases the word list for a given page. Use this to release a list created by PDWordFinderAcquireWordList() when you are done using this list. **Parameters** - `wObj` ([`PDWordFinder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinder)): A word finder object. - `pgNum` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The number of pages for which a word list is released. **Returns:** `void` **Exceptions** - `genErrBadUnlock`: is raised if the list has already been released. **See also:** [`PDWordFinderAcquireWordList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinderAcquireWordList), [`PDDocCreateWordFinder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateWordFinder), [`PDDocCreateWordFinderUCS`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateWordFinderUCS), [`PDDocGetWordFinder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetWordFinder) ### Typedefs (1) #### PDWordFinderCtrlProc ```cpp typedef ASBool(*) PDWordFinderCtrlProc(ASUns32 startTime, void *clientData)(ASUns32 startTime, void *clientData) ``` Header: `PDExpT.h:3937` This is passed to PDWordFinderSetCtrlProc(). This is the callback function called by Word Finder when its page enumeration process takes longer than the specified time (in seconds). Return `true` to continue the enumeration process, or `false` to stop. `startTime` is the value that was set by ASGetSecs() when the Word Finder started processing the current page. ### Structures (1) #### PDWordFinder ```cpp typedef struct _t_PDWordFinder* PDWordFinder ``` Header: `PDExpT.h:3382` Extracts words from a PDF file, and enumerates the words on a single page or on all pages in a document. **See also:** [`PDDocCreateWordFinder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateWordFinder), [`PDDocCreateWordFinderUCS`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateWordFinderUCS), [`PDDocGetWordFinder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocGetWordFinder), [`PDWordFinderDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinderDestroy), [`PDWordFinderEnumWords`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordFinderEnumWords) ### Definitions (4) #### WF_LATEST_VERSION Header: `PDExpT.h:3665` Value: `0` Used to obtain the latest available version. #### WF_VERSION_2 Header: `PDExpT.h:3669` Value: `2` The version used for Acrobat 3.x, 4.x. #### WF_VERSION_3 Header: `PDExpT.h:3673` Value: `3` For Acrobat 5.0 without accessibility enabled. #### WF_VERSION_4 Header: `PDExpT.h:3677` Value: `4` For Acrobat 5.0 with accessibility enabled. ## PDXObject ### Functions (5) #### PDXObjectEnumFilters ```cpp void PDXObjectEnumFilters(PDXObject obj, PDXObjectFilterEnumProc proc, void *clientData) ``` Header: `PDProcs.h:3866` (Obsolete, provided only for backwards compatibility) Enumerates the filters attached to an XObject, calling a user-supplied procedure for each filter. **Parameters** - `obj` ([`PDXObject`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXObject)): The XObject whose filters are enumerated. - `proc` ([`PDXObjectFilterEnumProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXObjectFilterEnumProc)): A user-supplied callback to call for each filter attached to the XObject. Enumeration ends if `proc` returns `false`. `proc` will not be called if there are no filters attached to the XObject. - `clientData` (`void *`): A pointer to user-supplied data to pass to `proc` each time it is called. **Returns:** `void` #### PDXObjectGetCosObj ```cpp CosObj PDXObjectGetCosObj(PDXObject xObj) ``` Header: `PDProcs.h:3825` (Obsolete, provided only for backwards compatibility) Gets the Cos object associated with an XObject. This method does not copy the object, but is instead the logical equivalent of a type cast. **Parameters** - `xObj` ([`PDXObject`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXObject)): The XObject whose Cos object is obtained. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) The dictionary Cos object for the XObject. #### PDXObjectGetData ```cpp void PDXObjectGetData(PDXObject obj, PDGetDataProc getDataProc, void *clientData) ``` Header: `PDProcs.h:3851` (Obsolete, provided only for backwards compatibility) Passes the data from an XObject to a user-supplied procedure. **Parameters** - `obj` ([`PDXObject`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXObject)): The XObject whose data is read. - `getDataProc` ([`PDGetDataProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDGetDataProc)): A user-supplied callback to call with the XObject's data. Enumeration ends if `getDataProc` returns `false`. - `clientData` (`void *`): A pointer to user-supplied data to pass to `getDataProc`. **Returns:** `void` **See also:** [`PDXObjectGetDataLength`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXObjectGetDataLength) #### PDXObjectGetDataLength ```cpp ASInt32 PDXObjectGetDataLength(PDXObject xObj) ``` Header: `PDProcs.h:3837` (Obsolete, provided only for backwards compatibility) Gets the value of the XObject stream's `length` key, which specifies the amount of data in the PDF file (that is, after all compression/encoding filters have been applied). **Parameters** - `xObj` ([`PDXObject`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXObject)): The XObject whose data length is obtained. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The XObject's data length. **See also:** [`PDXObjectGetData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXObjectGetData) #### PDXObjectGetSubtype ```cpp ASAtom PDXObjectGetSubtype(PDXObject xObj) ``` Header: `PDProcs.h:3814` (Obsolete, provided only for backwards compatibility) Gets the subtype of an XObject. Examples of a subtype are Image and Form. **Parameters** - `xObj` ([`PDXObject`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXObject)): The XObject whose subtype is obtained. **Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom) The ASAtom corresponding to the XObject's subtype. It can be converted into a string using ASAtomGetString(). **See also:** [`PDXObjectGetData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXObjectGetData) ### Typedefs (2) #### PDGetDataProc ```cpp typedef ASBool(*) PDGetDataProc(char *data, ASUns32 lenData, void *clientData)(char *data, ASUns32 lenData, void *clientData) ``` Header: `PDExpT.h:3122` A callback for PDXObjectGetData(). It is passed the XObject's data. Currently, the XObject's data is read 1 kB at a time and passed to this callback. **See also:** [`PDXObjectGetData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXObjectGetData) #### PDXObjectFilterEnumProc ```cpp typedef ASBool(*) PDXObjectFilterEnumProc(char *filter, CosObj decodeParms, void *clientData)(char *filter, CosObj decodeParms, void *clientData) ``` Header: `PDExpT.h:3094` A callback for PDXObjectEnumFilters(). It is called once for each filter that has been applied to an XObject's data. **See also:** [`PDXObjectEnumFilters`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXObjectEnumFilters) ### Structures (1) #### PDXObject ```cpp typedef struct _t_PDXObject* PDXObject ``` Header: `PDExpT.h:2506` A superclass used for PDF XObjects. Acrobat currently uses two XObject subclasses: PDImage and PDForm. You can use any PDXObject method on these three objects. **See also:** [`PDXObjectEnumFilters`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXObjectEnumFilters), [`PDXObjectGetData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDXObjectGetData) --- # PDF Edit Layer Source: https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer ## Dump ### Functions (3) #### PDEAttrEnumTable ```cpp void PDEAttrEnumTable(IN PDEAttrEnumProc enumProc, IN void *clientData) ``` Header: `PERProcs.h:1304` Enumerates the table of attributes. This method enumerates the shared resource objects. It is useful when looking for orphaned attributes. **Parameters** - `enumProc` (`IN PDEAttrEnumProc`): IN/OUT A callback to call for each attribute. - `clientData` (`IN void *`): IN/OUT A pointer to user-supplied data to pass to `enumProc` each time it is called. **Returns:** `void` **Exceptions** - `genErrBadParm` #### PDELogDump ```cpp void PDELogDump(IN PDEObjectDumpProc proc, IN void *clientData) ``` Header: `PERProcs.h:1291` Enumerates the PDEObject objects. This is useful when looking for orphaned objects. **Parameters** - `proc` (`IN PDEObjectDumpProc`): A callback to call once for each PDEObject. - `clientData` (`IN void *`): A pointer to user-supplied data to pass to `proc` each time it is called. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `peErrUnknownPDEColorSpace` - `genErrBadParm` **See also:** [`PDEObjectDump`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEObjectDump) #### PDEObjectDump ```cpp void PDEObjectDump(IN PDEObject obj, IN ASInt32 levels, IN PDEObjectDumpProc proc, IN void *clientData) ``` Header: `PERProcs.h:1276` The object, its children and attributes are dumped. The dump contains information about each individual object. The output for child elements is indented with respect to their parents. • The information for each object is `char*` - the string describing Object Type. (See PDEObjectGetType()). • The number representing Object Type. (See `PEExpT.h`: PDEType `enum`). • The object reference count. • The memory location for the object. **Parameters** - `obj` (`IN PDEObject`): The PDEObject to dump. - `levels` (`IN ASInt32`): The depth of children to dump. - `proc` (`IN PDEObjectDumpProc`): A callback with the dump information; it may be called more than once per object. - `clientData` (`IN void *`): Provided by the caller as the parameter of the same name for `proc`. **Returns:** `void` **Exceptions** - `genErrBadParm` **See also:** [`PDELogDump`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDELogDump) ### Typedefs (2) #### PDEAttrEnumProc ```cpp typedef ASBool(*) PDEAttrEnumProc(IN void *attrHdrP, IN ASUns32 refCount, IN ASUns16 size, IN void *clientData)(IN void *attrHdrP, IN ASUns32 refCount, IN ASUns16 size, IN void *clientData) ``` Header: `PEExpT.h:2142` A callback for PDEAttrEnumTable(). It is called once for each attribute in a table. **See also:** [`PDEAttrEnumTable`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEAttrEnumTable) #### PDEObjectDumpProc ```cpp typedef void(*) PDEObjectDumpProc(IN PDEObject obj, IN const char *dumpInfo, IN void *clientData)(IN PDEObject obj, IN const char *dumpInfo, IN void *clientData) ``` Header: `PEExpT.h:2124` A callback for PDELogDump() or PDEObjectDump(). It is called once for each PDEObject, its children, and their attributes for the specified number of levels. **See also:** [`PDELogDump`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDELogDump), [`PDEObjectDump`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEObjectDump) ## General ### Functions (5) #### PDEDefaultGState ```cpp void PDEDefaultGState(OUT PDEGraphicStateP stateP, IN ASInt32 stateSize) ``` Header: `PERProcs.h:1471` Fills out a PDEGraphicStateP structure with the default graphic state. **Note:** Non-NULL objects in the graphic state, such as the fill and stroke color spaces, have their reference counts incremented by this method. Be sure to release these non- NULL objects when disposing of `stateP`. **Parameters** - `stateP` (`OUT PDEGraphicStateP`): (Filled by the method) A pointer to a `PDEGraphicState` structure with the default graphic state. - `stateSize` (`IN ASInt32`): The size of the `stateP` structure in bytes. **Returns:** `void` #### PDEDefaultGStateEx ```cpp void PDEDefaultGStateEx(OUT PDEGraphicStateExP stateP, IN ASInt32 stateSize) ``` Header: `PERProcs.h:3327` Fills out a `PDEGraphicStateEx` structure which is higher precision alternative of `PDEGraphicState` structure with the default graphic state. **Note:** Non-NULL objects in the graphic state, such as the fill and stroke color spaces, have their reference counts incremented by this method. Be sure to release these non- NULL objects when disposing of `stateP`. **Parameters** - `stateP` (`OUT PDEGraphicStateExP`): (Filled by the method) A pointer to a `PDEGraphicStateEx` structure with the default graphic state. - `stateSize` (`IN ASInt32`): The size of the `stateP` structure in bytes. **Returns:** `void` #### PDEMergeResourcesDict ```cpp void PDEMergeResourcesDict(OUT CosObj *resDictP, IN CosDoc cosDoc, IN const CosObj *newResP) ``` Header: `PEWProcs.h:1072` Merges two Resources dictionaries in the same CosDoc; you cannot merge two resource dictionaries from different CosDocs. Both dictionaries and what they reference must be in `cosDoc`. The objects referenced by `newResP` are appended to `resDictP`. This method only operates on the Cos dictionaries. It assumes there are no resource name conflicts. This method was useful for adding form resources to page resource dictionaries, but that is no longer necessary. **Note:** Since PDFEdit resolves resource names across PDEContent objects, this routine is safe for using with PDFEdit methods. This method may be unsafe if you modify streams and dictionaries outside of the PDFEdit API. **Parameters** - `resDictP` (`OUT CosObj *`): IN/OUT (Filled by the method) The dictionary to which `newResP` is merged. When the method completes, `resDictP` is the merged dictionary result. - `cosDoc` (`IN CosDoc`): IN/OUT The CosDoc containing both dictionaries. - `newResP` (`IN const CosObj *`): IN/OUT The dictionary to merge with `resDictP`. **Returns:** `void` **Exceptions** - `genErrBadParm` #### PDEPurgeCache ```cpp void PDEPurgeCache(IN PDDoc doc) ``` Header: `PEWProcs.h:1312` Clears the PDE Cache of this PDDoc. This method is only of interest to clients. **Note:** It is not recommended that you call this method directly; it is provided only for backwards compatibility. **Parameters** - `doc` (`IN PDDoc`): A PDDoc whose cache is purged. **Returns:** `void` #### PDEScratchDocCleanup ```cpp void PDEScratchDocCleanup(void) ``` Header: `PEWProcs.h:3108` Removes unused objects from the PDFEdit scratch document, which is used to hold representations of PDFEdit resources associated with a specific document. **Parameters** - (unnamed) (`void`) **Returns:** `void` ### Typedefs (1) #### ASFloat ```cpp typedef float ASFloat ``` Header: `PEExpT.h:63` ### Structures (6) #### PDEDoc ```cpp typedef struct _t_PDEDoc* PDEDoc ``` Header: `PEExpT.h:403` A reference to a PDEDoc. #### PDEEmitStateP ```cpp typedef struct _t_PDEEmitState* PDEEmitStateP ``` Header: `PEExpT.h:366` A reference to the state of a writer. #### PDEPage ```cpp typedef struct _t_PDEPage* PDEPage ``` Header: `PEExpT.h:407` A reference to a PDEPage. #### PDEReader ```cpp typedef struct _t_PDEReader* PDEReader ``` Header: `PEExpT.h:387` An object used to read streams of PDEElement objects from page contents. #### PDEState ```cpp typedef struct _t_PDEState* PDEState ``` Header: `PEExpT.h:362` A reference to the state of a reader. #### PDEWriter ```cpp typedef struct _t_PDEWriter* PDEWriter ``` Header: `PEExpT.h:391` An object used to write streams of PDEElement objects to page content. ### Enums (3) #### PDEEnumElementsFlags Header: `PEExpT.h:1686` A bit field for the PDEEnumElements() method. **Values** - `kPDEContentIgnoreMarkedContent = 0x0001`: Indicates whether Marked Content is ignored in the enumeration. This may be useful when generating elements purely for display purposes. - `kPDEContentParsingAForm = 2` **See also:** [`PDEEnumElements`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEEnumElements) #### PDEGraphicStateWasSetFlags Header: `PEExpT.h:622` A structure describing the graphics state that was set. **Values** - `kPDEFillCSpaceWasSet = 0x0001`: A fill color space was set corresponding to the cs (`setcolorspace`) operator. - `kPDEFillCValueWasSet = 0x0002`: A color fill value was set corresponding to the sc (`setcolor`) operator. - `kPDEStrokeCSpaceWasSet = 0x0004`: A color space stroke value was set corresponding to the CS (`setcolorspace`) operator. - `kPDEStrokeCValueWasSet = 0x0008`: A color stroke value was set corresponding to the SC (`setcolor`) operator. - `kPDEDashWasSet = 0x0010`: A dash specification was set corresponding to the d (`setdash`) operator. - `kPDELineWidthWasSet = 0x0020`: The line width was set corresponding to the w (`setlinewidth`) operator. - `kPDEMiterLimitWasSet = 0x0040`: The miter limit was set corresponding to the M (`setmiterlimit`) operator. - `kPDEFlatnessWasSet = 0x0080`: Line flatness was set corresponding to the i (`setflat`) operator. - `kPDELineCapWasSet = 0x0100`: Line cap style was set corresponding to the J (`setlinecap`) operator. - `kPDELineJoinWasSet = 0x0200`: Line join style was set corresponding to the j (`setlinejoin`) operator. - `kPDERenderIntentWasSet = 0x0400`: A color rendering intent was set corresponding to the Intent key in the image dictionary. - `kPDEExtGStateWasSet = 0x0800`: An extended graphics state was set corresponding to the gs operator. - `kPDESoftMaskMatrixWasSet = 0x1000`: The soft mask matrix has been set - `kPDEStateWasSetByPDEParse = 0x01000000` **See also:** [`PDEDefaultGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEDefaultGState), [`PDETextAdd`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextAdd) #### PDEType Header: `PEExpT.h:1489` The types of PDEObject, which is the superclass for PDEContent, PDEElement, PDEClip, and so on. **Values** - `kPDEContent = 0`: PDEContent object - `kPDEText = 1`: PDEText object - `kPDEPath = 2`: PDEPath object - `kPDEImage = 3`: PDEImage object - `kPDEForm = 4`: PDEForm object - `kPDEPS = 5`: PDEPS object - `kPDEXObject = 6`: PDEXObject object - `kPDEClip = 7`: PDEClip object - `kPDEFont = 8`: PDEFont object - `kPDEColorSpace = 9`: PDEColorSpace object - `kPDEExtGState = 10`: PDEExtGState object - `kPDEPlace = 11`: PDEPlace object - `kPDEContainer = 12`: PDEContainer object - `kPDSysFont = 13`: PDSysFont object - `kPDEPattern = 14`: PDEPattern object - `kPDEDeviceNColors = 15`: PDEDeviceNColors object - `kPDEShading = 16`: PDEShading object - `kPDEGroup = 17`: PDEGroup object - `kPDEUnknown = 18`: PDEUnknown object - `kPDEBeginContainer = 19`: PDEBeginContainer object - `kPDEEndContainer = 20`: PDEEndContainer object - `kPDEBeginGroup = 21`: PDEBeginGroup object - `kPDEEndGroup = 22`: PDEEndGroup object - `kPDEXGroup = 23`: PDEXGroup object - `kPDESoftMask = 24`: PDESoftMask object - `kPDSysEncoding = 25`: PDSysEncoding object - `kPDEDoc = 26`: PDEDoc object - `kPDEPage = 27`: PDEPage object - `kPDEReader = 28`: PDEReader object - `kPDEWriter = 29`: PDEWriter object - `kPDETextItem = 30`: PDETextItem object - `kPDEImageFlate = 31`: PDEImageFlate object - `kPDEImageJPX = 32`: PDEImageJPX object - `kJPXColorSpace = 33`: JPXColorSpace object - `kJPXPalette = 34`: JPXPalette object - `kPDEGraphicFont = 35` - `kPDELastType = 36` **See also:** [`PDEObjectGetType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEObjectGetType) ### Definitions (7) #### IN Header: `PEExpT.h:73` #### OUT Header: `PEExpT.h:74` #### PEX1 Header: `PEExpT.h:49` Value: `ACEX1` #### PEX2 Header: `PEExpT.h:50` Value: `ACEX2` #### kPDEAfterLast Header: `PEExpT.h:1605` Value: `(MAXInt32 - 1)` #### kPDEBeforeFirst Header: `PEExpT.h:1604` Value: `((ASInt32)-1)` #### kPDFStateSetAll Header: `PEExpT.h:699` Value: `((ASUns32)-1)` ## JPXColorSpace ### Functions (4) #### JPXColorSpaceAcquireNext ```cpp JPXColorSpace JPXColorSpaceAcquireNext(IN JPXColorSpace jpxColorSpace) ``` Header: `PERProcs.h:2915` Acquires the next JPX color space defined with the JPX encoded image in the link list, if one exists. This object is acquired and must be released using PDERelease() when it is no longer in use. @since **Parameters** - `jpxColorSpace` (`IN JPXColorSpace`): IN/OUT A JPX color space object. **Returns:** [`JPXColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#JPXColorSpace) **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEImageJPXAcquireJPXColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageJPXAcquireJPXColorSpace) #### JPXColorSpaceGetEnumAttrs ```cpp ASBool JPXColorSpaceGetEnumAttrs(IN JPXColorSpace jpxColorSpace, OUT JPXCSEnumAttrsP jpxCSEnumAttrsP) ``` Header: `PERProcs.h:2949` Gets the attributes of an enumerated color space. It returns `false` if the color space is not kJPXCSEnumerated. **Parameters** - `jpxColorSpace` (`IN JPXColorSpace`): IN/OUT A JPX color space object. - `jpxCSEnumAttrsP` (`OUT JPXCSEnumAttrsP`): IN/OUT (filled in by the method) Attributes of a JPX enumerated color space. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the JPX color space is kJPXCSEnumerated **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEImageJPXAcquireJPXColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageJPXAcquireJPXColorSpace) #### JPXColorSpaceGetProfile ```cpp ASInt32 JPXColorSpaceGetProfile(IN JPXColorSpace jpxColorSpace, OUT ASUns8 *profile, IN ASInt32 profileLength) ``` Header: `PERProcs.h:2966` Gets the color profile of an ICC-based JPX color space. If `profile` is `0`, it returns the length of the profile in bytes; otherwise it returns the number of bytes copied to `profile`. **Parameters** - `jpxColorSpace` (`IN JPXColorSpace`): IN/OUT A JPX color space object. - `profile` (`OUT ASUns8 *`): IN/OUT (Filled by the method) The profile of the JPX color space. - `profileLength` (`IN ASInt32`): IN/OUT The byte length of the user-supplied profile buffer. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEImageJPXAcquireJPXColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageJPXAcquireJPXColorSpace) #### JPXColorSpaceGetType ```cpp JPXColorSpaceType JPXColorSpaceGetType(IN JPXColorSpace jpxColorSpace) ``` Header: `PERProcs.h:2934` Returns the type of JPX color space: • kJPXCSUnknown • kJPXCSEnumerated • kJPXCSRestrictedICC • kJPXCSAnyICC • kJPXCSVenderColor @since **Parameters** - `jpxColorSpace` (`IN JPXColorSpace`): IN/OUT A JPX color space object. **Returns:** [`JPXColorSpaceType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#JPXColorSpaceType) **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEImageJPXAcquireJPXColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageJPXAcquireJPXColorSpace) ### Structures (1) #### JPXColorSpace ```cpp typedef struct _t_JPXColorSpace* JPXColorSpace ``` Header: `PEExpT.h:423` A reference to a JPXColorSpace. ### Enums (1) #### JPXColorSpaceType Header: `PEExpT.h:2426` JPX Color Space types. **Values** - `kJPXCSUnknown = 0x0000` - `kJPXCSEnumerated = 0x0001` - `kJPXCSRestrictedICC = 0x0002` - `kJPXCSAnyICC = 0x0003` - `kJPXCSVenderColor = 0x0004` ## JPXPalette ### Functions (4) #### JPXPaletteGetBitDepths ```cpp void JPXPaletteGetBitDepths(IN JPXPalette jpxPalette, OUT ASInt32 *bitDepths) ``` Header: `PERProcs.h:2871` Returns the bit depths of the color values represented in the palette. The length of the array must be at least the number of components. @since **Parameters** - `jpxPalette` (`IN JPXPalette`): IN/OUT A JPX-encoded image object. - `bitDepths` (`OUT ASInt32 *`): IN/OUT (Filled by the method) An array of bit depths for each component. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEImageJPXAcquirePalette`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageJPXAcquirePalette) #### JPXPaletteGetNumComponents ```cpp ASInt32 JPXPaletteGetNumComponents(IN JPXPalette jpxPalette) ``` Header: `PERProcs.h:2883` Returns the number of color components represented by the palette. @since **Parameters** - `jpxPalette` (`IN JPXPalette`): IN/OUT A JPX encoded image object. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEImageJPXAcquirePalette`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageJPXAcquirePalette) #### JPXPaletteGetNumEntries ```cpp ASInt32 JPXPaletteGetNumEntries(IN JPXPalette jpxPalette) ``` Header: `PERProcs.h:2858` Returns the number of palette entries. @since **Parameters** - `jpxPalette` (`IN JPXPalette`): IN/OUT A JPX encoded image object. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEImageJPXAcquirePalette`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageJPXAcquirePalette) #### JPXPaletteGetTable ```cpp ASStm JPXPaletteGetTable(IN JPXPalette jpxPalette, OUT ASInt32 *paletteLength) ``` Header: `PERProcs.h:2900` Returns the palette data as a read only non-seekable ASStm. The returned ASStm should be read with ASStmRead(). Each component entry in the palette is represented by the number of bytes needed to contain the bit depth for that component. @since **Parameters** - `jpxPalette` (`IN JPXPalette`): IN/OUT A JPX encoded image object. - `paletteLength` (`OUT ASInt32 *`): IN/OUT (Filled by the method) The length of the palette data. **Returns:** [`ASStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStm) **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEImageJPXHasPalette`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageJPXHasPalette), [`PDEImageJPXAcquirePalette`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageJPXAcquirePalette) ### Structures (1) #### JPXPalette ```cpp typedef struct _t_JPXPalette* JPXPalette ``` Header: `PEExpT.h:427` A reference to a JPXPalette. ## PDEBeginContainer ### Functions (5) #### PDEBeginContainerCreate ```cpp PDEBeginContainer PDEBeginContainerCreate(IN ASAtom mcTag, IN CosObj *cosObjP, IN ASBool isInline) ``` Header: `PEWProcs.h:1653` Creates a new PDEBeginContainer object. Call PDERelease to dispose of the returned PDEBeginContainer object when finished with it. Call PDERelease() to dispose of the returned PDEBeginContainer object when finished with it. **Parameters** - `mcTag` (`IN ASAtom`): IN/OUT The tag name for the marked-content sequence. - `cosObjP` (`IN CosObj *`): IN/OUT (May be `NULL`) A CosDict object containing the property list for the sequence. - `isInline` (`IN ASBool`): If `true`, it emits the container's dictionary into the content stream inline. If `false`, then the dictionary is emitted outside of the content stream and referenced by name. See the Property Lists section of the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 14.6.2, page 554. This document is provided on the web site of the International Standards Organization (ISO). **Returns:** [`PDEBeginContainer`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEBeginContainer) The newly created object. #### PDEBeginContainerGetDict ```cpp ASBool PDEBeginContainerGetDict(IN PDEBeginContainer pdeBeginContainer, OUT CosObj *dictP, OUT ASBool *isInlineP) ``` Header: `PERProcs.h:1884` Gets the property list dictionary associated with a PDEBeginContainer object. The property list is stored in a Cos dictionary. @note Either `dictP` or `isInlineP` may be `NULL` if that information is not required. **Parameters** - `pdeBeginContainer` (`IN PDEBeginContainer`): IN/OUT A PDEBeginContainer object. - `dictP` (`OUT CosObj *`): IN/OUT (Filled by the method) The property list associated with the PDEBeginContainer. - `isInlineP` (`OUT ASBool *`): IN/OUT (Filled by the method) If `true`, the dictionary is emitted into the page content stream inline.`true` if dictP points to a Cos dictionary; `false` otherwise. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) **Exceptions** - `peErrWrongPDEObjectType`: if `pdeBeginContainer` is `NULL` or not the right type. #### PDEBeginContainerGetMCTag ```cpp ASAtom PDEBeginContainerGetMCTag(IN PDEBeginContainer pdeBeginContainer) ``` Header: `PERProcs.h:1864` Gets the marked content tag associated with a PDEBeginContainer object. **Parameters** - `pdeBeginContainer` (`IN PDEBeginContainer`): IN/OUT A PDEBeginContainer object. **Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom) The mark content tag. **Exceptions** - `peErrWrongPDEObjectType`: if pdeBeginContainer is `NULL` or not the right type. **See also:** [`PDEBeginContainerSetMCTag`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEBeginContainerSetMCTag) #### PDEBeginContainerSetDict ```cpp void PDEBeginContainerSetDict(IN PDEBeginContainer pdeBeginContainer, IN CosObj *pdeBeginContainerDictP, IN ASBool isInline) ``` Header: `PEWProcs.h:1691` Sets the property list for a PDEBeginContainer. The property list is passed as a Cos dictionary that can be emitted inline or referenced from the `\\Properties` key in the `\\Resources` dictionary of the containing stream. To learn about Property Lists for isInline, see the ISO 32000-:2008 document (1.7). This document is provided on the web site of the International Standards Organization (ISO). @note If cosObjP is `NULL`, the property list is cleared. **Parameters** - `pdeBeginContainer` (`IN PDEBeginContainer`): IN/OUT The PDEBeginContainer object.`NULL`) The Cos dictionary containing the property list. - `pdeBeginContainerDictP` (`IN CosObj *`) - `isInline` (`IN ASBool`): If `true`, it emits the container's dictionary into the content stream inline. If `false`, then the dictionary is emitted outside of the content stream and referenced by name. See the Property Lists section of the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 14.6.2, page 554. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType`: is raised if `pdeBeginContainer` is `NULL` or not the right type. #### PDEBeginContainerSetMCTag ```cpp void PDEBeginContainerSetMCTag(IN PDEBeginContainer pdeBeginContainer, IN ASAtom mcTag) ``` Header: `PEWProcs.h:1665` Sets the marked content tag for a PDEBeginContainer. **Parameters** - `pdeBeginContainer` (`IN PDEBeginContainer`): IN/OUT The PDEBeginContainer object. - `mcTag` (`IN ASAtom`): IN/OUT The tag name. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType`: if `pdeBeginContainer` is `NULL` or is not the right type. ### Structures (1) #### PDEBeginContainer ```cpp typedef struct _t_PDEBeginContainer* PDEBeginContainer ``` Header: `PEExpT.h:273` The PDFEdit representation of the opening bracket of a marked-content sequence. Elements of this type must be paired with elements of type PDEEndContainer. **See also:** `PDEElement (superclass)`, [`PDEBeginContainerCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEBeginContainerCreate), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease) ## PDEBeginGroup ### Functions (1) #### PDEBeginGroupCreate ```cpp PDEBeginGroup PDEBeginGroupCreate() ``` Header: `PEWProcs.h:1997` Creates a new begin group object. Call PDERelease() to dispose of the returned PDEBeginGroup object when finished with it. **Returns:** [`PDEBeginGroup`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEBeginGroup) The newly created object. ### Structures (1) #### PDEBeginGroup ```cpp typedef struct _t_PDEBeginGroup* PDEBeginGroup ``` Header: `PEExpT.h:288` A group of PDEElement objects on a page in a PDF file. **See also:** `PDEElement (superclass)`, [`PDEBeginGroupCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEBeginGroupCreate), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease) ## PDEClip ### Functions (7) #### PDEClipAddElem ```cpp void PDEClipAddElem(IN PDEClip clip, IN ASInt32 addAfterIndex, IN PDEElement pdeElement) ``` Header: `PEWProcs.h:656` Adds an element to a clip path. **Note:** This method increments the reference count of `pdeElement`. **Parameters** - `clip` (`IN PDEClip`): IN/OUT The clip path to which an element is added. - `addAfterIndex` (`IN ASInt32`): IN/OUT The index after which to add `pdeElement`. Use kPDEBeforeFirst to insert an element at the beginning of the clip object. - `pdeElement` (`IN PDEElement`): IN/OUT The element added, which may be a PDEPath, a PDEText, a PDEContainer, a PDEGroup, or a PDEPlace object. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDEClipRemoveElems`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEClipRemoveElems) #### PDEClipCopy ```cpp PDEClip PDEClipCopy(IN PDEClip srcClip) ``` Header: `PEWProcs.h:1555` Makes a deep copy of a PDEClip object. Call PDERelease() to dispose of the returned clip object when finished with it. It raises an exception if it is unable to allocate memory. **Parameters** - `srcClip` (`IN PDEClip`): IN/OUT The clipping path to copy. **Returns:** [`PDEClip`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEClip) The deep copy of `srcClip`. #### PDEClipCreate ```cpp PDEClip PDEClipCreate(void) ``` Header: `PEWProcs.h:689` Creates an empty clip object. This represents a clipping object that has no effect on elements that refer to it. Call PDERelease() to dispose of the returned clip object when finished with it. It raises an exception if it is unable to allocate memory. **Parameters** - (unnamed) (`void`) **Returns:** [`PDEClip`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEClip) The newly created clip object. #### PDEClipFlattenedEnumElems ```cpp ASBool PDEClipFlattenedEnumElems(IN PDEClip clip, IN PDEClipEnumProc enumProc, IN void *enumProcClientData) ``` Header: `PERProcs.h:1658` For a given PDEClip, this enumerates all of the PDEElement objects in a flattened manner. In other words, PDEContainer objects and PDEGroup objects nested in the PDEClip will not be handed back, but any PDEPath objects and PDEText objects nested in them will be. Additionally, PDEPlace objects inside the PDEClip are not returned. **Parameters** - `clip` (`IN PDEClip`): The PDEClip to enumerate. - `enumProc` (`IN PDEClipEnumProc`): Called with each flattened element. Enumeration continues until all elements have been enumerated, or until `enumProc` returns `false`. - `enumProcClientData` (`IN void *`): A pointer to user-supplied data to pass to `enumProc` each time it is called. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) Returns the value of `enumProc`. It returns `true` if successful, `false` otherwise. **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDEClipCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEClipCreate), [`PDEClipGetElem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEClipGetElem), [`PDEClipGetNumElems`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEClipGetNumElems) #### PDEClipGetElem ```cpp PDEElement PDEClipGetElem(IN PDEClip clip, IN ASInt32 index) ``` Header: `PERProcs.h:962` Gets an element from a clip object. **Note:** This method does not change the reference count of the returned PDEElement. **Parameters** - `clip` (`IN PDEClip`): IN/OUT The clip object from which an element is obtained. - `index` (`IN ASInt32`): IN/OUT The index of the element to get from `clip`. **Returns:** [`PDEElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElement) The element from the clip object. **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDEClipGetNumElems`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEClipGetNumElems) #### PDEClipGetNumElems ```cpp ASInt32 PDEClipGetNumElems(IN PDEClip clip) ``` Header: `PERProcs.h:945` Gets the number of top-level elements in a clip object. Top-level elements may be a path or charpath, a marked content container or place, or a group. Paths are represented as PDEPath objects; charpaths are represented as PDEText objects. **Note:** PDEGroup is not a persistent object. You cannot save to PDF and re-get group objects. **Parameters** - `clip` (`IN PDEClip`): IN/OUT The clip object to examine. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The number of path and charpath elements in clip. If `clip` contains PDEGroup objects, this method returns the top-level PDEPath, PDEText, PDEContainer, PDEGroup, or PDEPlace object. Use PDEClipFlattenedEnumElems() to see only the PDEPath and PDEText objects. **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDEClipFlattenedEnumElems`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEClipFlattenedEnumElems), [`PDEClipGetElem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEClipGetElem) #### PDEClipRemoveElems ```cpp void PDEClipRemoveElems(IN PDEClip clip, IN ASInt32 index, IN ASInt32 count) ``` Header: `PEWProcs.h:674` Removes one or more elements from a clip object. **Note:** This method decrements the reference count of each of the elements. **Parameters** - `clip` (`IN PDEClip`): IN/OUT The clip object from which an element is removed. - `index` (`IN ASInt32`): IN/OUT The first element to remove. - `count` (`IN ASInt32`): IN/OUT The number of elements to remove. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDEClipAddElem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEClipAddElem) ### Typedefs (1) #### PDEClipEnumProc ```cpp typedef ASBool(*) PDEClipEnumProc(IN PDEElement elem, IN void *clientData)(IN PDEElement elem, IN void *clientData) ``` Header: `PEExpT.h:2105` A callback for PDEClipFlattenedEnumElems(), which enumerates all of a PDEClip object's PDEElement objects in a flattened manner. **See also:** [`PDEClipFlattenedEnumElems`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEClipFlattenedEnumElems) ### Structures (1) #### PDEClip ```cpp typedef struct _t_PDEClip* PDEClip ``` Header: `PEExpT.h:338` A list of PDEElement objects containing a list of PDEPath objects and PDEText objects that describe a clip state. PDEClip objects can be created and built up with PDEClip methods. Any PDEElement object can have PDEClip associated with it. PDEClip objects can contain PDEContainer objects and PDEGroup objects to an arbitrary level of nesting. This allows PDEContainer objects to be used to mark clip objects. PDEGroup objects inside PDEClip objects that contain at least one PDEText and no PDEPath objects have a special meaning. All PDEText objects contained in such a PDEGroup are considered to be part of the same BT/ET block. This means that the union of these PDEText objects makes up a single clipping path, as opposed to the intersection of the PDEText objects. **See also:** [`PDEClipCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEClipCreate), [`PDEElementGetClip`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetClip), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease), [`PDEClipFlattenedEnumElems`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEClipFlattenedEnumElems) ## PDEColorSpace ### Functions (12) #### PDEColorSpaceCreate ```cpp PDEColorSpace PDEColorSpaceCreate(ASAtom family, PDEColorSpaceStruct *csStruct) ``` Header: `PEWProcs.h:1435` Creates a new color space object of the specified type. Call PDERelease() to dispose of the returned color space object when finished with it. Type of names Names Device-dependent names `DeviceCMYK` `DeviceGray` `DeviceN` `DeviceRGB` Device-independent names `CalGray` `CalRGB` `Lab` `ICCBased` Special names `Indexed` `Pattern` `Separation` **Parameters** - `family` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): IN/OUT Supports all PDF 1.3 color spaces, which include: - `csStruct` (`PDEColorSpaceStruct *`): IN/OUT Data for the type of color space you want to create. **Returns:** [`PDEColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpace) The newly created color space object. **Exceptions** - `cosErrExpectedArray` - `genErrBadParm` - `peErrUnknownPDEColorSpace` **See also:** [`PDEColorSpaceCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpaceCreateFromCosObj) #### PDEColorSpaceCreateFromCosObj ```cpp PDEColorSpace PDEColorSpaceCreateFromCosObj(IN const CosObj *cosObjP) ``` Header: `PEWProcs.h:956` Creates a new color space object from a Cos object. Call PDERelease() to dispose of the returned color space object when finished with it. Type of names Names Device-dependent names `DeviceCMYK` `DeviceGray` `DeviceN` `DeviceRGB` Device-independent names `CalGray` `CalRGB` `Lab` `ICCBased` Special names `Indexed` `Pattern` `Separation` **Parameters** - `cosObjP` (`IN const CosObj *`): IN/OUT Supports all PDF 1.3 color spaces, which include: **Returns:** [`PDEColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpace) The newly created color space object. **Exceptions** - `cosErrExpectedArray` - `genErrBadParm` - `peErrUnknownPDEColorSpace` **See also:** [`PDEColorSpaceCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpaceCreate), [`PDEColorSpaceCreateFromName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpaceCreateFromName) #### PDEColorSpaceCreateFromName ```cpp PDEColorSpace PDEColorSpaceCreateFromName(IN ASAtom name) ``` Header: `PEWProcs.h:929` Creates a new color space object. Call PDERelease() to dispose of the returned color space object when finished with it. **Parameters** - `name` (`IN ASAtom`): IN/OUT The ASAtom for the name of the color space created. The name must be one of the following: DeviceCMYK, DeviceGray, or DeviceRGB. **Returns:** [`PDEColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpace) The newly created color space object. **Exceptions** - `cosErrExpectedName` - `genErrBadParm` - `peErrUnknownPDEColorSpace` **See also:** [`PDEColorSpaceCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpaceCreate), [`PDEColorSpaceCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpaceCreateFromCosObj) #### PDEColorSpaceCreateInCosDoc ```cpp PDEColorSpace PDEColorSpaceCreateInCosDoc(IN ASAtom family, IN PDEColorSpaceStruct *csStruct, IN CosDoc cosDoc) ``` Header: `PEWProcs.h:3099` Creates a color space object like PDEColorSpaceCreate(), except that the client can specify the CosDoc in which the color space object is created. Call PDERelease() to dispose of the returned color space object when finished with it. Type of names Names Device-dependent names `DeviceCMYK` `DeviceGray` `DeviceN` `DeviceRGB` Device-independent names `CalGray` `CalRGB` `Lab` `ICCBased` Special names `Indexed` `Pattern` `Separation` **Parameters** - `family` (`IN ASAtom`): IN/OUT Supports all PDF 1.3 color spaces, which include: - `csStruct` (`IN PDEColorSpaceStruct *`): IN/OUT Data for the type of color space you want to create. - `cosDoc` (`IN CosDoc`): IN/OUT The document in which to put the Cos representation of resource. It may be `NULL`. **Returns:** [`PDEColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpace) The newly created color space object. **Exceptions** - `cosErrExpectedArray` - `genErrBadParm` - `peErrUnknownPDEColorSpace` **See also:** [`PDEColorSpaceCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpaceCreateFromCosObj) #### PDEColorSpaceGetBase ```cpp ASAtom PDEColorSpaceGetBase(IN PDEColorSpace colorSpace) ``` Header: `PERProcs.h:1165` Gets the name of the base color space. This is a helper routine for indexed color spaces. Call this method to obtain the base color space and color values for an uncolored pattern in PDFEdit. Note that the base color values are in the color array in the `PDEColorValue` field for stroke and fill of a PDEGraphicStateP. Or, they are in the `colorObj2` object if the base color space is DeviceN. To get the color values, a client gets the base color space, determines the type and number of components of the value, and looks them up in the `PDEColorValue` field. **Parameters** - `colorSpace` (`IN PDEColorSpace`): The base color space. **Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom) The ASAtom for the name of the base color space. Use ASAtomGetString() to obtain a C string for the ASAtom. **Exceptions** - `peErrUnknownPDEColorSpace` - `peErrWrongPDEObjectType` **See also:** [`PDEColorSpaceGetBaseNumComps`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpaceGetBaseNumComps) #### PDEColorSpaceGetBaseNumComps ```cpp ASInt32 PDEColorSpaceGetBaseNumComps(IN PDEColorSpace colorSpace) ``` Header: `PERProcs.h:1456` Gets the number of components in the base color space of an indexed color space. For example, for `[/ Indexed / DeviceRGB...]`, the number of components is `3`. **Parameters** - `colorSpace` (`IN PDEColorSpace`): IN/OUT The indexed color space. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The number of components in `colorSpace`. **Exceptions** - `peErrUnknownPDEColorSpace` - `peErrWrongPDEObjectType` **See also:** [`PDEColorSpaceGetBase`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpaceGetBase), [`PDEColorSpaceGetNumComps`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpaceGetNumComps) #### PDEColorSpaceGetCTable ```cpp void PDEColorSpaceGetCTable(IN PDEColorSpace colorSpace, OUT ASUns8 *colorTableP) ``` Header: `PERProcs.h:1197` Gets the component information for an indexed color space. **Parameters** - `colorSpace` (`IN PDEColorSpace`): IN/OUT The color space whose component information table is obtained. - `colorTableP` (`OUT ASUns8 *`): IN/OUT (Filled by the method) The color lookup table, which is `numComps * (hiVal + 1)` bytes long, where `numComps` is the number of components in the base `colorSpace`. Each entry in the table contains `numComps` bytes, and the table is indexed from `0` to `hiVal`, where `hiVal` is the highest index in the color table. The table is indexed from `0` to `hival`, thus the table contains `hival + 1` entries. **Returns:** `void` **Exceptions** - `peErrUnknownPDEColorSpace` - `peErrWrongPDEObjectType` #### PDEColorSpaceGetCosObj ```cpp void PDEColorSpaceGetCosObj(IN PDEColorSpace colorSpace, OUT CosObj *cosObjP) ``` Header: `PERProcs.h:1112` Gets the CosObj representation of the color space object. For image masks, use PDEElementGetGState() to obtain color information. **Parameters** - `colorSpace` (`IN PDEColorSpace`): IN/OUT The color space whose Cos object is obtained. - `cosObjP` (`OUT CosObj *`): IN/OUT (Filled by the method) The Cos object for the color space. **Returns:** `void` The Cos object for `colorSpace`. Any color space that is in the Resources dictionary of the page is returned as a Cos object. **Exceptions** - `peErrWrongPDEObjectType` #### PDEColorSpaceGetHiVal ```cpp ASInt32 PDEColorSpaceGetHiVal(IN PDEColorSpace colorSpace) ``` Header: `PERProcs.h:1178` Gets the highest index for the color lookup table for an indexed color space. Since the color table is indexed from zero to `hiVal`, the actual number of entries is `hiVal + 1`. **Parameters** - `colorSpace` (`IN PDEColorSpace`): IN/OUT An indexed color space. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The highest index (`hiVal`) in the color lookup table. **Exceptions** - `peErrUnknownPDEColorSpace` #### PDEColorSpaceGetName ```cpp ASAtom PDEColorSpaceGetName(IN PDEColorSpace colorSpace) ``` Header: `PERProcs.h:1094` Gets the name of a color space object. Type of names Names Device-dependent names `DeviceCMYK` `DeviceGray` `DeviceN` `DeviceRGB` Device-independent names `CalGray` `CalRGB` `Lab` `ICCBased` Special names `Indexed` `Pattern` `Separation` **Parameters** - `colorSpace` (`IN PDEColorSpace`): IN/OUT A color space object. **Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom) The color space object's name. It supports all PDF 1.3 color spaces, which include: **Exceptions** - `peErrUnknownPDEColorSpace` #### PDEColorSpaceGetNumComps ```cpp ASInt32 PDEColorSpaceGetNumComps(IN PDEColorSpace colorSpace) ``` Header: `PERProcs.h:1141` Calculates the number of components in a color space. Color space Return value DeviceGray `1` CalGray `1` Separation `1` DeviceRGB `3` CalRGB `3` DeviceCMYK `4` Lab `4` DeviceN The number of components dependent on the specific color space object. ICCBased The number of components dependent on the specific color space object. Indexed `1` Call PDEColorSpaceGetBaseNumComps() to get the number of components in the base color space. **Parameters** - `colorSpace` (`IN PDEColorSpace`): IN/OUT A color space object. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The number of components in `colorSpace`: **Exceptions** - `peErrUnknownPDEColorSpace` - `peErrWrongPDEObjectType` **See also:** [`PDEColorSpaceGetBaseNumComps`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpaceGetBaseNumComps) #### PDEColorSpaceGetStruct ```cpp void PDEColorSpaceGetStruct(IN PDEColorSpace cs, OUT PDEColorSpaceStruct *pdeColorSpaceStruct) ``` Header: `PERProcs.h:2980` Retrieves a `PDEColorSpaceStruct` from a `PDEColorSpace`. It supports all PDF version 1.3 color spaces except the `Pattern` color space. It is the responsibility of the caller to free the `PDEColorSpaceStruct` and the underlying allocations. **Parameters** - `cs` (`IN PDEColorSpace`): IN/OUT The `PDEColorSpace` for which the structure is required. - `pdeColorSpaceStruct` (`OUT PDEColorSpaceStruct *`): IN/OUT The `PDEColorSpaceStruct` created for the color space. **Returns:** `void` **Exceptions** - `peErrUnknownPDEColorSpace` - `genErrBadParm` **See also:** [`PDEColorSpaceCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpaceCreate) ### Typedefs (3) #### PDEBlackPointFlt ```cpp typedef PDEXYZColorFlt PDEBlackPointFlt ``` Header: `PEExpT.h:2170` A structure describing a black point in a calibrated color space. **See also:** [`PDEColorSpaceCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpaceCreate) #### PDEPatternColorSpace ```cpp typedef PDEColorSpace PDEPatternColorSpace ``` Header: `PEExpT.h:2245` A PDEColorSpace that describes a Pattern color space. **See also:** [`PDEColorSpaceCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpaceCreate) #### PDEWhitePointFlt ```cpp typedef PDEXYZColorFlt PDEWhitePointFlt ``` Header: `PEExpT.h:2164` A structure describing a white point in a calibrated color space. **See also:** [`PDEColorSpaceCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpaceCreate) ### Structures (1) #### PDEColorSpace ```cpp typedef struct _t_PDEColorSpace* PDEColorSpace ``` Header: `PEExpT.h:322` A reference to a color space used on a page in a PDF file. The color space is part of the graphics state attributes of a PDEElement. **See also:** [`PDEColorSpaceCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpaceCreate), [`PDEColorSpaceCreateFromName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpaceCreateFromName), [`PDEImageGetColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetColorSpace), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease) ## PDEContainer ### Functions (7) #### PDEContainerCreate ```cpp PDEContainer PDEContainerCreate(IN ASAtom mcTag, IN CosObj *cosObjP, IN ASBool isInline) ``` Header: `PEWProcs.h:1180` Creates a container object. Call PDERelease() to dispose of the returned container object when finished with it. **Parameters** - `mcTag` (`IN ASAtom`): IN/OUT The tag name for the container. - `cosObjP` (`IN CosObj *`): IN/OUT An optional Marked Content dictionary for the container. - `isInline` (`IN ASBool`): If `true`, it emits the container's dictionary into the content stream inline. If `false`, then the dictionary is emitted outside of the content stream and referenced by name. See the Property Lists section of the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 14.6.2, page 554. This document is provided on the web site of the International Standards Organization (ISO). **Returns:** [`PDEContainer`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContainer) The newly created container object. **Exceptions** - `pdErrOpNotPermitted` **See also:** [`PDEContainerGetMCTag`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContainerGetMCTag), [`PDEContainerSetMCTag`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContainerSetMCTag) #### PDEContainerGetContent ```cpp PDEContent PDEContainerGetContent(IN PDEContainer pdeContainer) ``` Header: `PERProcs.h:1438` Gets the PDEContent for a PDEContainer. **Note:** This method does not change the reference count of the returned PDEContent. **Parameters** - `pdeContainer` (`IN PDEContainer`): IN/OUT The container whose content is obtained. **Returns:** [`PDEContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContent) The PDEContent for the `pdeContainer`. **Exceptions** - `pdErrOpNotPermitted` - `peErrWrongPDEObjectType` **See also:** [`PDEContainerSetContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContainerSetContent) #### PDEContainerGetDict ```cpp ASBool PDEContainerGetDict(IN PDEContainer pdeContainer, OUT CosObj *placeDictP, OUT ASBool *isInline) ``` Header: `PERProcs.h:1422` Gets the Marked Content dictionary for a container. **Parameters** - `pdeContainer` (`IN PDEContainer`): IN/OUT A container. - `placeDictP` (`OUT CosObj *`): IN/OUT (Filled by the method) The Marked Content dictionary for `pdeContainer`. `NULL` if `pdeContainer` has no Marked Content dictionary. - `isInline` (`OUT ASBool *`): IN/OUT (Filled by the method) `true` if the dictionary is inline, `false` otherwise. It is undefined if `pdeContainer` has no Marked Content dictionary. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if `pdeContainer` has a Marked Content dictionary, `false` otherwise. **Exceptions** - `peErrWrongPDEObjectType` - `cosErrInvalidObj` **See also:** [`PDEContainerSetDict`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContainerSetDict) #### PDEContainerGetMCTag ```cpp ASAtom PDEContainerGetMCTag(IN PDEContainer pdeContainer) ``` Header: `PERProcs.h:1403` Gets the Marked Content tag for a container. **Parameters** - `pdeContainer` (`IN PDEContainer`): IN/OUT A container. **Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom) The Marked Content tag of `pdeContainer`. It returns ASAtomNull if `pdeContainer` has no Marked Content tag. **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDEContainerCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContainerCreate), [`PDEContainerSetMCTag`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContainerSetMCTag) #### PDEContainerSetContent ```cpp void PDEContainerSetContent(IN PDEContainer pdeContainer, IN PDEContent pdeContent) ``` Header: `PEWProcs.h:1233` Sets the content for a container. The existing PDEContent is released by this method. **Note:** This method decrements the reference count of the previous content of the container and increments the reference count of the new PDEContent. **Parameters** - `pdeContainer` (`IN PDEContainer`): IN/OUT A container. - `pdeContent` (`IN PDEContent`): IN/OUT The content of `pdeContainer`. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDEContainerGetContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContainerGetContent) #### PDEContainerSetDict ```cpp void PDEContainerSetDict(IN PDEContainer pdeContainer, IN CosObj *placeDictP, IN ASBool isInline) ``` Header: `PEWProcs.h:1216` Sets the Marked Content dictionary for a PDEContainer. The dictionary can be emitted inline or referenced from the `\Properties` key in the `\Resources` dictionary of the containing stream. **Parameters** - `pdeContainer` (`IN PDEContainer`): The container whose dictionary is changed. - `placeDictP` (`IN CosObj *`): The Marked Content dictionary being set into `pdeContainer`. - `isInline` (`IN ASBool`): If `true`, it emits the container's dictionary into the content stream inline. If `false`, then the dictionary is emitted outside of the content stream and referenced by name. See the Property Lists section of the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 14.6.2, page 554. This document is provided on the web site of the International Standards Organization (ISO). **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDEContainerGetDict`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContainerGetDict) #### PDEContainerSetMCTag ```cpp void PDEContainerSetMCTag(IN PDEContainer pdeContainer, IN ASAtom mcTag) ``` Header: `PEWProcs.h:1193` Sets the Marked Content tag for a PDEContainer. **Parameters** - `pdeContainer` (`IN PDEContainer`): IN/OUT The container to tag. - `mcTag` (`IN ASAtom`): IN/OUT The Marked Content tag. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDEContainerCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContainerCreate), [`PDEContainerGetMCTag`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContainerGetMCTag) ### Structures (1) #### PDEContainer ```cpp typedef struct _t_PDEContainer* PDEContainer ``` Header: `PEExpT.h:248` A group of PDEElement objects on a page in a PDF file. In the PDF file, containers are delimited by Marked Content BMC/EMC or BDC/EMC pairs. Every PDEContainer has a Marked Content tag associated with it. In addition to grouping a set of elements, a BDC/EMC pair specifies a property list to be associated with the grouping. Thus, a PDEContainer corresponding to a BDC/EMC pair also has a property list dictionary associated with it. **See also:** [`PDEContainerCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContainerCreate), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease) ## PDEContent ### Functions (20) #### PDEContentAddElem ```cpp void PDEContentAddElem(IN PDEContent pdeContent, IN ASInt32 addAfterIndex, IN PDEElement pdeElement) ``` Header: `PEWProcs.h:145` Inserts an element into a PDEContent. **Note:** This method increments the reference count of `pdeElement`. **Parameters** - `pdeContent` (`IN PDEContent`): The content to which `pdeElement` is added. - `addAfterIndex` (`IN ASInt32`): The location after which `pdeElement` is added. It should be kPDEBeforeFirst to add to the beginning of the display list. - `pdeElement` (`IN PDEElement`): The element to add to `pdeContent`. The reference count of `pdeElement` is incremented. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDEContentRemoveElem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentRemoveElem) #### PDEContentAddPage ```cpp void PDEContentAddPage(OUT PDEContent theContent, IN ASInt32 insertAfterIndex, IN CosDoc containerDoc, IN PDPage srcPage, IN ASFixedMatrix *dstMatrix, IN ASAtom annotTypes[], IN ASInt32 flags, IN ASFixedRect *bbox) ``` Header: `PEWProcs.h:1606` Superseded by PDEContentAddPageEx() in Acrobat 10.0. Adds the specfied PDPage to the PDEContent as an Xobject form. It adds a reference to the Xobject form at the indicated index in the PDE Content; the index may be less than `0`, which indicates the object is to be appended to the content. **Parameters** - `theContent` (`OUT PDEContent`): The content to set for the page. - `insertAfterIndex` (`IN ASInt32`): The index indicates the location after which the specified element is to be added. The index should be kPDBeforeFirst to add to the beginning of the display list. - `containerDoc` (`IN CosDoc`): The CosDoc in which the page is contained. - `srcPage` (`IN PDPage`): The page that will be inserted at `insertAfterIndex` in `theContent`. - `dstMatrix` (`IN ASFixedMatrix *`): (May be `NULL`) The matrix applied to the default matrix of the PDPage that is inserted into the CosDoc. - `annotTypes` (`IN ASAtom`): If the page contains annotations, the `annotTypes` list is used to determine which annotation types are pumped into the page contents of the CosDoc. This list is a list of atoms of the subtypes of annotations to be included. When the list is NULL, all Annotations are excluded. NOTE: The annotations included will not be included AS annotations. Rather, visible Annotations will be included in content. - `flags` (`IN ASInt32`): (May be `0`) - may be one of: Value Description kAnnotAll Copy all annotation types. If this is not set, then the `annotTypes` list will be consulted. kDoNotMergeFonts Do not merge duplicate fonts when copying. - `bbox` (`IN ASFixedRect *`): (May be `NULL`) specifies the destination `BBox` for the page being inserted. If it is `NULL`, the new page's media box is used. **Returns:** `void` **See also:** [`PDEContentAddPageEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentAddPageEx) #### PDEContentAddPageEx ```cpp void PDEContentAddPageEx(OUT PDEContent theContent, IN ASInt32 insertAfterIndex, IN CosDoc containerDoc, IN PDPage srcPage, IN ASDoubleMatrix *dstMatrix, IN ASAtom annotTypes[], IN ASInt32 flags, IN ASDoubleRect *bbox) ``` Header: `PEWProcs.h:3278` Adds the specfied PDPage to the PDEContent as an Xobject form. Supersedes PDEContentAddPage() in Acrobat 10.0. It adds a reference to the Xobject form at the indicated index in the PDE Content; the index may be less than `0`, which indicates the object is to be appended to the content. **Parameters** - `theContent` (`OUT PDEContent`): The content to set for the page. - `insertAfterIndex` (`IN ASInt32`): The index indicates the location after which the specified element is to be added. The index should be kPDBeforeFirst to add to the beginning of the display list. - `containerDoc` (`IN CosDoc`): The CosDoc in which the page is contained. - `srcPage` (`IN PDPage`): The page that will be inserted at `insertAfterIndex` in `theContent`. - `dstMatrix` (`IN ASDoubleMatrix *`): (May be `NULL`) The matrix applied to the default matrix of the PDPage that is inserted into the CosDoc. - `annotTypes` (`IN ASAtom`): If the page contains annotations, the `annotTypes` list is used to determine which annotation types are pumped into the page contents of the CosDoc. This list is a list of atoms of the subtypes of annotations to be included. When the list is NULL, all Annotations are excluded. NOTE: The annotations included will not be included AS annotations. Rather, visible Annotations will be included in content. - `flags` (`IN ASInt32`): (May be `0`) - may be one of: Value Description kAnnotAll Copy all annotation types. If this is not set, then the `annotTypes` list will be consulted. kDoNotMergeFonts Do not merge duplicate fonts when copying. - `bbox` (`IN ASDoubleRect *`): (May be `NULL`) specifies the destination `BBox` for the page being inserted. If it is `NULL`, the new page's media box is used. **Returns:** `void` **See also:** [`PDEContentAddPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentAddPage) #### PDEContentCopyResTable ```cpp void PDEContentCopyResTable(PDEContent src, PDEContent dst) ``` Header: `PERProcs.h:3460` Copies ResTable indexes count from source PDEContent to destination PDEContent. **Parameters** - `src` ([`PDEContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContent)) - `dst` ([`PDEContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContent)) **Returns:** `void` None **Since:** `PDFEditReadHFT_VERSION_10` #### PDEContentCreate ```cpp PDEContent PDEContentCreate(void) ``` Header: `PEWProcs.h:49` Creates an empty content object. Call PDERelease() to dispose of the returned content object when finished with it. **Note:** Do not use this method to create a PDEContent to be put into a PDPage. Instead, call PDPageAcquirePDEContent(). **Parameters** - (unnamed) (`void`) **Returns:** [`PDEContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContent) An empty content object. **Exceptions** - `peErrPStackUnderflow` **See also:** [`PDEContentCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentCreateFromCosObj), [`PDPageAcquirePDEContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageAcquirePDEContent) #### PDEContentCreateFromCosObj ```cpp PDEContent PDEContentCreateFromCosObj(const CosObj *contents, const CosObj *resources) ``` Header: `PERProcs.h:108` Creates a content object from a Cos object. This is the main method for obtaining a PDEContent object. Call PDERelease() to dispose of the returned content object when finished with it. **Parameters** - `contents` ([`const CosObj *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): IN/OUT A Cos object that is the source for the content. It may be page contents, a Form XObject, a Type 3 font CharProc, or an appearance dictionary for an annotation. - `resources` ([`const CosObj *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): IN/OUT The object's Resources dictionary. If the Form or Type 3 font or appearance dictionary contains a Resources dictionary, this dictionary must be passed in `resources`. Otherwise, it must be the page resources object of the page containing the Form or Type 3 font contents object. **Returns:** [`PDEContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContent) The content from the Cos object. **Exceptions** - `pdErrOpNotPermitted` - `peErrPStackUnderflow` **See also:** [`PDEContentCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentCreate), [`PDEContentToCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentToCosObj) #### PDEContentFlattenOC ```cpp ASBool PDEContentFlattenOC(PDEContent content, PDOCContext context) ``` Header: `PEWProcs.h:2335` Flattens the content, removing any PDEElement objects that are not visible in the given optional-content context, and removing the optional-content information from any visible PDFElement objects. **Parameters** - `content` ([`PDEContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContent)): The content to be modified. - `context` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The optional-content context in which `content` is checked for visibility. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the operation is successful, `false` otherwise. **See also:** [`PDDocFlattenOC`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocFlattenOC), [`PDPageFlattenOC`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageFlattenOC) #### PDEContentGetAttrs ```cpp void PDEContentGetAttrs(IN PDEContent pdeContent, OUT PDEContentAttrsP attrsP, IN ASUns32 attrsSize) ``` Header: `PERProcs.h:120` Gets the attributes of a content. **Parameters** - `pdeContent` (`IN PDEContent`): IN/OUT A content object. - `attrsP` (`OUT PDEContentAttrsP`): IN/OUT (Filled by the method) A pointer to a `PDEContentAttrs` structure containing the attributes of the content. - `attrsSize` (`IN ASUns32`): IN/OUT The size of the `attrsP` buffer in bytes. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` #### PDEContentGetDefaultColorSpace ```cpp PDEColorSpace PDEContentGetDefaultColorSpace(IN PDEContent pdeContent, IN ASAtom colorSpaceName) ``` Header: `PERProcs.h:1831` Gets a default color space from a PDEContent object. See the "Default Color Spaces" section of the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, under "CIE-Based Color Spaces" in section 8.6.5.6, page 152. You can find this document on the web store of the International Standards Organization (ISO). @note This method does not change the reference count of the returned PDEColorSpace. @since **Parameters** - `pdeContent` (`IN PDEContent`): IN/OUT A content object. - `colorSpaceName` (`IN ASAtom`): IN/OUT An ASAtom for the name of the desired color space. It must be an ASAtom for one of DefaultRGB, DefaultCMYK, or DefaultGray. **Returns:** [`PDEColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpace) **See also:** [`PDEContentGetNumElems`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentGetNumElems) #### PDEContentGetElem ```cpp PDEElement PDEContentGetElem(IN PDEContent pdeContent, IN ASInt32 index) ``` Header: `PERProcs.h:170` Gets the requested element from a content. **Note:** This method does not change the reference count of the element. **Note:** This method does not copy the element. **Parameters** - `pdeContent` (`IN PDEContent`): IN/OUT A content object. - `index` (`IN ASInt32`): IN/OUT The index of element to obtain. **Returns:** [`PDEElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElement) The requested element. **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEContentGetNumElems`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentGetNumElems) #### PDEContentGetElemsStatus ```cpp ASUns32 PDEContentGetElemsStatus(IN PDEContent pdeContent) ``` Header: `PERProcs.h:3410` **Parameters** - `pdeContent` (`IN PDEContent`) **Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32) #### PDEContentGetNumElems ```cpp ASInt32 PDEContentGetNumElems(IN PDEContent pdeContent) ``` Header: `PERProcs.h:153` Gets the number of elements in a PDEContent object. **Parameters** - `pdeContent` (`IN PDEContent`): IN/OUT A content object. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The number of elements in `pdeContent`. **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEContentGetElem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentGetElem) #### PDEContentGetResources ```cpp ASInt32 PDEContentGetResources(IN PDEContent pdeContent, IN ASInt32 type, OUT PDEObject *resourcesP) ``` Header: `PERProcs.h:142` Gets the number of resources of the specified type and, optionally, gets the pointers to the resource objects. **Parameters** - `pdeContent` (`IN PDEContent`): IN/OUT A content object. - `type` (`IN ASInt32`): IN/OUT The type of resources to query or obtain: PDEFont, PDEXGroup, or PDEColorSpace. It must be one of PDEContentGetResourceFlags. - `resourcesP` (`OUT PDEObject *`): IN/OUT (Filled by the method) If non-`NULL`, it must point to an array of PDEObject pointers. On return, the array contains pointers to the requested resources. If `resourcesP` is `NULL`, only the number of resources of `type` is returned. Note that the object in `resourcesP` may only be valid for this method. Use PDEAcquire() if you need to hold on to the object longer than the scope of `resourcesP`. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The number of resources of `type` returned in `resourcesP`. **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` #### PDEContentRemoveElem ```cpp void PDEContentRemoveElem(IN PDEContent pdeContent, IN ASInt32 index) ``` Header: `PEWProcs.h:125` Removes an element from a PDEContent. **Note:** This decrements the reference count of the element removed. **Parameters** - `pdeContent` (`IN PDEContent`): IN/OUT A content object. - `index` (`IN ASInt32`): IN/OUT The index in `pdeContent` of the element to remove whose reference count is decremented. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEContentAddElem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentAddElem) #### PDEContentSetContainingStream ```cpp void PDEContentSetContainingStream(IN PDEContent pdeContent, IN CosObj containingStm) ``` Header: `PEWProcs.h:2732` Sets the containing stream and owner stream for any marked content reference handles attached to containers within the content. **Note:** This call should not be used when the content is being directly added to a page. **Note:** If the content is set with PDPageSetPDEContent(), PDEFormSetContent(), or PDEGroupSetContent(), this step occurs automatically. **Parameters** - `pdeContent` (`IN PDEContent`): The content stream within which to update marked content references. - `containingStm` (`IN CosObj`): The containing stream object for the content stream. **Returns:** `void` **See also:** [`PDEContentSetPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentSetPage), [`PDEContentSetStreamOwner`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentSetStreamOwner) #### PDEContentSetDefaultColorSpace_PEWCalls_ ```cpp void PDEContentSetDefaultColorSpace_PEWCalls_(IN PDEContent pdeContent, IN ASAtom colorSpaceName, IN PDEColorSpace colorSpace) ``` Header: `PEWProcs.h:3136` Sets the default color space in a PDEContent object. The reference count on any existing default color space is decremented, and the reference count on the new color space is incremented. Note that the new color space can be `NULL`, indicating that there is no default color space. See the "Default Color Spaces" section of the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, under "CIE-Based Color Spaces" in section 8.6.5.6, page 152. You can find this document on the web store of the International Standards Organization (ISO). **Parameters** - `pdeContent` (`IN PDEContent`): IN A content object. - `colorSpaceName` (`IN ASAtom`): IN An ASAtom for the name of the desired color space. It must be an ASAtom for one of the following: • `DefaultRGB` • `DefaultCMYK` • `DefaultGray` - `colorSpace` (`IN PDEColorSpace`): IN The color space to use as the default. **Returns:** `void` #### PDEContentSetElemsStatus ```cpp void PDEContentSetElemsStatus(IN PDEContent pdeContent, IN ASUns32 status) ``` Header: `PERProcs.h:3411` **Parameters** - `pdeContent` (`IN PDEContent`) - `status` (`IN ASUns32`) **Returns:** `void` #### PDEContentSetPage ```cpp void PDEContentSetPage(IN PDEContent pdeContent, IN CosObj pageObj) ``` Header: `PEWProcs.h:2713` Sets the page on which marked content is drawn upon for any marked content reference handles attached to containers within the content. **Note:** If content is set with PDPageSetPDEContent(), PDEFormSetContent(), or PDEGroupSetContent(), this step occurs automatically. **Note:** This call should only be used when the content is being directly added to a page. **Parameters** - `pdeContent` (`IN PDEContent`): The content stream whose marked content reference handles should be updated. - `pageObj` (`IN CosObj`): The page object upon which contents are drawn. **Returns:** `void` **See also:** [`PDEContentSetContainingStream`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentSetContainingStream), [`PDEContentSetStreamOwner`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentSetStreamOwner), [`PDSMCRefCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSMCRefCreate) #### PDEContentSetStreamOwner ```cpp void PDEContentSetStreamOwner(IN PDEContent pdeContent, IN CosObj streamOwner) ``` Header: `PEWProcs.h:2750` Sets the stream owner for any marked content reference handles attached to containers within the content. **Note:** This call should not be used when the content is being directly added to a page. **Note:** If content is set with PDPageSetPDEContent(), PDEFormSetContent(), or PDEGroupSetContent(), this step occurs automatically. **Parameters** - `pdeContent` (`IN PDEContent`): The content stream within which to update marked content references. - `streamOwner` (`IN CosObj`): The owner object for any references attached to the content. **Returns:** `void` **See also:** [`PDEContentSetPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentSetPage), [`PDEContentSetContainingStream`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentSetContainingStream) #### PDEContentToCosObj ```cpp void PDEContentToCosObj(IN PDEContent pdeContent, IN ASUns32 flags, IN PDEContentAttrsP attrs, IN ASUns32 attrsSize, IN CosDoc cosDoc, IN PDEFilterArrayP filtersP, OUT CosObj *contentsP, OUT CosObj *resourcesP) ``` Header: `PEWProcs.h:100` This is the main method for converting a PDEContent into PDF contents and resources. This method does not change the PDEContent object or its reference count. The caller of this function is responsible for adding the contents and the resources returned from this method to the Page Object. **Parameters** - `pdeContent` (`IN PDEContent`): IN/OUT A content object. - `flags` (`IN ASUns32`): IN/OUT Flags specifying the type of object to create (page contents, form, or charproc) and how it is created. It must be one or more of PDEContentToCosObjFlags. - `attrs` (`IN PDEContentAttrsP`): IN/OUT A pointer to a PDEContentAttrs structure that contains the appropriate form attributes or cache device/char-width attributes, and so on. If it is zero, no attributes are set. - `attrsSize` (`IN ASUns32`): IN/OUT The size of the `attrs` buffer in bytes. Zero if `attrs` is zero. - `cosDoc` (`IN CosDoc`): IN/OUT The document in which the contents and resources are created. - `filtersP` (`IN PDEFilterArrayP`): IN/OUT A pointer to a PDEFilterArray structure that specifies which filters to use in encoding the contents; it may be `NULL`. If `filtersP` contains any `encodeParms`, they must belong to `cosDoc`. **Note:** Do not use this method to put a PDEContent into a PDPage. Instead, call PDPageSetPDEContent(). - `contentsP` (`OUT CosObj *`): IN/OUT (Filled by the method) The Cos object for the resulting contents in `pdeContent`. - `resourcesP` (`OUT CosObj *`): IN/OUT (Filled by the method) The Cos object for the resulting resources in `pdeContent`. Note that the client is responsible for putting the `resourcesP` dictionary into the `contentsP` stream for non-page objects. The client must do this for XObject Forms and appearance dictionaries in annotations. For Type 3 fonts, the resource dictionaries must be merged and put into the Type 3 font dictionary. For a page, the contents and resources must be put into the page object. **Returns:** `void` **Exceptions** - `peErrUnknownResType` - `pageErrErrorParsingImage` - `pdErrBadResMetrics` - `peErrWrongPDEObjectType` - `peErrUnknownPDEColorSpace` **See also:** [`PDEContentCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentCreateFromCosObj) ### Structures (1) #### PDEContent ```cpp typedef struct _t_PDEContent* PDEContent ``` Header: `PEExpT.h:122` Contains the modifiable contents of a PDPage. A PDEContent object may be obtained from an existing page, from a Form XObject, or from a Type 3 CharProc. You can create an empty PDEContent object. A PDEContent object contains PDEElement objects. In addition, a PDEContent object may have attributes such as a Form matrix and `setcachedevice` parameters. **See also:** [`PDEContentCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentCreate), [`PDEContainerGetContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContainerGetContent), [`PDEContentCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentCreateFromCosObj), [`PDEFormGetContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormGetContent), [`PDPageAcquirePDEContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageAcquirePDEContent), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease) ### Enums (3) #### PDEContentFlags Header: `PEExpT.h:1723` A bit field for `PDEContentAttrs`. **Values** - `kPDESetCacheDevice = 0x0001`: If set, `cacheDevice` contains 6 cache device values. - `kPDESetCharWidth = 0x0002`: If set, `cacheDevice` contains 2 charwidth values. - `kPDEFormMatrix = 0x0004`: If set, `formMatrix` contains a valid matrix. **See also:** [`PDEContentGetAttrs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentGetAttrs), [`PDEContentToCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentToCosObj) #### PDEContentGetResourceFlags Header: `PEExpT.h:1705` A bit field for `PDEContentAttrs`. **Values** - `kPDEGetFonts = 0`: Obtain font resources. - `kPDEGetXObjects = 1`: Obtain Xobject resources. - `kPDEGetColorSpaces = 2`: Obtain color space resources. **See also:** [`PDEContentGetResources`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentGetResources) #### PDEContentToCosObjFlags Header: `PEExpT.h:1616` A bit field for the PDEContentToCosObj() method, indicating the type of object to create and how it is created. To learn about color operators, see the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, page 171. You can find this document on the web store of the International Standards Organization (ISO). **Values** - `kPDEContentToPage = 0x0001`: Create page contents. - `kPDEContentToForm = 0x0002`: Create a form. - `kPDEContentToCharProc = 0x0004`: Create charprocs. - `kPDEContentRev1Compat = 0x0008`: Currently unused. - `kPDEContentDoNotResolveForms = 0x0010`: Currently unused. - `kPDEContentDoNotResolveType3 = 0x0020`: Currently unused. - `kPDEContentEmitDefaultRGBAndGray = 0x0040`: Emit calibrated RGB and gray information using the PDF 1.0 compatible mechanism. In this case, generate rg and k page operators and place DefaultGray and DefaultRGB color space arrays in the Resources dictionary. See the Color Operators section of the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 8.6.8, page 171. - `kPDEContentInheritState = 0x0080` - `kPDEContentDoNotEmitBXEX = 0x0100`: Prevents the emission of the content compatibility operators, BX/EX, which cause issues for some versions of PDF/A or PDF/X. - `kPDEContentUseMaxPrecision = 0x0200`: By default 3 digit precision after decimal point is used for floating point values. Using this flag increases precision from 3 digits to 5 digits after decimal point. - `kPDEContentUseSpaceAsEOL = 0x0400`: Use a space character as the EOL character in the content stream to make the Flate compressor more effective. - `kPDEContentHonorWasSetFlags = 0x0800`: Emit a gstate or textstate parameter for any element, only if the corresponding WasSetFlag is set. - `kPDEContentSkipBBox = 0x1000`: Setting this flag will skip optimization of bounding box of form XObject. - `kPDEContentSkipResReset = 0x2000`: Setting this flag will skip resetting of ResTable in PDEContent and it also skips creating new resource dictionary in document and uses resource dictionary from input. - `kPDEContentFormFromPage = 0x20000`: Note that this form content was created from a page, and should never inherit any state from the calling code, nor allow any state to leak from the form **See also:** [`PDEContentToCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentToCosObj) ## PDEDeviceNColors ### Functions (2) #### PDEDeviceNColorsCreate ```cpp PDEDeviceNColors PDEDeviceNColorsCreate(IN ASFixed *pColorValues, IN ASInt32 numValues) ``` Header: `PEWProcs.h:1452` Creates an object that can be used to store `n` color components when in a DeviceN color space. Call PDERelease() to dispose of the returned PDEDeviceNColors object when finished with it. **Parameters** - `pColorValues` (`IN ASFixed *`): IN/OUT A pointer to an array of ASFixed values. - `numValues` (`IN ASInt32`): IN/OUT The length of the array. **Returns:** [`PDEDeviceNColors`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEDeviceNColors) An object containing values specifying a color in a PDEDeviceNColors color space. **Exceptions** - `genErrNoMemory` **See also:** [`PDEDeviceNColorsGetColorValue`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEDeviceNColorsGetColorValue) #### PDEDeviceNColorsGetColorValue ```cpp ASFixed PDEDeviceNColorsGetColorValue(IN PDEDeviceNColors colors, IN ASInt32 index) ``` Header: `PERProcs.h:1577` Gets the value of a color component of a PDEDeviceNColors color space. **Parameters** - `colors` (`IN PDEDeviceNColors`): IN/OUT A PDEDeviceNColors object returned by PDEDeviceNColorsCreate(). - `index` (`IN ASInt32`): IN/OUT The index of the color component to return. **Returns:** [`ASFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixed) The value of the requested color component. **Exceptions** - `genErrBadParm` **See also:** [`PDEDeviceNColorsCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEDeviceNColorsCreate) ### Structures (1) #### PDEDeviceNColors ```cpp typedef struct _t_PDEDeviceNColors* PDEDeviceNColors ``` Header: `PEExpT.h:358` A color space with a variable number of device-dependent components. It is usually used to store multiple spot colors in a single color space. **See also:** [`PDEDeviceNColorsCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEDeviceNColorsCreate) ## PDEElement ### Functions (22) #### PDEElementCopy ```cpp PDEElement PDEElementCopy(IN PDEElement pdeElement, IN ASUns32 flags) ``` Header: `PEWProcs.h:225` Makes a copy of an element. The caller is responsible for releasing the copy with PDERelease(). **Parameters** - `pdeElement` (`IN PDEElement`): IN/OUT The element to copy. - `flags` (`IN ASUns32`): IN/OUT A bit field of PDEElementCopyFlags. **Returns:** [`PDEElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElement) A copy of `pdeElement`. **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDEContentGetElem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentGetElem) #### PDEElementGetAllVisibilities ```cpp ASUns32 PDEElementGetAllVisibilities(PDEElement elem, PDEContent content, PDOCContext ocContext, ASBool *visibilities, ASUns32 capacity) ``` Header: `PERProcs.h:2425` Tests whether all occurrences of the element are visible in a given content and optional-content context. It traverses the content to find each occurrence of the element, in the supplied content and in all nested contents. To find the visibility of a content element without considering its parent, use PDEElementIsCurrentlyVisible(). It returns the number of occurrences and an array of boolean values containing `true` for each occurrence of the element that is visible in the context, taking into account the context's NonOCDrawing and PDOCDrawEnumType values. **Parameters** - `elem` ([`PDEElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElement)): The element for which to obtain visibilities. - `content` ([`PDEContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContent)): The content containing the element. - `ocContext` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The optional-content context in which the element is tested. - `visibilities` ([`ASBool *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): (Filled by the method) An array of boolean values containing `true` for each occurrence of the element that is visible in the context. - `capacity` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The size of the visibilities array. **Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32) The number of occurrences of the element in the content. **See also:** [`PDEElementIsCurrentlyVisible`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementIsCurrentlyVisible), [`PDEElementMakeVisible`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementMakeVisible) #### PDEElementGetBBox ```cpp void PDEElementGetBBox(IN PDEElement pdeElement, OUT ASFixedRectP bboxP) ``` Header: `PERProcs.h:197` Gets the bounding box for an element. The returned bounding box is guaranteed to encompass the element, but is not guaranteed to be the smallest box that could contain the element. For example, for an arc, `bboxP` encloses the bezier control points, and not just the curve itself. **Parameters** - `pdeElement` (`IN PDEElement`): IN/OUT An element whose bounding box is obtained. - `bboxP` (`OUT ASFixedRectP`): IN/OUT (Filled by the method) A pointer to a `ASFixedRect` structure specifying the bounding box of `pdeElement`, specified in user space coordinates. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm`: @notify PDEElementGetClip @notify PDEElementGetGState @notify PDEElementGetMatrix #### PDEElementGetClip ```cpp PDEClip PDEElementGetClip(IN PDEElement pdeElement) ``` Header: `PERProcs.h:271` Gets the current clip for an element. The current clipping path is part of the graphics state. Element types that are not graphics elements (for example, PDEContainer and PDEPlace) do not have an associated `gstate` and should not be expected to return valid results. **Note:** This method does not change the reference count of the clip object. **Parameters** - `pdeElement` (`IN PDEElement`): IN/OUT An element whose clip is obtained. Note that a clip may be shared by many elements. Use care when modifying a clip. Copy it first if you want to modify the clip for a specific element. **Returns:** [`PDEClip`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEClip) The clip object for `pdeElement`. **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEElementGetBBox`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetBBox), [`PDEElementGetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetGState), [`PDEElementGetMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetMatrix), [`PDEElementIsAtRect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementIsAtRect) #### PDEElementGetGState ```cpp void PDEElementGetGState(IN PDEElement pdeElement, OUT PDEGraphicStateP stateP, IN ASUns32 stateSize) ``` Header: `PERProcs.h:224` Gets the graphics state information for an element. This method is only valid for PDEForm, PDEImage, PDEPath, and PDEShading elements. **Parameters** - `pdeElement` (`IN PDEElement`): An element whose graphics state is obtained. - `stateP` (`OUT PDEGraphicStateP`): (Filled by the method) A pointer to a `PDEGraphicState` structure that contains graphics state information for `pdeElement`. This PDEGraphicStateP may contain PDEObjects for color spaces or an ExtGState. They are not acquired by this method. Note that for a PDEImage, only the ExtGState value is used for images. For indexed images, the fill color space and values are categorized in the PDEImage object. - `stateSize` (`IN ASUns32`): The size of the `stateP` buffer in bytes. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDEElementSetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementSetGState), [`PDEElementGetBBox`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetBBox), [`PDEElementGetClip`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetClip), [`PDEElementGetMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetMatrix), [`PDEElementGetGStateEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetGStateEx) #### PDEElementGetGStateEx ```cpp void PDEElementGetGStateEx(IN PDEElement pdeElement, OUT PDEGraphicStateExP stateP, IN ASUns32 stateSize) ``` Header: `PERProcs.h:3231` Gets the graphics state information for an element. This method fills PDEGraphicStateEx as output which is higher precision alternative of `PDEGraphicState` structure. This method is only valid for PDEForm, PDEImage, PDEPath, and PDEShading elements. @since **Parameters** - `pdeElement` (`IN PDEElement`): An element whose graphics state is obtained. - `stateP` (`OUT PDEGraphicStateExP`): (Filled by the method) A pointer to a PDEGraphicStateEx structure that contains graphics state information for `pdeElement`. This PDEGraphicStateExP may contain PDEObjects for color spaces or an ExtGState. They are not acquired by this method. Note that for a PDEImage, only the ExtGState value is used for images. For indexed images, the fill color space and values are categorized in the PDEImage object. - `stateSize` (`IN ASUns32`): The size of the `stateP` buffer in bytes. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDEElementSetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementSetGState), [`PDEElementGetBBox`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetBBox), [`PDEElementGetClip`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetClip), [`PDEElementGetMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetMatrix), [`PDEElementGetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetGState), [`PDEElementSetGStateEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementSetGStateEx) #### PDEElementGetMatrix ```cpp void PDEElementGetMatrix(IN PDEElement pdeElement, OUT ASFixedMatrixP matrixP) ``` Header: `PERProcs.h:249` Superseded by PDEElementGetMatrixEx() in Acrobat 10.0. Gets the transformation matrix for an element. This matrix provides the transformation from user space to device space for the element. If there is no cm (`concatmatrix`) operator in the page stream, the matrix is the identity matrix. **Parameters** - `pdeElement` (`IN PDEElement`): An element whose transformation matrix is obtained. - `matrixP` (`OUT ASFixedMatrixP`): (Filled by the method) A pointer to `ASFixedMatrix` that holds a transformation matrix for `pdeElement`. If `pdeElement` is a text object, it returns the identity matrix. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDEElementSetMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementSetMatrix), [`PDEElementGetBBox`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetBBox), [`PDEElementGetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetGState), [`PDEElementGetMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetMatrixEx) #### PDEElementGetMatrixEx ```cpp void PDEElementGetMatrixEx(IN PDEElement pdeElement, OUT ASDoubleMatrixP matrixP) ``` Header: `PERProcs.h:3023` Supersedes PDEElementGetMatrix() in Acrobat 10.0. Gets the transformation matrix for an element. This matrix provides the transformation from user space to device space for the element. If there is no cm (`concatmatrix`) operator in the page stream, the matrix is the identity matrix. **Parameters** - `pdeElement` (`IN PDEElement`): An element whose transformation matrix is obtained. - `matrixP` (`OUT ASDoubleMatrixP`): (Filled by the method) A pointer to `ASDoubleMatrix` that holds a transformation matrix for `pdeElement`. If `pdeElement` is a text object, it returns the identity matrix. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDEElementSetMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementSetMatrixEx), [`PDEElementGetBBox`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetBBox), [`PDEElementGetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetGState), [`PDEElementGetMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetMatrix) #### PDEElementGetOCMD ```cpp PDOCMD PDEElementGetOCMD(PDEElement elem) ``` Header: `PERProcs.h:2365` Gets an optional-content membership dictionary (OCMD) object associated with the element. The element must be a PDEForm, PDEImage (XObject image), or PDEContainer. If it is not one of these, the method returns `NULL`. • If the element is a PDEForm or PDEImage, the method returns the dictionary attached to the element's Cos XObject dictionary. • If the element is a PDEContainer, and it is for optional content, the method returns the dictionary. If it is not for optional content, the method returns `NULL`. **Parameters** - `elem` ([`PDEElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElement)): The element from which the dictionary is obtained. **Returns:** [`PDOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMD) The dictionary object, or `NULL` if the element is not a PDEForm, PDEImage (XObject image), or PDEContainer, or if it is a container that is not for optional content. **See also:** [`PDAnnotGetOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDAnnotGetOCMD), [`PDEElementSetOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementSetOCMD), [`PDEElementRemoveOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementRemoveOCMD), [`PDOCMDFindOrCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMDFindOrCreate) #### PDEElementHasGState ```cpp ASBool PDEElementHasGState(IN PDEElement pdeElement, OUT PDEGraphicStateP stateP, IN ASUns32 stateSize) ``` Header: `PERProcs.h:2026` Gets the graphics state information for an element. **Parameters** - `pdeElement` (`IN PDEElement`): The PDEElement whose graphics state is to be obtained. - `stateP` (`OUT PDEGraphicStateP`): (Filled by the method) A pointer to a `PDEGraphicState` structure that contains graphics state information for `pdeElement`. - `stateSize` (`IN ASUns32`): The size of the `stateP` buffer. Set it to `sizeof(PDEGraphicState)`. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the element has a graphics state, `false` otherwise. **Exceptions** - `genErrBadParm` **See also:** [`PDEElementHasGStateEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementHasGStateEx) #### PDEElementHasGStateEx ```cpp ASBool PDEElementHasGStateEx(IN PDEElement pdeElement, OUT PDEGraphicStateExP stateP, IN ASUns32 stateSize) ``` Header: `PERProcs.h:3252` Gets the graphics state information for an element. This method fills PDEGraphicStateEx as output which is higher precision alternative of `PDEGraphicState` structure. @since **Parameters** - `pdeElement` (`IN PDEElement`): The PDEElement whose graphics state is to be obtained. - `stateP` (`OUT PDEGraphicStateExP`): (Filled by the method) A pointer to a PDEGraphicStateEx structure that contains graphics state information for `pdeElement`. - `stateSize` (`IN ASUns32`): The size of the `stateP` buffer. Set it to `sizeof(PDEGraphicStateEx)`. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) **Exceptions** - `genErrBadParm` **See also:** [`PDEElementHasGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementHasGState) #### PDEElementIsAtPoint ```cpp ASBool PDEElementIsAtPoint(IN PDEElement elem, IN ASFixedPoint point) ``` Header: `PERProcs.h:1680` Tests whether a point is on an element. **Parameters** - `elem` (`IN PDEElement`): IN/OUT The element to test. If PDEElement is a PDEText or PDEImage, it uses the bounding box of the PDEElement to make the check. If the PDEElement is a PDEPath and it is stroked, it checks if the point is on the path. If the PDEElement is a PDEPath and it is filled, it checks if the point is in the fill area, taking into consideration whether it is filled using the non-zero winding number rule or the even-odd rule. - `point` (`IN ASFixedPoint`): IN/OUT The point, specified in user space coordinates. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the point is on the element, `false` otherwise. **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEElementIsAtRect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementIsAtRect), [`PDETextIsAtPoint`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextIsAtPoint), [`PDETextIsAtRect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextIsAtRect) #### PDEElementIsAtRect ```cpp ASBool PDEElementIsAtRect(IN PDEElement elem, IN ASFixedRect rect) ``` Header: `PERProcs.h:1704` Tests whether any part of a rectangle is on an element. **Parameters** - `elem` (`IN PDEElement`): IN/OUT The element to test. If PDEElement is a PDEText or PDEImage, it uses the bounding box of the PDEElement to make the check. If the PDEElement is a PDEPath and it is stroked, it checks if the rectangle is on the path. If the PDEElement is a PDEPath and it is filled, it checks if the rectangle is in the fill area, taking into consideration whether it is filled using the non-zero winding number rule or the even-odd rule. - `rect` (`IN ASFixedRect`): IN/OUT The rectangle, specified in user space coordinates. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if any part of the rectangle is on the element, `false` otherwise. **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEElementIsAtPoint`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementIsAtPoint), [`PDETextIsAtPoint`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextIsAtPoint), [`PDETextIsAtRect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextIsAtRect) #### PDEElementIsCurrentlyVisible ```cpp ASBool PDEElementIsCurrentlyVisible(PDEElement elem, PDEContent content, PDOCContext ocContext) ``` Header: `PERProcs.h:2395` Tests whether an element is visible in a given content and optional-content context. It traverses the content to find the first occurrence of the element, in the supplied content and in all nested contents. It returns `true` if the first occurrence of the element is visible in the context, taking into account the context's NonOCDrawing and PDOCDrawEnumType values. The content can be `NULL`. In this case: • If the element is a PDEForm, PDEImage, or PDEContainer, the method checks the object to see if it has an optional-content membership dictionary (OCMD) attached to it. If so, the method returns `true` if the object is visible, without considering whether the PDEContent that the element belongs to is visible. • If the element is not one of these types, the method returns `true`. **Parameters** - `elem` ([`PDEElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElement)): The element to test. - `content` ([`PDEContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContent)): The content containing the element. - `ocContext` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The optional-content context in which the element is tested. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) Returns `true` if the element is visible in the given content and context, `false` if it is hidden. **See also:** [`PDEElementGetAllVisibilities`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetAllVisibilities), [`PDEElementMakeVisible`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementMakeVisible) #### PDEElementMakeVisible ```cpp ASBool PDEElementMakeVisible(PDEElement elem, PDEContent content, PDOCContext ocContext) ``` Header: `PERProcs.h:2443` Makes an element visible in a given content and optional-content context, by manipulating the `ON-OFF` states of the optional-content groups. **Parameters** - `elem` ([`PDEElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElement)): The element for which to set the visibility state. - `content` ([`PDEContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContent)): The content containing the element. - `ocContext` ([`PDOCContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCContext)): The optional-content context in which the element is made visible. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the element is successfully made visible in the given content and context, `false` otherwise. **See also:** [`PDEElementGetAllVisibilities`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetAllVisibilities), [`PDEElementIsCurrentlyVisible`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementIsCurrentlyVisible), [`PDOCMDsMakeContentVisible`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMDsMakeContentVisible) #### PDEElementRemoveOCMD ```cpp void PDEElementRemoveOCMD(PDEElement elem) ``` Header: `PEWProcs.h:2321` Dissociates an optional-content membership dictionary (OCMD) object from the element. The element must be a PDEForm, a PDEImage (XObject image), or a PDEContainer. If it is not one of these, nothing happens: • If the element is a PDEForm or PDEImage, the method removes the dictionary from the element's Cos XObject dictionary. • If the element is a PDEContainer for optional content, the method removes the dictionary, but does not destroy the container. **Parameters** - `elem` ([`PDEElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElement)): The element for which to remove the dictionary. **Returns:** `void` **See also:** [`PDEElementGetOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetOCMD), [`PDEElementSetOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementSetOCMD), [`PDOCMDFindOrCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMDFindOrCreate) #### PDEElementSetClip ```cpp void PDEElementSetClip(IN PDEElement pdeElement, IN PDEClip pdeClip) ``` Header: `PEWProcs.h:211` Sets the current clip for an element. The `pdeElement` parameter's previous clip's reference count is decremented (if it had one), and the `pdeClip` parameter's reference count is incremented. **Parameters** - `pdeElement` (`IN PDEElement`): IN/OUT An element whose clip is set. - `pdeClip` (`IN PDEClip`): IN/OUT The clip to set for `pdeContent`. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDEElementGetClip`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetClip) #### PDEElementSetGState ```cpp void PDEElementSetGState(IN PDEElement pdeElement, IN PDEGraphicStateP stateP, IN ASUns32 stateSize) ``` Header: `PEWProcs.h:174` Sets the graphics state information for an element. This method is valid only for PDEForm, PDEImage, PDEPath, and PDEShading elements. **Note:** This method causes any of the `stateP` parameter's color space or ExtGState objects to have their reference count incremented, and previous graphic state objects to be decremented. **Parameters** - `pdeElement` (`IN PDEElement`): An element whose graphics state is set. - `stateP` (`IN PDEGraphicStateP`): A pointer to a `PDEGraphicState` structure with graphics state information to set for `pdeContent`. Any of the `stateP` parameter's color space or ExtGState objects have their reference count incremented. - `stateSize` (`IN ASUns32`): The size of the `stateP` buffer in bytes. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm`: will be raised if the first parameter, `pdeElement`, does not have a graphics state associated with it. **See also:** [`PDEElementGetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetGState), [`PDEElementSetGStateEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementSetGStateEx) #### PDEElementSetGStateEx ```cpp void PDEElementSetGStateEx(IN PDEElement pdeElement, IN PDEGraphicStateExP stateP, IN ASUns32 stateSize) ``` Header: `PEWProcs.h:3762` Sets the graphics state information for an element. This method takes pointer to PDEGraphicStateEx as input which is higher precision alternative of `PDEGraphicState` structure. This method is valid only for PDEForm, PDEImage, PDEPath, and PDEShading elements. @note This method causes any of the `stateP` parameter's color space or ExtGState objects to have their reference count incremented, and previous graphic state objects to be decremented. @since **Parameters** - `pdeElement` (`IN PDEElement`): An element whose graphics state is set. - `stateP` (`IN PDEGraphicStateExP`): A pointer to a PDEGraphicStateEx structure with graphics state information to set for `pdeContent`. Any of the `stateP` parameter's color space or ExtGState objects have their reference count incremented. - `stateSize` (`IN ASUns32`): The size of the `stateP` buffer in bytes. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm`: will be raised if the first parameter, `pdeElement`, does not have a graphics state associated with it. **See also:** [`PDEElementGetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetGState), [`PDEElementGetGStateEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetGStateEx), [`PDEElementSetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementSetGState) #### PDEElementSetMatrix ```cpp void PDEElementSetMatrix(IN PDEElement pdeElement, IN ASFixedMatrixP matrixP) ``` Header: `PEWProcs.h:195` Superseded by PDEElementSetMatrixEx() in Acrobat 10.0. Sets the transformation matrix for an element. The element may not be a PDEContainer, a PDEGroup, a PDEPlace, or a PDEText. **Parameters** - `pdeElement` (`IN PDEElement`): IN/OUT An element whose transformation matrix is set. - `matrixP` (`IN ASFixedMatrixP`): IN/OUT A pointer to an `ASFixedMatrix` that holds the transformation matrix to set for `pdeContent`. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDEElementGetMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetMatrix), [`PDEElementSetMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementSetMatrixEx) #### PDEElementSetMatrixEx ```cpp void PDEElementSetMatrixEx(IN PDEElement pdeElement, IN ASDoubleMatrixP matrixP) ``` Header: `PEWProcs.h:3659` Sets the transformation matrix for an element. Supersedes PDEElementSetMatrix() in Acrobat 10.0. The element may not be a PDEContainer, a PDEGroup, a PDEPlace, or a PDEText. **Parameters** - `pdeElement` (`IN PDEElement`): IN/OUT An element whose transformation matrix is set. - `matrixP` (`IN ASDoubleMatrixP`): IN/OUT A pointer to an `ASDoubleMatrix` that holds the transformation matrix to set for `pdeContent`. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDEElementGetMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetMatrixEx), [`PDEElementSetMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementSetMatrix) #### PDEElementSetOCMD ```cpp void PDEElementSetOCMD(PDEElement elem, PDOCMD pdOCMD) ``` Header: `PEWProcs.h:2298` Associates an optional-content membership dictionary (OCMD) object with the element. The element must be a PDEForm, a PDEImage (XObject image), or a PDEContainer. If it is not one of these, nothing happens: • If the element is a PDEForm or PDEImage, the method attaches the dictionary to the element's Cos XObject dictionary. • If the element is a PDEContainer, and it is already for optional content, the optional-content information is replaced. • If it is not already for optional content, a new PDEContainer for optional content is created and nested inside the specified container. **Parameters** - `elem` ([`PDEElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElement)): The element for which to set the dictionary. - `pdOCMD` ([`PDOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMD)): The new dictionary. **Returns:** `void` **See also:** [`PDEElementGetOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetOCMD), [`PDEElementRemoveOCMD`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementRemoveOCMD), [`PDOCMDFindOrCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDOCMDFindOrCreate) ### Typedefs (1) #### PDEElementEnumProc ```cpp typedef ASBool(*) PDEElementEnumProc(IN PDEElement elem, IN void *clientData)(IN PDEElement elem, IN void *clientData) ``` Header: `PEExpT.h:2092` A callback for PDEEnumElements(). It is called once for each PDEElement in a page's Contents Stream or Resources dictionary. **See also:** [`PDEEnumElements`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEEnumElements) ### Structures (1) #### PDEElement ```cpp typedef struct _t_PDEElement* PDEElement ``` Header: `PEExpT.h:143` The base class for elements of a page display list (PDEContent) and for clip objects. The general PDEElement methods allow you to get and set general element properties. **See also:** `PDEContainer (subclass)`, `PDEForm (subclass)`, `PDEGroup (subclass)`, `PDEImage (subclass)`, `PDEPath (subclass)`, `PDEPlace (subclass)`, `PDEPS (subclass)`, `PDEShading (subclass)`, `PDEText (subclass)`, `PDEUnknown (subclass)`, `PDEXObject (subclass)`, `PDEClipGetElem (subclass)`, `PDEContentGetElem (subclass)`, `PDEElementCopy (subclass)`, [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease) ### Enums (1) #### PDEElementCopyFlags Header: `PEExpT.h:1937` A bit field for `PDEElementCopy()`. **Values** - `kPDEElementCopyForClip = 0x0001`: The copied element does not need `gstate` or `clip`. - `kPDEElementCopyClipping = 0x0002`: Acquire the clip path and put it in the copied object. **See also:** [`PDEElementCopy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementCopy) ## PDEElements ### Functions (1) #### PDEEnumElements ```cpp void PDEEnumElements(IN const CosObj *contents, IN const CosObj *resources, IN ASUns32 flags, IN PDEElementEnumProc enumProc, IN void *enumProcClientData) ``` Header: `PERProcs.h:1519` Enumerates all the PDEElements in a given stream. It is similar to PDEContentCreateFromCosObj(), but provides enumeration instead of a list of elements. If marked content is not ignored, each PDEContainer contains a PDEContent list within itself. **Parameters** - `contents` (`IN const CosObj *`): IN/OUT A Cos object that is the source for the content stream. It may be page contents, a Form XObject, a Type 3 font CharProc, or an appearance object from an annotation. - `resources` (`IN const CosObj *`): IN/OUT The object's Resources dictionary. If the Form or Type 3 font or appearance dictionary contains a Resources dictionary, this dictionary must be passed in `resources`. Otherwise, it must be the page resources object of the page containing the Form or Type 3 font contents object. - `flags` (`IN ASUns32`): IN/OUT Flags from PDEEnumElementsFlags. - `enumProc` (`IN PDEElementEnumProc`): IN/OUT A user-supplied callback to call once for each top-level element. Note that the element in `enumProc` may only be valid for this method. Use PDEAcquire() if you need to hold on to the element longer than the scope of `enumProc`. - `enumProcClientData` (`IN void *`): IN/OUT A pointer to user-supplied data to pass to `enumProc` each time it is called. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` - `peErrPStackUnderflow` - `peErrCantGetImageDict` **See also:** [`PDEContentCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentCreateFromCosObj), [`PDEContentGetNumElems`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentGetNumElems), [`PDEContentGetElem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContentGetElem) ## PDEEndContainer ### Functions (1) #### PDEEndContainerCreate ```cpp PDEEndContainer PDEEndContainerCreate() ``` Header: `PEWProcs.h:1988` Creates a new PDEEndContainer object. Call PDERelease to dispose of the returned PDEEndContainer object when finished with it. Call PDERelease() to dispose of the returned PDEEndContainer object when finished with it. **Returns:** [`PDEEndContainer`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEEndContainer) The newly created object. ### Structures (1) #### PDEEndContainer ```cpp typedef struct _t_PDEEndContainer* PDEEndContainer ``` Header: `PEExpT.h:281` The PDFEdit representation of the closing bracket of a marked-content sequence. Elements of this type must be paired with elements of type PDEBeginContainer. **See also:** `PDEElement (superclass)`, [`PDEEndContainerCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEEndContainerCreate), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease) ## PDEEndGroup ### Functions (1) #### PDEEndGroupCreate ```cpp PDEEndGroup PDEEndGroupCreate() ``` Header: `PEWProcs.h:2006` Creates a new end group object. Call PDERelease() to dispose of the returned PDEEndGroup object when finished with it. **Returns:** [`PDEEndGroup`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEEndGroup) The newly created object. ### Structures (1) #### PDEEndGroup ```cpp typedef struct _t_PDEEndGroup* PDEEndGroup ``` Header: `PEExpT.h:295` A group of PDEElement objects on a page in a PDF file. **See also:** `PDEElement (superclass)`, [`PDEEndGroupCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEEndGroupCreate), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease) ## PDEExtGState ### Functions (30) #### PDEExtGStateAcquireSoftMask ```cpp PDESoftMask PDEExtGStateAcquireSoftMask(IN PDEExtGState pdeExtGState) ``` Header: `PERProcs.h:2172` Acquires the soft mask of the extended graphic state. Call PDERelease() to dispose of the PDESoftMask when finished with it. **Parameters** - `pdeExtGState` (`IN PDEExtGState`): The extended graphics state object. **Returns:** [`PDESoftMask`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDESoftMask) The soft mask or `NULL` if the ExtGState dictionary does not contain the SMask key. **Exceptions** - `peErrWrongPDEObjectType`: if pdeExtGState is `NULL` or is not of type - `kPDEExtGState.` #### PDEExtGStateCreate ```cpp PDEExtGState PDEExtGStateCreate(IN CosObj *cosObjP) ``` Header: `PEWProcs.h:1097` Creates a new PDEExtGState from a Cos object. See the description of Extended Graphic States in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 8.4.5, page 128. You can find this document on the web store of the International Standards Organization (ISO). Call PDERelease() to dispose of the returned PDEExtGState when finished with it. **Parameters** - `cosObjP` (`IN CosObj *`): A Cos object for a dictionary of type ExtGState. **Returns:** [`PDEExtGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEExtGState) The PDEExtGState for `cosObjP`. **See also:** [`PDEElementSetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementSetGState), [`PDEExtGStateGetCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEExtGStateGetCosObj) #### PDEExtGStateCreateNew ```cpp PDEExtGState PDEExtGStateCreateNew(IN CosDoc cosDoc) ``` Header: `PEWProcs.h:1829` Creates a new extended graphics state object. Call PDERelease() to dispose of the returned PDEExtGState object when finished with it. **Parameters** - `cosDoc` (`IN CosDoc`): IN/OUT The document within which the object will be used. **Returns:** [`PDEExtGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEExtGState) The newly created object. #### PDEExtGStateGetAIS ```cpp ASBool PDEExtGStateGetAIS(IN PDEExtGState pdeExtGState) ``` Header: `PERProcs.h:2146` Returns the value of the Alpha Is Shape (AIS) member of the graphics state. If AIS is `true`, the sources of alpha are treated as shape; otherwise they are treated as opacity values. If the value is not set, the default value of `false` is returned. **Parameters** - `pdeExtGState` (`IN PDEExtGState`): IN/OUT The extended graphics state object. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) See above. **Exceptions** - `peErrWrongPDEObjectType` #### PDEExtGStateGetBPC ```cpp ASAtom PDEExtGStateGetBPC(IN PDEExtGState extGS) ``` Header: `PERProcs.h:3342` Returns the value of black point compensation. Valid names are ON, OFF and Default. If the value has not been set a value of Default is returned. **Parameters** - `extGS` (`IN PDEExtGState`): The extended graphics state object. **Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom) `ASAtom` for BPC value. **Exceptions** - `genErrBadParm` **See also:** [`PDEExtGStateSetBPC`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEExtGStateSetBPC) #### PDEExtGStateGetBlendMode ```cpp ASAtom PDEExtGStateGetBlendMode(IN PDEExtGState pdeExtGState) ``` Header: `PERProcs.h:2131` Returns the blend mode for the color composite for each object painted. The following are valid names: • Compatible • Normal • Multiply • Screen • Difference • Darken • Lighten • ColorDodge • ColorBurn • Exclusion • HardLight • Overlay • SoftLight • Luminosity • Hue • Saturation • Color **Parameters** - `pdeExtGState` (`IN PDEExtGState`): IN/OUT The extended graphics state object. **Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom) If the value has not been set, a value of Compatible is returned. See above. **Exceptions** - `peErrWrongPDEObjectType` #### PDEExtGStateGetCosObj ```cpp void PDEExtGStateGetCosObj(IN PDEExtGState extGState, OUT CosObj *cosObjP) ``` Header: `PERProcs.h:1320` Gets a Cos object for a PDEExtGState. **Parameters** - `extGState` (`IN PDEExtGState`): IN/OUT A PDEExtGState whose Cos object is obtained. - `cosObjP` (`OUT CosObj *`): IN/OUT (Filled by the method) The Cos object for `extGState`. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEExtGStateCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEExtGStateCreate) #### PDEExtGStateGetHalfToneOrigin ```cpp ASRealPoint PDEExtGStateGetHalfToneOrigin(IN PDEExtGState extGS) ``` Header: `PERProcs.h:3200` Returns HalfTone Co-ordinate point. **Parameters** - `extGS` (`IN PDEExtGState`): The extended graphics state object. **Returns:** `ASRealPoint` `ASRealPoint*` for x,y coordinate value of HalfToneOrigin. **Exceptions** - `genErrBadParm` **See also:** [`PDEExtGStateGetHalfToneOrigin`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEExtGStateGetHalfToneOrigin) #### PDEExtGStateGetOPFill ```cpp ASBool PDEExtGStateGetOPFill(IN PDEExtGState pdeExtGState) ``` Header: `PERProcs.h:2056` Returns whether overprint is enabled for painting operations other than stroking. **Parameters** - `pdeExtGState` (`IN PDEExtGState`): IN/OUT The extended graphics state object. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) Returns the value of the / op key in the ExtGState dictionary. If the value is not found, the default value of `false` is returned. **Exceptions** - `peErrWrongPDEObjectType` #### PDEExtGStateGetOPM ```cpp ASInt32 PDEExtGStateGetOPM(IN PDEExtGState pdeExtGState) ``` Header: `PERProcs.h:2042` Returns the overprint mode used by this graphics state. **Parameters** - `pdeExtGState` (`IN PDEExtGState`): IN/OUT The extended graphics state object. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The Cos integer value. **Exceptions** - `peErrWrongPDEObjectType` #### PDEExtGStateGetOPStroke ```cpp ASBool PDEExtGStateGetOPStroke(IN PDEExtGState pdeExtGState) ``` Header: `PERProcs.h:2070` Returns whether overprint is enabled for stroke painting operations. **Parameters** - `pdeExtGState` (`IN PDEExtGState`): IN/OUT The extended graphics state object. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) Returns the value of the / OP key in the ExtGState dictionary. If the value is not found, the default value of `false` is returned. **Exceptions** - `peErrWrongPDEObjectType` #### PDEExtGStateGetOpacityFill ```cpp ASFixed PDEExtGStateGetOpacityFill(IN PDEExtGState pdeExtGState) ``` Header: `PERProcs.h:2084` Returns the opacity value for painting operations other than stroking. **Parameters** - `pdeExtGState` (`IN PDEExtGState`): IN/OUT The extended graphics state object. **Returns:** [`ASFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixed) Returns the value of the / ca key in the ExtGState dictionary. If the value is not found, the default value of `1` is returned. **Exceptions** - `peErrWrongPDEObjectType` #### PDEExtGStateGetOpacityStroke ```cpp ASFixed PDEExtGStateGetOpacityStroke(IN PDEExtGState pdeExtGState) ``` Header: `PERProcs.h:2098` Returns the opacity value for stroke painting operations for paths and glyph outlines. **Parameters** - `pdeExtGState` (`IN PDEExtGState`): IN/OUT The extended graphics state object. **Returns:** [`ASFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixed) Returns the value of the / CA key in the ExtGState dictionary. If the value is not found, the default value of `1` is returned. **Exceptions** - `peErrWrongPDEObjectType` #### PDEExtGStateGetSA ```cpp ASBool PDEExtGStateGetSA(IN PDEExtGState pdeExtGState) ``` Header: `PERProcs.h:2296` Returns whether stroke adjustment is enabled in the graphics state. **Parameters** - `pdeExtGState` (`IN PDEExtGState`): IN/OUT The extended graphics state object. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) Returns the value of the / SA key in the ExtGState dictionary. If the value is not set, the default value of `false` is returned. **Exceptions** - `peErrWrongPDEObjectType` #### PDEExtGStateGetSoftMaskMatrix ```cpp ASBool PDEExtGStateGetSoftMaskMatrix(IN PDEExtGState extGS, OUT ASDoubleMatrixP matrixP) ``` Header: `PERProcs.h:3449` Gets the softmask matrix from ExtGstate. **Parameters** - `extGS` (`IN PDEExtGState`): IN A ExtGstate object. - `matrixP` (`OUT ASDoubleMatrixP`): OUT A pointer to ASDoubleMatrix **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) **See also:** [`PDEExtGStateSetSoftMaskMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEExtGStateSetSoftMaskMatrix) #### PDEExtGStateGetTK ```cpp ASBool PDEExtGStateGetTK(IN PDEExtGState pdeExtGState) ``` Header: `PERProcs.h:2250` Returns whether text knockout is enabled in the graphics state. **Parameters** - `pdeExtGState` (`IN PDEExtGState`): IN/OUT The extended graphics state object. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) Returns the value of the / TK key in the ExtGState dictionary. If the value is not found, the default value of `true` is returned. **Exceptions** - `peErrWrongPDEObjectType` #### PDEExtGStateHasSoftMask ```cpp ASBool PDEExtGStateHasSoftMask(IN PDEExtGState pdeExtGState) ``` Header: `PERProcs.h:2159` Returns whether the graphics state contains a soft mask. **Parameters** - `pdeExtGState` (`IN PDEExtGState`): IN/OUT The extended graphics state object. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) Returns `true` if the ExtGState dictionary contains the / SMask key; otherwise `false` is returned. **Exceptions** - `peErrWrongPDEObjectType` #### PDEExtGStateSetAIS ```cpp void PDEExtGStateSetAIS(IN PDEExtGState pdeExtGState, IN ASBool alphaIsShape) ``` Header: `PEWProcs.h:1944` Specifies if the alpha is to be interpreted as a shape or opacity mask. **Parameters** - `pdeExtGState` (`IN PDEExtGState`): The extended graphics state object. - `alphaIsShape` (`IN ASBool`): Indicates whether the sources of alpha are to be treated as shape (`true`) or opacity (`false`). This determines the interpretation of the constant alpha (ca or CA) and soft mask (SMask) parameters of the graphics state, as well as a soft-mask image (Smask entry) of an image XObject. **Returns:** `void` #### PDEExtGStateSetBPC ```cpp void PDEExtGStateSetBPC(IN PDEExtGState extGS, IN ASAtom BPC) ``` Header: `PEWProcs.h:3820` Sets the black point compensation. Valid names are ON, OFF and Default. An exception will be raised if the name is invalid. **Parameters** - `extGS` (`IN PDEExtGState`): The extended graphics state object. - `BPC` (`IN ASAtom`): New value for BPC **Returns:** `void` **Exceptions** - `genErrBadParm` **See also:** [`PDEExtGStateGetBPC`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEExtGStateGetBPC) #### PDEExtGStateSetBlendMode ```cpp void PDEExtGStateSetBlendMode(IN PDEExtGState pdeExtGState, IN ASAtom blendMode) ``` Header: `PEWProcs.h:1929` Sets the blend mode for the color composites for each object painted. The following mode names are valid: • Compatible • Normal • Multiply • Screen • Difference • Darken • Lighten • ColorDodge • ColorBurn • Exclusion • HardLight • Overlay • SoftLight • Luminosity • Hue • Saturation • Color **Parameters** - `pdeExtGState` (`IN PDEExtGState`): IN/OUT The extended graphics state object. - `blendMode` (`IN ASAtom`): IN/OUT The new blend mode. **Returns:** `void` #### PDEExtGStateSetHalfToneOrigin ```cpp void PDEExtGStateSetHalfToneOrigin(IN PDEExtGState extGS, IN ASRealPoint hto_point) ``` Header: `PEWProcs.h:3731` Sets HalfTone Co-ordinate point. **Parameters** - `extGS` (`IN PDEExtGState`): The extended graphics state object. - `hto_point` (`IN ASRealPoint`) **Returns:** `void` **Exceptions** - `genErrBadParm` **See also:** [`PDEExtGStateSetHalfToneOrigin`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEExtGStateSetHalfToneOrigin) #### PDEExtGStateSetOPFill ```cpp void PDEExtGStateSetOPFill(IN PDEExtGState pdeExtGState, IN ASBool overprint) ``` Header: `PEWProcs.h:1853` Specifies if overprint is enabled for painting operations other than stroking. It corresponds to the / op key within the ExtGState's dictionary. **Parameters** - `pdeExtGState` (`IN PDEExtGState`): IN/OUT The extended graphics state object. - `overprint` (`IN ASBool`): IN/OUT Pass `true` to enable overprint, `false` to disable overprint. **Returns:** `void` #### PDEExtGStateSetOPM ```cpp void PDEExtGStateSetOPM(IN PDEExtGState pdeExtGState, IN ASInt32 opm) ``` Header: `PEWProcs.h:1840` Sets the overprint mode. It corresponds to the / OPM key within the ExtGState's dictionary. **Parameters** - `pdeExtGState` (`IN PDEExtGState`): IN/OUT The extended graphics state object. - `opm` (`IN ASInt32`): IN/OUT Overprint mode. **Returns:** `void` #### PDEExtGStateSetOPStroke ```cpp void PDEExtGStateSetOPStroke(IN PDEExtGState pdeExtGState, IN ASBool overprint) ``` Header: `PEWProcs.h:1866` Specifies if overprint is enabled for stroke operations. It corresponds to the / OP key within the ExtGState's dictionary. **Parameters** - `pdeExtGState` (`IN PDEExtGState`): IN/OUT The extended graphics state object. - `overprint` (`IN ASBool`): IN/OUT Pass `true` to enable overprint, `false` to disable overprint. **Returns:** `void` #### PDEExtGStateSetOpacityFill ```cpp void PDEExtGStateSetOpacityFill(IN PDEExtGState pdeExtGState, IN ASFixed opacity) ``` Header: `PEWProcs.h:1881` Sets the opacity value for painting operations other than stroking. The value must be in the range from `0` to `1` inclusive. It corresponds to the / ca key within the ExtGState's dictionary. The value from `0` to `1` refers to a float number (not an ASFixed value) that should be converted to ASFixed using FloatToASFixed(). **Parameters** - `pdeExtGState` (`IN PDEExtGState`): IN/OUT The extended graphics state object. - `opacity` (`IN ASFixed`): IN/OUT The new opacity value. **Returns:** `void` #### PDEExtGStateSetOpacityStroke ```cpp void PDEExtGStateSetOpacityStroke(IN PDEExtGState pdeExtGState, IN ASFixed opacity) ``` Header: `PEWProcs.h:1896` Sets the opacity value for stroke operations. The value must be in the range from `0` to `1` inclusive. It corresponds to the / CA key within the ExtGState's dictionary. The value from `0` to `1` refers to a float number (not an ASFixed value) that should be converted to ASFixed using FloatToASFixed(). **Parameters** - `pdeExtGState` (`IN PDEExtGState`): IN/OUT The extended graphics state object. - `opacity` (`IN ASFixed`): IN/OUT The new opacity value. **Returns:** `void` #### PDEExtGStateSetSA ```cpp void PDEExtGStateSetSA(IN PDEExtGState pdeExtGState, IN ASBool strokeAdjust) ``` Header: `PEWProcs.h:2240` Specifies whether stroke adjustment is enabled in the graphics state. **Parameters** - `pdeExtGState` (`IN PDEExtGState`): IN/OUT The extended graphics state object. - `strokeAdjust` (`IN ASBool`): IN/OUT Pass `true` to enable stroke adjustment, `false` to disable stroke adjustment. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` #### PDEExtGStateSetSoftMask ```cpp void PDEExtGStateSetSoftMask(IN PDEExtGState pdeExtGState, IN PDESoftMask pdeSoftMask) ``` Header: `PEWProcs.h:1954` Sets the soft mask of the extended graphics state. **Parameters** - `pdeExtGState` (`IN PDEExtGState`): IN/OUT The extended graphics state object. - `pdeSoftMask` (`IN PDESoftMask`): IN/OUT The soft mask object. **Returns:** `void` #### PDEExtGStateSetSoftMaskMatrix ```cpp void PDEExtGStateSetSoftMaskMatrix(IN PDEExtGState extGS, IN ASDoubleMatrixP matrixP) ``` Header: `PEWProcs.h:3857` Sets the softmask matrix in ExtGstate. **Parameters** - `extGS` (`IN PDEExtGState`): IN A ExtGstate object. - `matrixP` (`IN ASDoubleMatrixP`): IN A pointer to `ASDoubleMatrix` **Returns:** `void` **See also:** [`PDEExtGStateGetSoftMaskMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEExtGStateGetSoftMaskMatrix) #### PDEExtGStateSetTK ```cpp void PDEExtGStateSetTK(IN PDEExtGState pdeExtGState, IN ASBool bk) ``` Header: `PEWProcs.h:2052` Specifies whether text knockout is enabled in the graphics state. This corresponds to the / TK key in the ExtGState's dictionary. **Parameters** - `pdeExtGState` (`IN PDEExtGState`): IN/OUT The extended graphics state object. - `bk` (`IN ASBool`): IN/OUT Pass `true` to enable text knockout, `false` to disable text knockout. **Returns:** `void` ### Structures (1) #### PDEExtGState ```cpp typedef struct _t_PDEExtGState* PDEExtGState ``` Header: `PEExpT.h:345` A reference to an ExtGState resource used on a page in a PDF file. It specifies a PDEElement object's extended graphics state, which is part of its graphics state. **See also:** [`PDEExtGStateCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEExtGStateCreate), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease) ## PDEFont ### Functions (34) #### PDEFontAddGlyphs ```cpp PDESpanSetP PDEFontAddGlyphs(IN PDEFont pdeFont, IN PDEGlyphRunP glyphRun, IN ASUns32 flags) ``` Header: `PEWProcs.h:2684` Adds glyphs to a PDEFont object for embedding a PDEFont. This is used by clients that use PDEFEdit calls to embed the font but create their own content stream. The glyphs added by this routine will be included in the font when PDEFontSubsetNow() is called. It is up to the client to ensure that the encoding used by the PDEFont matches the character codes used in the string arguments to the text operators in the content stream. This routine is used to specify which glyphs should be included in the font when embedded. Additionally, it specifies the mapping from the GlyphIDs to Unicode values. This mapping will be used to create the ToUnicode entry in the embedded font object. In the cases where the ToUnicode table cannot accurately reproduce the Unicode string in the `PDEGlyphRun` structure, this routine will return an array of spans that describe the contents of the ActualText spans that must be included in the content stream. Each span indicates a contiguous range of glyphs and a corresponding contiguous range of Unicode values that correspond to the glyphs. For example, the following ActualText span replace two glyphs with three Unicode values. `/Span<>` `BDC [Giii Gjjj] TJ EMC` Note that the routine must be called with the PDEGlyphRuns in display order. **Parameters** - `pdeFont` (`IN PDEFont`): The font for the element. - `glyphRun` (`IN PDEGlyphRunP`): A pointer to a `PDEGlyphRun` structure with Unicode data, GlyphIDs and their correspondence. Note that the `xPosition` and `yPosition` fields in the `PDEGlyphDescription` structure are ignored. - `flags` (`IN ASUns32`): Unused, reserved for later use. **Returns:** `PDESpanSetP` A pointer to a `PDESpanSet`. The span can be released with PDEReleaseSpan(). **Exceptions** - `genErrBadParm` **See also:** [`PDEFontSubsetNow`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontSubsetNow), [`PDEFontCreateFromSysFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFont), [`PDEReleaseSpan`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEReleaseSpan) #### PDEFontCreate ```cpp PDEFont PDEFontCreate(IN PDEFontAttrsP attrsP, IN ASUns32 attrsSize, IN ASInt32 firstChar, IN ASInt32 lastChar, IN ASInt16 *widthsP, IN char **encoding, IN ASAtom encodingBaseName, IN ASStm fontStm, IN ASInt32 len1, IN ASInt32 len2, IN ASInt32 len3) ``` Header: `PEWProcs.h:839` Creates a new PDEFont from the specified parameters. The PDEFont may be represented as an embedded font (a FontFile entry in the font descriptor of the PDF file). To create a PDEFont that is stored as an embedded font, the FontFile stream may be passed in `fontStm`, and the `len1`, `len2`, and `len3` parameters contain the Length1, Length2, and Length3 values of the FontFile stream attributes dictionary. See the description of Embedded Font Programs in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.9, page 288. You can find this document on the web store of the International Standards Organization (ISO). The caller must close `fontStm` with ASStmClose() after invoking PDEFontCreate(). Call PDERelease() to dispose of the returned font object when finished with it. **Parameters** - `attrsP` (`IN PDEFontAttrsP`): A pointer to a PDEFontAttrs structure for the font attributes.`attrsP` buffer in bytes. - `attrsSize` (`IN ASUns32`) - `firstChar` (`IN ASInt32`): The first character index for the widths array, `widthsP`. - `lastChar` (`IN ASInt32`): The last character index for the widths array, `widthsP`. - `widthsP` (`IN ASInt16 *`): A pointer to the widths array. - `encoding` (`IN char **`): An array of 256 pointers to glyph names specifying the custom encoding. If any pointer is `NULL`, no encoding information is written for that entry. - `encodingBaseName` (`IN ASAtom`): The encoding base name if the encoding is a custom encoding. If the encoding is `NULL`, `encodingBaseName` is used as the value of the encoding, and must be one of `WinAnsiEncoding`, `MacRomanEncoding`, or `MacExpertEncoding`. If no encoding value is desired, use ASAtomNull. - `fontStm` (`IN ASStm`): The stream with font information. - `len1` (`IN ASInt32`): The length in bytes of the ASCII portion of the Type 1 font file after it has been decoded. For other font formats, such as TrueType or CFF, only `len1` is used, and it is the size of the font. - `len2` (`IN ASInt32`): The length in bytes of the encrypted portion of the Type 1 font file after it has been decoded. - `len3` (`IN ASInt32`): The length in bytes of the portion of the Type 1 font file that contains the 512 zeros, plus the `cleartomark` operator, plus any following data. **Returns:** [`PDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFont) The specified PDEFont. **Exceptions** - `peErrCantCreateFontSubset` - `peErrCantGetAttrs` - `peErrCantGetWidths` - `peErrCantEmbedFont` - `genErrResourceLoadFailed` **See also:** [`PDEFontCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromCosObj), [`PDEFontCreateFromSysFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFont), [`PDEFontCreateFromSysFontEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFontEx), [`PDEFontCreateFromSysFontWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFontWithParams), [`PDEFontCreateWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateWithParams) #### PDEFontCreateFromCosObj ```cpp PDEFont PDEFontCreateFromCosObj(const CosObj *cosObjP) ``` Header: `PEWProcs.h:867` Creates a PDEFont corresponding to a Cos object of type Font. Call PDERelease() to dispose of the returned font object when finished with it. **Parameters** - `cosObjP` ([`const CosObj *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): IN/OUT The Cos object for which a PDEFont is created. **Returns:** [`PDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFont) The PDEFont created from cosObjP. **Exceptions** - `peErrCantCreateFontSubset` - `peErrCantGetAttrs` - `peErrCantGetWidths` - `peErrCantEmbedFont` - `genErrBadParm` - `genErrResourceLoadFailed` **See also:** [`PDEFontCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreate), [`PDEFontCreateFromSysFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFont), [`PDEFontCreateFromSysFontWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFontWithParams), [`PDEFontCreateWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateWithParams), [`PDEFontGetCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontGetCosObj) #### PDEFontCreateFromSysFont ```cpp PDEFont PDEFontCreateFromSysFont(IN PDSysFont sysFont, IN ASUns32 flags) ``` Header: `PEWProcs.h:905` Gets a PDEFont corresponding to a font in the system. Call PDERelease() to dispose of the returned font object when finished with it. The PDEFontCreateFlags flags kPDEFontCreateEmbedded and kPDEFontWillSubset must both be set in order to subset a font. If you create a PDEFont that is a subset, call PDEFontSubsetNow() on this font afterwards. **Note:** If you want to use `WinAnsiEncoding` on UNIX, do not use this method. Use PDEFontCreateFromSysFontWithParams() or PDEFontCreateFromSysFontAndEncoding() instead. **Parameters** - `sysFont` (`IN PDSysFont`): A PDSysFont object referencing a system font. - `flags` (`IN ASUns32`): Indicates whether to embed the font and whether to subset the font. It must be one of PDEFontCreateFlags. If you want to subset a font, set both the kPDEFontCreateEmbedded and kPDEFontWillSubset flags. **Returns:** [`PDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFont) The PDEFont corresponding to sysFont. **Exceptions** - `peErrCantCreateFontSubset` - `peErrCantGetAttrs` - `peErrCantGetWidths` - `peErrCantEmbedFont` - `genErrBadParm` - `genErrResourceLoadFailed` **See also:** [`PDEFontCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreate), [`PDEFontCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromCosObj), [`PDEFontCreateFromSysFontAndEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFontAndEncoding), [`PDEFontCreateFromSysFontWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFontWithParams), [`PDEnumSysFonts`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEnumSysFonts) #### PDEFontCreateFromSysFontAndEncoding ```cpp PDEFont PDEFontCreateFromSysFontAndEncoding(IN PDSysFont sysFont, IN PDSysEncoding sysEnc, IN ASAtom useThisBaseFont, IN ASUns32 createFlags) ``` Header: `PEWProcs.h:2160` Create a PDEFont from `sysFont` and `sysEnc`. If it fails, it raises an exception. User can call PDSysFontGetCreateFlags() to see if the combination of sysFont and sysEnc makes sense. Call PDERelease() to dispose of the returned PDEFont object when finished with it. **Note:** If you want to use `WinAnsiEncoding` on UNIX, use this method or PDEFontCreateFromSysFontWithParams(). **Parameters** - `sysFont` (`IN PDSysFont`): A PDSysFont object referencing a system font. - `sysEnc` (`IN PDSysEncoding`): A PDSysEncoding object. - `useThisBaseFont` (`IN ASAtom`): The base font. An exception will be raised if the base font name passed is a subset name `(XXXXXX+FontName)` or an empty string. - `createFlags` (`IN ASUns32`): One of the PDEFontCreateFlags. These are combined with the requirements reported by PDSysFontGetCreateFlags(), so the font may end up embedded or subset even when `createFlags` did not ask for it. **Returns:** [`PDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFont) The newly created PDEFont object. **Exceptions** - `peErrCantEmbedFont`: The sysFont's `PDEFontAttrs` report `cantEmbed` and the resolved create flags require embedding. **See also:** [`PDSysFontGetCreateFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetCreateFlags), [`PDSysFontGetAttrs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetAttrs) #### PDEFontCreateFromSysFontAndEncodingInCosDoc ```cpp PDEFont PDEFontCreateFromSysFontAndEncodingInCosDoc(IN PDSysFont sysFont, IN PDSysEncoding sysEnc, IN ASAtom useThisBaseFont, IN ASUns32 createFlags, IN CosDoc cosDoc) ``` Header: `PEWProcs.h:3068` Creates a font object like PDEFontCreateFromSysFontAndEncoding(), except that the client can specify the CosDoc in which the font is created. Create a PDEFont from `sysFont` and `sysEnc`. If it fails, it raises an exception. User can call PDSysFontGetCreateFlags() to see if the combination of sysFont and sysEnc makes sense. Call PDERelease() to dispose of the returned PDEFont object when finished with it. **Note:** If you want to use `WinAnsiEncoding` on UNIX, use this method or PDEFontCreateFromSysFontWithParams(). **Parameters** - `sysFont` (`IN PDSysFont`): A PDSysFont object referencing a system font. - `sysEnc` (`IN PDSysEncoding`): A PDSysEncoding object. - `useThisBaseFont` (`IN ASAtom`): The base font. An exception will be raised if the base font name passed is a subset name `(XXXXXX+FontName)` or an empty string. - `createFlags` (`IN ASUns32`): One of the PDEFontCreateFlags. These are combined with the requirements reported by PDSysFontGetCreateFlags(), so the font may end up embedded or subset even when `createFlags` did not ask for it. - `cosDoc` (`IN CosDoc`): IN/OUT The document in which to put the Cos representation of resource. It may be `NULL`. **Returns:** [`PDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFont) The newly created PDEFont object. **Exceptions** - `peErrBadFont` - `peErrCantEmbedFont`: The sysFont's `PDEFontAttrs` report `cantEmbed` and the resolved create flags require embedding. **See also:** [`PDSysFontGetCreateFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetCreateFlags), [`PDSysFontGetAttrs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetAttrs) #### PDEFontCreateFromSysFontEx ```cpp PDEFont PDEFontCreateFromSysFontEx(IN PDSysFont sysFont, IN ASUns32 flags, IN ASAtom snapshotName, IN ASFixed *mmDesignVec) ``` Header: `PEWProcs.h:1541` Creates a PDEFont corresponding to a font in the system. If the font is a Multiple Master font, `mmDesignVector` points to the design vector, whose length must equal the number of design axes of the font. Call PDERelease() to dispose of the returned font object when finished with it. The PDEFontCreateFlags flags kPDEFontCreateEmbedded and kPDEFontWillSubset must both be set in order to subset a font. If you create a PDEFont that is subsetted, call PDEFontSubsetNow() on this font afterwards. **Parameters** - `sysFont` (`IN PDSysFont`): IN/OUT A PDSysFont object referencing a system font. - `flags` (`IN ASUns32`): IN/OUT Indicates whether to embed the font and whether to subset the font. It must be one of PDEFontCreateFlags. If you want to subset a font, set both the kPDEFontCreateEmbedded and kPDEFontWillSubset flags. - `snapshotName` (`IN ASAtom`): IN/OUT The name to be associated with this particular instantiation of the PDEFont. - `mmDesignVec` (`IN ASFixed *`): IN/OUT A pointer to the Multiple Master font design vector. **Returns:** [`PDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFont) The PDEFont corresponding to `sysFont`. **Exceptions** - `peErrCantCreateFontSubset` - `peErrCantGetAttrs` - `peErrCantGetWidths` - `peErrCantEmbedFont` - `genErrBadParm` - `genErrResourceLoadFailed` **See also:** [`PDEFontCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromCosObj), [`PDEFontCreateFromSysFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFont), [`PDEFontCreateFromSysFontWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFontWithParams), [`PDEFontCreateWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateWithParams), [`PDEnumSysFonts`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEnumSysFonts) #### PDEFontCreateFromSysFontExInCosDoc ```cpp PDEFont PDEFontCreateFromSysFontExInCosDoc(IN PDSysFont sysFont, IN ASUns32 flags, IN ASAtom snapshotName, IN ASFixed *mmDesignVec, IN CosDoc cosDoc) ``` Header: `PEWProcs.h:2997` Creates a font object like PDEFontCreateFromSysFontEx(), except that the client can specify the CosDoc in which the font is created. If the font is a Multiple Master font, `mmDesignVector` points to the design vector, whose length must equal the number of design axes of the font. Call PDERelease() to dispose of the returned font object when finished with it. The PDEFontCreateFlags flags kPDEFontCreateEmbedded and kPDEFontWillSubset must both be set in order to subset a font. If you create a PDEFont that is subsetted, call PDEFontSubsetNow() on this font afterwards. **Parameters** - `sysFont` (`IN PDSysFont`): IN/OUT A PDSysFont object referencing a system font. - `flags` (`IN ASUns32`): IN/OUT Indicates whether to embed the font and whether to subset the font. It must be one of PDEFontCreateFlags. If you want to subset a font, set both the kPDEFontCreateEmbedded and kPDEFontWillSubset flags. - `snapshotName` (`IN ASAtom`): IN/OUT The name to be associated with this particular instantiation of the PDEFont. - `mmDesignVec` (`IN ASFixed *`): IN/OUT A pointer to the Multiple Master font design vector. - `cosDoc` (`IN CosDoc`): IN/OUT The document in which to put the Cos representation of resource. It may be `NULL`. **Returns:** [`PDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFont) The PDEFont corresponding to `sysFont`. **Exceptions** - `peErrCantCreateFontSubset` - `peErrCantGetAttrs` - `peErrCantGetWidths` - `peErrCantEmbedFont` - `genErrBadParm` - `genErrResourceLoadFailed` **See also:** [`PDEFontCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromCosObj), [`PDEFontCreateFromSysFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFont), [`PDEFontCreateFromSysFontWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFontWithParams), [`PDEFontCreateWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateWithParams), [`PDEnumSysFonts`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEnumSysFonts) #### PDEFontCreateFromSysFontInCosDoc ```cpp PDEFont PDEFontCreateFromSysFontInCosDoc(IN PDSysFont sysFont, IN ASUns32 flags, IN CosDoc cosDoc) ``` Header: `PEWProcs.h:2950` Creates a font object like PDEFontCreateFromSysFont(), except that the client can specify the CosDoc in which the font is created. Call PDERelease() to dispose of the returned font object when finished with it. The PDEFontCreateFlags flags kPDEFontCreateEmbedded and kPDEFontWillSubset must both be set in order to subset a font. If you create a PDEFont that is a subset, call PDEFontSubsetNow() on this font afterwards. **Note:** If you want to use `WinAnsiEncoding` on UNIX, do not use this method. Use PDEFontCreateFromSysFontWithParams() or PDEFontCreateFromSysFontAndEncoding() instead. **Parameters** - `sysFont` (`IN PDSysFont`): A PDSysFont object referencing a system font. - `flags` (`IN ASUns32`): Indicates whether to embed the font and whether to subset the font. It must be one of PDEFontCreateFlags. If you want to subset a font, set both the kPDEFontCreateEmbedded and kPDEFontWillSubset flags. - `cosDoc` (`IN CosDoc`): IN/OUT The document in which to put the Cos representation of resource. It may be `NULL`. **Returns:** [`PDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFont) The PDEFont corresponding to `sysFont`. **Exceptions** - `peErrCantCreateFontSubset` - `peErrCantGetAttrs` - `peErrCantGetWidths` - `peErrCantEmbedFont` - `genErrBadParm` - `genErrResourceLoadFailed` **See also:** [`PDEFontCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreate), [`PDEFontCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromCosObj), [`PDEFontCreateFromSysFontAndEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFontAndEncoding), [`PDEFontCreateFromSysFontWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFontWithParams), [`PDEnumSysFonts`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEnumSysFonts) #### PDEFontCreateFromSysFontWithParams ```cpp PDEFont PDEFontCreateFromSysFontWithParams(IN PDSysFont sysFont, IN PDEFontCreateFromSysFontParams params) ``` Header: `PEWProcs.h:2022` Used to obtain a PDEFont corresponding to a font in the system. Call PDERelease() to dispose of the returned PDEFont object when finished with it. **Note:** If you want to use `WinAnsiEncoding` on UNIX, use this method or PDEFontCreateFromSysFontAndEncoding() instead. **Parameters** - `sysFont` (`IN PDSysFont`): The system font. - `params` (`IN PDEFontCreateFromSysFontParams`): The parameters structure. **Returns:** [`PDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFont) The newly created PDEFont object. **Exceptions** - `peErrCantCreateFontSubset` - `genErrBadParm` #### PDEFontCreateInCosDoc ```cpp PDEFont PDEFontCreateInCosDoc(IN PDEFontAttrsP attrsP, IN ASUns32 attrsSize, IN ASInt32 firstChar, IN ASInt32 lastChar, IN ASInt16 *widthsP, IN char **encoding, IN ASAtom encodingBaseName, IN ASStm fontStm, IN ASInt32 len1, IN ASInt32 len2, IN ASInt32 len3, IN CosDoc cosDoc) ``` Header: `PEWProcs.h:2908` Creates a font object like PDEFontCreate(), except that the client can specify the CosDoc in which the font is created. The PDEFont may be represented as an embedded font (a FontFile entry in the font descriptor of the PDF file). To create a PDEFont that is stored as an embedded font, the FontFile stream may be passed in `fontStm`, and the `len1`, `len2`, and `len3` parameters contain the `Length1`, `Length2`, and `Length3` values of the FontFile stream attributes dictionary. See the description of Embedded Font Programs in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.9, page 288. You can find this document on the web store of the International Standards Organization (ISO). The caller must close `fontStm` with ASStmClose() after invoking PDEFontCreate(). Call PDERelease() to dispose of the returned font object when finished with it. **Parameters** - `attrsP` (`IN PDEFontAttrsP`): A pointer to a `PDEFontAttrs` structure for the font attributes. - `attrsSize` (`IN ASUns32`): The size of the `attrsP` buffer in bytes. - `firstChar` (`IN ASInt32`): The first character index for the widths array, `widthsP`. - `lastChar` (`IN ASInt32`): The last character index for the widths array, `widthsP`. - `widthsP` (`IN ASInt16 *`): A pointer to the widths array. - `encoding` (`IN char **`): An array of 256 pointers to glyph names specifying the custom encoding. If any pointer is `NULL`, no encoding information is written for that entry. - `encodingBaseName` (`IN ASAtom`): The encoding base name if the encoding is a custom encoding. If the encoding is `NULL`, `encodingBaseName` is used as the value of the encoding, and must be one of `WinAnsiEncoding`, `MacRomanEncoding`, or `MacExpertEncoding`. If no encoding value is desired, use ASAtomNull. - `fontStm` (`IN ASStm`): The stream with font information. - `len1` (`IN ASInt32`): The length in bytes of the ASCII portion of the Type 1 font file after it has been decoded. For other font formats, such as TrueType or CFF, only `len1` is used, and it is the size of the font. - `len2` (`IN ASInt32`): The length in bytes of the encrypted portion of the Type 1 font file after it has been decoded. - `len3` (`IN ASInt32`): The length in bytes of the portion of the Type 1 font file that contains the 512 zeros, plus the `cleartomark` operator, plus any following data. - `cosDoc` (`IN CosDoc`): IN/OUT The document in which to put the Cos representation of resource. It may be `NULL`. **Returns:** [`PDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFont) The specified PDEFont. **Exceptions** - `peErrCantCreateFontSubset` - `peErrCantGetAttrs` - `peErrCantGetWidths` - `peErrCantEmbedFont` - `genErrResourceLoadFailed` **See also:** [`PDEFontCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromCosObj), [`PDEFontCreateFromSysFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFont), [`PDEFontCreateFromSysFontEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFontEx), [`PDEFontCreateFromSysFontWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFontWithParams), [`PDEFontCreateWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateWithParams) #### PDEFontCreateToUnicodeNow ```cpp void PDEFontCreateToUnicodeNow(IN PDEFont font, IN CosDoc cosDoc) ``` Header: `PEWProcs.h:2215` This function creates the / ToUnicode table. The user can check the return value of PDEFontGetCreateNeedFlags() to see if calling PDEFontCreateToUnicodeNow() is needed. **Parameters** - `font` (`IN PDEFont`): IN/OUT An object of type PDEFont. - `cosDoc` (`IN CosDoc`): IN/OUT The container document. **Returns:** `void` **Exceptions** - `genErrBadParm` - `peErrWrongPDEObjectType` #### PDEFontCreateWidthsNow ```cpp void PDEFontCreateWidthsNow(IN PDEFont font, IN CosDoc cosDoc) ``` Header: `PEWProcs.h:2202` This function creates width entries for `font`. User can check the return value of PDEFontGetCreateNeedFlags() to see if calling PDEFontCreateWidthsNow() is needed. **Parameters** - `font` (`IN PDEFont`): IN/OUT The font for which to create width entries. - `cosDoc` (`IN CosDoc`): IN/OUT The container document. **Returns:** `void` **Exceptions** - `genErrBadParm` - `peErrWrongPDEObjectType` #### PDEFontCreateWithParams ```cpp PDEFont PDEFontCreateWithParams(IN PDEFontCreateParams params) ``` Header: `PEWProcs.h:1407` Creates a new PDEFont from `params`. The PDEFont may be represented as an embedded font (a FontFile value in PDF). To create a PDEFont that will be stored as an embedded font, the FontFile stream may be passed as `fontStm`, and the `len1`, `len2`, and `len3` parameters contain the Length1, Length2, and Length3 values of the FontFile. The caller must close the `fontStm` after calling this method. This method supports multi-byte fonts. This method extends PDEFontCreate() to support multi-byte fonts. Call PDERelease() to dispose of the returned font object when finished with it. @since **Parameters** - `params` (`IN PDEFontCreateParams`): IN/OUT A pointer to a structure containing all font parameters necessary to fully define a font. **Returns:** [`PDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFont) **Exceptions** - `peErrCantCreateFontSubset` - `peErrCantGetAttrs` - `peErrCantGetWidths` - `peErrCantEmbedFont` - `genErrBadParm` - `genErrResourceLoadFailed` **See also:** [`PDEFontCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreate), [`PDEFontCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromCosObj), [`PDEFontCreateFromSysFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFont), [`PDEFontCreateFromSysFontEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFontEx) #### PDEFontCreateWithParamsInCosDoc ```cpp PDEFont PDEFontCreateWithParamsInCosDoc(IN PDEFontCreateParams params, IN CosDoc cosDoc) ``` Header: `PEWProcs.h:3036` Creates a font object like PDEFontCreateWithParams(), except that the client can specify the CosDoc in which the font is created. Creates a new PDEFont from `params`. The PDEFont may be represented as an embedded font (a FontFile value in PDF). To create a PDEFont that will be stored as an embedded font, the FontFile stream may be passed as `fontStm`, and the `len1`, `len2`, and `len3` parameters contain the `Length1`, `Length2`, and `Length3` values of the FontFile. The caller must close the `fontStm` after calling this method. This method supports multi-byte fonts. This method extends PDEFontCreate() to support multi-byte fonts. Call PDERelease() to dispose of the returned font object when finished with it. **Parameters** - `params` (`IN PDEFontCreateParams`): IN/OUT A pointer to a structure containing all font parameters necessary to fully define a font. - `cosDoc` (`IN CosDoc`): IN/OUT The document in which to put the Cos representation of resource. It may be `NULL`. **Returns:** [`PDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFont) A PDEFont object of the font described by the parameters. **Exceptions** - `peErrCantCreateFontSubset` - `peErrCantGetAttrs` - `peErrCantGetWidths` - `peErrCantEmbedFont` - `genErrBadParm` - `genErrResourceLoadFailed` **See also:** [`PDEFontCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreate), [`PDEFontCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromCosObj), [`PDEFontCreateFromSysFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFont), [`PDEFontCreateFromSysFontEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFontEx) #### PDEFontEmbedNow ```cpp void PDEFontEmbedNow(IN PDEFont font, IN CosDoc cosDoc) ``` Header: `PEWProcs.h:2189` This function embeds a font stream. User can check the return value of PDEFontGetCreateNeedFlags() to see if calling PDEFontEmbedNow() is needed. **Parameters** - `font` (`IN PDEFont`): The font to embed. - `cosDoc` (`IN CosDoc`): The container document. **Returns:** `void` **Exceptions** - `peErrCantEmbedFont` - `peErrToUnicodeUsesPUA` - `peErrBadFont` - `genErrBadParm` - `peErrWrongPDEObjectType` **See also:** [`PDEFontEmbedNowDontSubset`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontEmbedNowDontSubset), [`PDEFontIsEmbedded`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontIsEmbedded) #### PDEFontEmbedNowDontSubset ```cpp void PDEFontEmbedNowDontSubset(IN PDEFont font, IN CosDoc cosDoc) ``` Header: `PEWProcs.h:1619` Embeds the given PDEFont inside doc without creating a subset. Use this method instead of PDEFontSubsetNow() if you created the font with the `willSubset` flag but changed your mind. **Parameters** - `font` (`IN PDEFont`): The font to embed. - `cosDoc` (`IN CosDoc`): The container document. **Returns:** `void` **See also:** [`PDEFontEmbedNow`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontEmbedNow), [`PDEFontIsEmbedded`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontIsEmbedded) #### PDEFontGetAttrs ```cpp void PDEFontGetAttrs(IN PDEFont font, OUT PDEFontAttrsP attrsP, IN ASUns32 attrsSize) ``` Header: `PERProcs.h:1039` Gets the attributes for a font object. **Note:** PDEFontGetAttrs() cannot fill in the `cantEmbed` and `protection` fields. PDSysFontAttrs() can return this information to you for system fonts. **Note:** PDEFontGetAttrs() fills in the `fontBBox` portion of the `PDEFontAttrs` as ASInt16 objects, even though the member says it is an `ASFixedRect`. Make sure to properly convert those values using ASInt16ToFixed() so that you get the proper `ASFixedRect` associated with that font. **Parameters** - `font` (`IN PDEFont`): IN/OUT A PDEFont whose attributes are found. - `attrsP` (`OUT PDEFontAttrsP`): IN/OUT (Filled by the method) A pointer to a `PDEFontAttrs` structure for the font attributes. - `attrsSize` (`IN ASUns32`): IN/OUT The size of the `attrsP` buffer in bytes. **Returns:** `void` **Exceptions** - `peErrCantGetAttrs` - `genErrBadParm` - `genErrResourceLoadFailed` **See also:** [`PDEFontGetNumCodeBytes`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontGetNumCodeBytes) #### PDEFontGetCosObj ```cpp void PDEFontGetCosObj(IN PDEFont font, OUT CosObj *cosObjP) ``` Header: `PERProcs.h:1071` Gets a Cos object for a PDEFont. **Parameters** - `font` (`IN PDEFont`): IN/OUT A PDEFont whose Cos object is obtained. - `cosObjP` (`OUT CosObj *`): IN/OUT (Filled by the method) The Cos object corresponding to `font`. **Returns:** `void` **Exceptions** - `genErrResourceLoadFailed` - `peErrWrongPDEObjectType` **See also:** [`PDEFontCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromCosObj) #### PDEFontGetCreateNeedFlags ```cpp ASUns32 PDEFontGetCreateNeedFlags(IN PDEFont font) ``` Header: `PEWProcs.h:2172` This function returns flags indicating what needs to be done to make PDEFont complete. kPDEFontCreateNeedWidths can be cleared by PDEFontCreateWidthsNow(). kPDEFontCreateNeedToUnicode can be cleared by PDEFontCreateToUnicodeNow(). kPDEFontCreateNeedEmbed can be cleared by PDEFontEmbedNow(). **Parameters** - `font` (`IN PDEFont`): The font object. **Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32) A value corresponding to PDEFontCreateNeedFlags(). #### PDEFontGetNumCodeBytes ```cpp ASInt16 PDEFontGetNumCodeBytes(IN PDEFont font, IN ASUns8 *text, IN ASInt32 len) ``` Header: `PERProcs.h:1563` Gets the number of bytes comprising the next code in a string of single or multi-byte character codes. **Parameters** - `font` (`IN PDEFont`): IN/OUT A PDEFont object returned from one of the `PDEFontCreate` methods. - `text` (`IN ASUns8 *`): IN/OUT A pointer to a string of characters. - `len` (`IN ASInt32`): IN/OUT The length, in bytes, of the string of characters, starting with the character pointed to by text. **Returns:** [`ASInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16) The number of bytes in the next character code pointed to by text. **Exceptions** - `genErrNoMemory` **See also:** [`PDEFontIsMultiByte`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontIsMultiByte), [`PDEFontSumWidths`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontSumWidths), [`PDEFontGetOneByteEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontGetOneByteEncoding) #### PDEFontGetOneByteEncoding ```cpp ASBool PDEFontGetOneByteEncoding(IN PDEFont font, OUT ASAtom *encodingDelta) ``` Header: `PERProcs.h:1788` Gets an array of delta encodings for the given one byte PDEFont. For encodingDelta, see the description of encoding in the ISO 32000 document, 1.7 or 2.0. You can find this document on the web store of the International Standards Organization. The array must be allocated to hold 256 entries. **Parameters** - `font` (`IN PDEFont`): IN/OUT A PDEFont object returned from one of the `PDEFontCreate` methods. - `encodingDelta` (`OUT ASAtom *`): IN/OUT (Filled by the method) A pointer to an ASAtom array that is filled with the delta encodings for font. Each entry is the ASAtom for a glyph name that differs from the base encoding. For more information about font encodings see the description of Base Encoding in the Character Encoding section of the ISO 32000-1:2008, Document Management- Portable Document Format-Part 1: PDF 1.7, section 9.6.6, page 262. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if `encodingDelta` is filled, `false` otherwise. **Exceptions** - `genErrNoMemory` **See also:** [`PDEFontIsMultiByte`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontIsMultiByte), [`PDEFontSumWidths`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontSumWidths), [`PDEFontGetNumCodeBytes`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontGetNumCodeBytes) #### PDEFontGetSysEncoding ```cpp PDSysEncoding PDEFontGetSysEncoding(IN PDEFont pdeFont) ``` Header: `PERProcs.h:2482` Gets the system encoding object associated with a font object. **Parameters** - `pdeFont` (`IN PDEFont`): A PDEFont whose system encoding is found. **Returns:** [`PDSysEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysEncoding) The system encoding object. **Exceptions** - `genErrBadParm` - `genErrResourceLoadFailed` **See also:** [`PDEFontSetSysEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontSetSysEncoding) #### PDEFontGetSysFont ```cpp PDSysFont PDEFontGetSysFont(IN PDEFont pdeFont) ``` Header: `PERProcs.h:2470` Gets the system font object associated with a font object. **Parameters** - `pdeFont` (`IN PDEFont`): A PDEFont whose system font is found. **Returns:** `PDSysFont` The system font object. **Exceptions** - `genErrBadParm` - `genErrResourceLoadFailed` **See also:** [`PDFindSysFontForPDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDFindSysFontForPDEFont), [`PDEFontSetSysFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontSetSysFont) #### PDEFontGetWidths ```cpp void PDEFontGetWidths(IN PDEFont font, OUT ASInt16 *widthsP) ``` Header: `PERProcs.h:1058` Gets the widths for a font object. **Parameters** - `font` (`IN PDEFont`): IN/OUT A PDEFont whose widths are found. - `widthsP` (`OUT ASInt16 *`): IN/OUT (Filled by the method) A pointer to the widths array. `widthsP` must have room for 256 values. The widths are returned in character space (1000 EM units). An EM is a typographic unit of measurement equal to the size of a font. To convert to text space, divide the value returned by `1000`. To convert to user space, multiply the text space value by the font size. **Returns:** `void` **Exceptions** - `peErrCantGetWidths` - `genErrBadParm` - `genErrResourceLoadFailed` **See also:** [`PDEFontCreateWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateWithParams) #### PDEFontGetWidthsNow ```cpp void PDEFontGetWidthsNow(IN PDEFont font, IN CosDoc cosDoc) ``` Header: `PEWProcs.h:1631` Gets a Type0 font's width information for only those characters used in the file. Call this routine when the font was created with the kPDEFontDeferWidths flag but without the kPDEFontCreateEmbedded flag (if the font is to be embedded, call PDEFontSubsetNow(), which also gets the width info). **Parameters** - `font` (`IN PDEFont`): The font whose widths are found. - `cosDoc` (`IN CosDoc`): The container document. **Returns:** `void` #### PDEFontIsEmbedded ```cpp ASBool PDEFontIsEmbedded(IN PDEFont pdeFont) ``` Header: `PERProcs.h:2457` Tests whether a font is an embedded font in the document in which it was created. **Parameters** - `pdeFont` (`IN PDEFont`): A PDEFont object to test. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the font is embedded, `false` if it is not, or if it was created in one document and embedded in a different document. **See also:** [`PDEFontEmbedNow`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontEmbedNow), [`PDEFontEmbedNowDontSubset`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontEmbedNowDontSubset) #### PDEFontIsMultiByte ```cpp ASBool PDEFontIsMultiByte(IN PDEFont font) ``` Header: `PERProcs.h:1592` Tests whether a font contains any multi-byte characters. **Parameters** - `font` (`IN PDEFont`): IN/OUT A PDEFont object returned from one of the `PDEFontCreate` methods to test. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the font contains any multi-byte characters, `false` otherwise. **See also:** [`PDEFontGetNumCodeBytes`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontGetNumCodeBytes), [`PDEFontSumWidths`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontSumWidths), [`PDEFontGetOneByteEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontGetOneByteEncoding) #### PDEFontSetSysEncoding ```cpp void PDEFontSetSysEncoding(IN PDEFont pdeFont, IN PDSysEncoding sysEnc) ``` Header: `PEWProcs.h:2378` Sets the system encoding object associated with a font object. **Note:** Changing the system encoding may produce unexpected results. **Parameters** - `pdeFont` (`IN PDEFont`): A PDEFont whose system encoding is set. - `sysEnc` (`IN PDSysEncoding`): The new system encoding object. **Returns:** `void` **Exceptions** - `genErrBadParm` - `genErrResourceLoadFailed` **See also:** [`PDEFontGetSysEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontGetSysEncoding) #### PDEFontSetSysFont ```cpp void PDEFontSetSysFont(IN PDEFont pdeFont, IN PDSysFont sysFont) ``` Header: `PEWProcs.h:2363` Sets the system font object to be used with a font object that does not currently have a system font associated with it. **Parameters** - `pdeFont` (`IN PDEFont`): A PDEFont whose system font is set. - `sysFont` (`IN PDSysFont`): The new system font object. **Returns:** `void` **Exceptions** - `genErrBadParm` - `genErrResourceLoadFailed` **See also:** [`PDEFontGetSysFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontGetSysFont) #### PDEFontSubsetNow ```cpp void PDEFontSubsetNow(IN PDEFont font, IN CosDoc cosDoc) ``` Header: `PEWProcs.h:1336` Subsets a given PDEFont in a CosDoc. If you created font with PDEFontCreateFromSysFont(), you must have set both the kPDEFontCreateEmbedded and kPDEFontWillSubset set in the `flags` parameter, to be able to subset the font. **Note:** This method does not change the reference count. **Parameters** - `font` (`IN PDEFont`): IN/OUT The PDEFont to subset. - `cosDoc` (`IN CosDoc`): IN/OUT The CosDoc whose font is subsetted. **Returns:** `void` **Exceptions** - `peErrCantCreateFontSubset` - `peErrCantGetAttrs` - `peErrCantGetWidths` - `peErrCantEmbedFont` - `peErrToUnicodeUsesPUA` - `peErrBadFont` - `genErrBadParm` - `genErrResourceLoadFailed` **See also:** [`PDEFontCreateFromSysFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFont) #### PDEFontSumWidths ```cpp ASInt32 PDEFontSumWidths(IN PDEFont font, IN ASUns8 *text, IN ASInt32 len) ``` Header: `PERProcs.h:1544` Gets the sum of the widths of `len` characters from a string of single or multi-byte characters. **Parameters** - `font` (`IN PDEFont`): A PDEFont object returned from one of the PDEFontCreate methods. - `text` (`IN ASUns8 *`): A pointer to a string of characters. - `len` (`IN ASInt32`): The length of string in bytes. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The width of the text string in EM space. (In EM space, the width of 'M' is about 1000 EM units). **Exceptions** - `genErrNoMemory` - `pdErrBadResMetrics` - `genErrResourceLoadFailed` - `peErrWrongPDEObjectType` **See also:** [`PDEFontGetNumCodeBytes`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontGetNumCodeBytes), [`PDEFontIsMultiByte`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontIsMultiByte), [`PDEFontGetOneByteEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontGetOneByteEncoding) #### PDEFontTranslateGlyphIdsToUnicode ```cpp ASUns32 PDEFontTranslateGlyphIdsToUnicode(IN PDEFont font, IN ASUns8 *text, IN ASUns32 textLen, OUT ASUns8 *unicodeStr, IN ASUns32 size) ``` Header: `PEWProcs.h:2040` Translates a string to Unicode values. The PDEFont must have a / ToUnicode table. **Parameters** - `font` (`IN PDEFont`): IN/OUT The font. - `text` (`IN ASUns8 *`): IN/OUT The string to convert. - `textLen` (`IN ASUns32`): IN/OUT The length of `text` in bytes. - `unicodeStr` (`OUT ASUns8 *`): IN/OUT (Filled by the method) A buffer to hold the translated string. - `size` (`IN ASUns32`): IN/OUT The size of the `unicodeStr` buffer. **Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32) `0` if the string was successfully translated. If `unicodeStr` is too small for the translated string, it returns the number of bytes required. **Exceptions** - `genErrBadParm` #### PDEReleaseSpan ```cpp void PDEReleaseSpan(IN PDESpanSetP pdeSpan) ``` Header: `PEWProcs.h:2693` Releases a PDESpan object that is returned by PDEFontAddGlyphs(). **Parameters** - `pdeSpan` (`IN PDESpanSetP`) **Returns:** `void` **Exceptions** - `genErrBadParm` **See also:** [`PDEFontAddGlyphs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontAddGlyphs) ### Structures (1) #### PDEFont ```cpp typedef struct _t_PDEFont* PDEFont ``` Header: `PEExpT.h:312` A reference to a font used on a page in a PDF file. It may be equated with a font in the system. A PDEFont is not the same as a PDFont; a PDFont is associated with a particular document. **See also:** [`PDEFontCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreate), [`PDEFontCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromCosObj), [`PDEFontCreateFromSysFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFont), [`PDEFontCreateFromSysFontEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFontEx), [`PDEFontCreateWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateWithParams), [`PDETextGetFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetFont), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease) ### Enums (2) #### PDEFontCreateFlags Header: `PEExpT.h:1954` Flags for `PDEFontCreateFromSysFont()`. If you want to subset a font, set both the `kPDEFontCreateEmbedded` and `kPDEFontWillSubset` flags. **Values** - `kPDEFontCreateEmbedded = 0x0001`: Embed the font. Create an embedded font. By itself, this will not subset the font. - `kPDEFontWillSubset = 0x0002`: Subset the font. If you want to subset a font, set both the `kPDEFontCreateEmbedded` and kPDEFontWillSubset flags. You must call `PDEFontSubsetNow()` to actually subset the font. Both embedding and subsetting a font creates a CFF font. - `kPDEFontDoNotEmbed = 0x0004`: Do not embed the font. You cannot set both this and the `kPDEFontWillSubset` flags. Nor can you set `kPDEFontCreateEmbedded`. This flag is a preference: if PDSysFontGetCreateFlags() reports `kPDEFontCreateEmbedded` for the PDSysFont/PDSysEncoding combination, embedding is required and this flag has no effect. - `kPDEFontEncodeByGID = 0x0008`: Create a CIDFont with identity (GID) encoding. - `kPDEFontDeferWidths = 0x0010`: Wait to get the widths until later (this affects Type0 fonts only). - `kPDEFontCreateSubset = kPDEFontWillSubset` - `kPDEFontCreateGIDOverride = 0x0020`: PDFLib will convert `cp` to `gid` with identity embedded. - `kPDEFontCreateToUnicode = 0x0040`: Create a ToUnicode CMap. - `kPDEFontCreateAllWidths = 0x0080`: Supply the entire widths table (this affects Type0 fonts only). - `kPDEFontCreateEmbedOpenType = 0x0100`: Embed an OpenType style font subset, if appropriate. - `kPDEFontCreateReserved1 = 0x0200`: Reserved for internal usage - `kPDEFontCreateFullCIDSet = 0x0400`: Create CIDSet entry from all CIDs present in subsetted Type0 CID Fonts containing glyph descriptions based on identity encoded TrueType fonts (subtype CIDFontType2). Subsetted identity encoded Type0 fonts can have more glyphs than asked for to avoid glyph renumbering. Default behavior is to only include CIDs used in PDF page content stream in CIDset - `kPDEFontThrowIfToUnicodeUsesPUA = 0x0800`: If kPDEFontThrowIfToUnicodeUsesPUA flag is passed along with kPDEFontCreateToUnicode and kPDEFontCreateSubset, throw error in PDEFont embedding APIs if the created ToUnicode table contains Private Use Area (Range: E000-F8FF in plane 0 and Supplemental Private Use Area A & B) Unicode values - `kPDEFontInvisibleRenderingMode = 0x1000`: Reserved for internal usage - This flag is passed if PDEFont is used with Text rendering mode 3(Invisible) • While converting to PDFXxx and PDFAxx if fetched fontfile stream data from Cooltype is empty (NULL) , then with this flag enabled entire fontfile stream data from input file is copied to embedded font in output file **See also:** [`PDEFontCreateFromSysFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFont), [`PDEFontCreateFromSysFontAndEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFontAndEncoding), [`PDEFontCreateFromSysFontWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFontWithParams), `kPDEFontWillSubset` #### PDEFontCreateNeedFlags Header: `PEExpT.h:2020` Flags for PDEFontGetCreateNeedFlags(). **Values** - `kPDEFontCreateNeedWidths = 0x00010000`: It is necessary to to create the width. - `kPDEFontCreateNeedToUnicode = 0x00020000`: It is necessary to to create the ToUnicode stream. - `kPDEFontCreateNeedEmbed = 0x00040000`: It is necessary to to embed it. ### Definitions (2) #### kPDEFontNoEditableEmbedding Header: `PEExpT.h:2045` Value: `0x00000002` Flags for protection of `PDEFontAttrs`: editable embedding is not allowed. The font may be embedded for viewing and printing, but the embedded copy is not licensed for editing the document. PDEFontEmbedNow() does not test this bit; an application that must honor it should check `protection` itself. **See also:** `PDEFontAttrs` #### kPDEFontNoEmbedding Header: `PEExpT.h:2036` Value: `0x00000001` Flags for protection of `PDEFontAttrs`: embedding is not allowed. `cantEmbed` is set whenever this bit is set. **See also:** `PDEFontAttrs` ## PDEForm ### Functions (17) #### PDEFormAcquireXGroup ```cpp PDEXGroup PDEFormAcquireXGroup(IN PDEForm pdeForm) ``` Header: `PERProcs.h:1999` Acquires the transparency group dictionary of the XObject form. Call PDERelease() to dispose of the PDEXGroup when finished with it. **Parameters** - `pdeForm` (`IN PDEForm`): IN/OUT The from. **Returns:** [`PDEXGroup`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEXGroup) The transparency group object. **Exceptions** - `peErrWrongPDEObjectType` #### PDEFormCreateClone ```cpp PDEForm PDEFormCreateClone(IN PDEForm form) ``` Header: `PEWProcs.h:2586` Creates a new form from an existing form object. Creates a copy of the PDEForm, including the underlying CosStream. Call PDERelease() to dispose of the returned PDEForm object when finished with it. **Parameters** - `form` (`IN PDEForm`): The form object from which a new PDEForm is created. **Returns:** [`PDEForm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEForm) The newly created form object. **See also:** [`PDEFormCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormCreateFromCosObj) #### PDEFormCreateFromCosObj ```cpp PDEForm PDEFormCreateFromCosObj(IN const CosObj *xObjectP, IN const CosObj *resourcesP, IN ASFixedMatrixP matrixP) ``` Header: `PEWProcs.h:735` Superseded by PDEFormCreateFromCosObjEx() in Acrobat 10.0. Creates a new form from an existing Cos object. Call PDERelease() to dispose of the returned form object when finished with it. **Parameters** - `xObjectP` (`IN const CosObj *`): The Cos object from which a PDEForm is created. - `resourcesP` (`IN const CosObj *`): The `xObjectP` parameter's Resources dictionary. If you do not pass in a Resource object, subsequent calls to PDPageAcquirePDEContent() will fail (after the file is saved). - `matrixP` (`IN ASFixedMatrixP`): A pointer to an `ASFixedMatrix` that holds the transformation matrix to use for the form. **Returns:** [`PDEForm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEForm) The newly created form object. **See also:** [`PDEFormCreateClone`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormCreateClone), [`PDEFormGetCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormGetCosObj), [`PDEFormCreateFromCosObjEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormCreateFromCosObjEx) #### PDEFormCreateFromCosObjEx ```cpp PDEForm PDEFormCreateFromCosObjEx(IN const CosObj *xObjectP, IN const CosObj *resourcesP, IN ASDoubleMatrixP matrixP) ``` Header: `PEWProcs.h:3681` Creates a new form from an existing Cos object. Supersedes PDEFormCreateFromCosObj() in Acrobat 10.0. Call PDERelease() to dispose of the returned form object when finished with it. **Parameters** - `xObjectP` (`IN const CosObj *`): The Cos object from which a PDEForm is created. - `resourcesP` (`IN const CosObj *`): The `xObjectP` parameter's Resources dictionary. If you do not pass in a Resource object, subsequent calls to PDPageAcquirePDEContent() will fail (after the file is saved). - `matrixP` (`IN ASDoubleMatrixP`): A pointer to an `ASDoubleMatrix` that holds the transformation matrix to use for the form. **Returns:** [`PDEForm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEForm) The newly created form object. **See also:** [`PDEFormCreateClone`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormCreateClone), [`PDEFormGetCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormGetCosObj), [`PDEFormCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormCreateFromCosObj) #### PDEFormGetBBox ```cpp void PDEFormGetBBox(IN PDEForm form, OUT ASFixedRectP bboxP) ``` Header: `PEWProcs.h:2784` Gets the bounding box for a PDEform. The result is the concatenation of the CTM and the Cos level form matrix applied on cos level bounding box. The returned bounding box is guaranteed to encompass the PDEForm, but is not guaranteed to be the smallest box that could contain the form object. Note: For other elements, PDEElementGetBBox() would return the correct bounding box values. **Parameters** - `form` (`IN PDEForm`): The PDEForm for which the bounding box is required. - `bboxP` (`OUT ASFixedRectP`): The resulting bounding box. **Returns:** `void` **See also:** [`PDEElementGetBBox`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementGetBBox), [`PDEFormGetMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormGetMatrix) #### PDEFormGetContent ```cpp PDEContent PDEFormGetContent(IN PDEForm form) ``` Header: `PEWProcs.h:749` Gets a PDEContent object for a form. **Note:** Unlike other `GetContent` methods, this method does increment the reference count of the returned PDEContent. Call PDERelease() to dispose of the returned PDEContent object when finished with it. **Parameters** - `form` (`IN PDEForm`): The form whose content is obtained. **Returns:** [`PDEContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContent) The content for `form`. **Exceptions** - `peErrWrongPDEObjectType` - `peErrPStackUnderflow` #### PDEFormGetContentToCosObjFlags ```cpp ASUns32 PDEFormGetContentToCosObjFlags(IN PDEForm form) ``` Header: `PERProcs.h:2998` Retrieves the `PDEContentToCosObjFlags` for this form. The flags were previously set by `PDEFormSetContentToCosObjFlags()`. **Parameters** - `form` (`IN PDEForm`) **Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32) #### PDEFormGetCosObj ```cpp void PDEFormGetCosObj(IN PDEForm form, OUT CosObj *cosObjP) ``` Header: `PERProcs.h:999` Gets a Cos object for a form. **Parameters** - `form` (`IN PDEForm`): IN/OUT The form whose Cos object is obtained. - `cosObjP` (`OUT CosObj *`): IN/OUT (Filled by the method) The Cos object for the form. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEFormCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormCreateFromCosObj) #### PDEFormGetLeading ```cpp ASDouble PDEFormGetLeading(IN PDEForm form) ``` Header: `PERProcs.h:3437` Gets the Leading set in parent of PDEForm element. **Parameters** - `form` (`IN PDEForm`): IN A form XObject object. **Returns:** [`ASDouble`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDouble) **See also:** [`PDEFormSetLeading`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormSetLeading) #### PDEFormGetMatrix ```cpp void PDEFormGetMatrix(IN PDEForm form, OUT ASFixedMatrixP matrixP) ``` Header: `PEWProcs.h:2769` Superseded by PDEFormGetMatrixEx() in Acrobat 10.0. Gets the matrix for a PDEform. The result is a concatenation of the CTM and the Cos level form matrix, resulting in the transformation from the form space to the device space. **Note:** For the other elements, PDEElementGetMatrix() would give correct results. **Parameters** - `form` (`IN PDEForm`): The form for which the matrix is required. - `matrixP` (`OUT ASFixedMatrixP`): The resultant matrix. **Returns:** `void` **See also:** `PDEElemetGetMatrix`, [`PDEFormGetBBox`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormGetBBox), [`PDEFormGetMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormGetMatrixEx) #### PDEFormGetMatrixEx ```cpp void PDEFormGetMatrixEx(IN PDEForm form, OUT ASDoubleMatrixP matrixP) ``` Header: `PEWProcs.h:3249` Gets the matrix for a PDEform. Supersedes PDEFormGetMatrix() in Acrobat 10.0. The result is a concatenation of the CTM and the Cos level form matrix, resulting in the transformation from the form space to the device space. **Note:** For the other elements, PDEElementGetMatrixEx() would give correct results. **Parameters** - `form` (`IN PDEForm`): The form for which the matrix is required. - `matrixP` (`OUT ASDoubleMatrixP`): The resultant matrix. **Returns:** `void` **See also:** `PDEElemetGetMatrix`, [`PDEFormGetBBox`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormGetBBox), [`PDEFormGetMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormGetMatrix) #### PDEFormHasXGroup ```cpp ASBool PDEFormHasXGroup(IN PDEForm pdeForm) ``` Header: `PERProcs.h:2010` Determines whether the XObject form has a Transparency XGroup **Parameters** - `pdeForm` (`IN PDEForm`): IN/OUT The form. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the XObject form has a Transparency XGroup. **Exceptions** - `peErrWrongPDEObjectType` #### PDEFormIsLeadingSet ```cpp ASBool PDEFormIsLeadingSet(IN PDEForm form) ``` Header: `PERProcs.h:3472` Returns whether text leading is set in parent of PDEForm element or not. **Parameters** - `form` (`IN PDEForm`): IN A form XObject object. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) **See also:** [`PDEFormSetLeading`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormSetLeading), [`PDEFormGetLeading`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormGetLeading) #### PDEFormSetContent ```cpp void PDEFormSetContent(IN PDEForm form, IN PDEContent content) ``` Header: `PEWProcs.h:2574` Sets the underlying CosStream of the form using the specified content object. **Parameters** - `form` (`IN PDEForm`): The form whose content is set. - `content` (`IN PDEContent`): The new content for `form`. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `peErrPStackUnderflow` **See also:** [`PDEFormGetContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormGetContent) #### PDEFormSetContentToCosObjFlags ```cpp void PDEFormSetContentToCosObjFlags(IN PDEForm form, IN ASUns32 flags) ``` Header: `PEWProcs.h:3232` Sets the `PDEContentToCosObjFlags` for this form. **Parameters** - `form` (`IN PDEForm`) - `flags` (`IN ASUns32`) **Returns:** `void` **Exceptions** - `genErrBadParm` #### PDEFormSetLeading ```cpp void PDEFormSetLeading(IN PDEForm form, IN ASDouble Leading) ``` Header: `PEWProcs.h:3848` Sets the Leading in parent of PDEForm element before form emit. **Parameters** - `form` (`IN PDEForm`): IN A form XObject object. - `Leading` (`IN ASDouble`) **Returns:** `void` **See also:** [`PDEFormGetLeading`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormGetLeading) #### PDEFormSetXGroup ```cpp void PDEFormSetXGroup(IN PDEForm pdeForm, IN PDEXGroup pdeXGroup) ``` Header: `PEWProcs.h:1814` Sets the transparency group dictionary of the form XObject. **Parameters** - `pdeForm` (`IN PDEForm`): IN/OUT The font XObject. - `pdeXGroup` (`IN PDEXGroup`): IN/OUT The transparency dictionary. **Returns:** `void` ### Structures (1) #### PDEForm ```cpp typedef struct _t_PDEForm* PDEForm ``` Header: `PEExpT.h:202` A PDEElement that corresponds to an instance of an XObject Form on a page (or another containing stream such as another XObject Form or annotation form). The context associated with this instance includes the actual CosObj stream that represents the XObject Form and the initial conditions of the graphics state. The latter consists of the transformation matrix, initial color values, and so forth. It is possible to have two PDEForm objects that refer to the same XObject Form. The forms will exist at different places on the same page, depending on the transformation matrix. They may also have different colors or line stroking parameters. In the case of a transparency group, the opacity is specified in the `gstate`. Within a PDEForm, each PDEElement has its own `gstate` (or is a container, place, or group object). These `gstates` are independent of the parent PDEForm `gstate`. PDEForm elements within the PDEForm may have their own opacity. A PDEContent may be obtained from a PDEForm to edit the form's display list. **See also:** `PDEElement (superclass)`, [`PDEFormCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFormCreateFromCosObj), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease) ## PDEGraphicFont ### Structures (1) #### PDEGraphicFont ```cpp typedef struct _t_PDEGraphicFont* PDEGraphicFont ``` Header: `PEExpT.h:430` ## PDEGroup ### Functions (3) #### PDEGroupCreate ```cpp PDEGroup PDEGroupCreate(void) ``` Header: `PEWProcs.h:1481` Creates a PDEGroup object. Call PDERelease() to dispose of the returned PDEGroup object when finished with it. **Parameters** - (unnamed) (`void`) **Returns:** [`PDEGroup`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEGroup) The newly created PDEGroup. **See also:** [`PDEGroupSetContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEGroupSetContent) #### PDEGroupGetContent ```cpp PDEContent PDEGroupGetContent(IN PDEGroup pdeGroup) ``` Header: `PERProcs.h:1634` Gets the PDEContent for a PDEGroup. **Note:** This method does not change the reference count of the returned PDEContent. **Parameters** - `pdeGroup` (`IN PDEGroup`): IN/OUT The group whose content is obtained. **Returns:** [`PDEContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContent) The PDEContent in `pdeGroup`. **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEGroupSetContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEGroupSetContent) #### PDEGroupSetContent ```cpp void PDEGroupSetContent(IN PDEGroup pdeGroup, IN PDEContent pdeContent) ``` Header: `PEWProcs.h:1496` Sets the PDEContent for a PDEGroup. The existing PDEContent is released by this method. **Note:** This method increments the reference count of `pdeContent`. **Parameters** - `pdeGroup` (`IN PDEGroup`): IN/OUT A container object. - `pdeContent` (`IN PDEContent`): IN/OUT The content to set for `pdeGroup`. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEGroupGetContent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEGroupGetContent) ### Structures (1) #### PDEGroup ```cpp typedef struct _t_PDEGroup* PDEGroup ``` Header: `PEExpT.h:257` An in-memory representation of objects in a PDEContent object. It has no state and is not represented in any way in a PDF content stream (that is, PDEContent). When used in a PDEClip, this object is used to associate PDEText objects into a single clipping object. **See also:** `PDEElement (superclass)`, [`PDEGroupCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEGroupCreate) ## PDEImage ### Functions (32) #### PDEImageAcquireImageFlate ```cpp PDEImageFlate PDEImageAcquireImageFlate(IN PDEImage image) ``` Header: `PERProcs.h:2663` Acquires the PDEImageFlate resource of the PDEImage content element when the image filter type is `"FlateDecode"`, or `0` if it is not. Call PDERelease() to dispose of the PDEImageFlate when finished with it. **Parameters** - `image` (`IN PDEImage`): IN/OUT The PDEImage object. **Returns:** [`PDEImageFlate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageFlate) a PDEImageFlate resource object. **Exceptions** - `peErrWrongPDEObjectType` #### PDEImageAcquireImageJPX ```cpp PDEImageJPX PDEImageAcquireImageJPX(IN PDEImage image) ``` Header: `PERProcs.h:2675` Acquires the PDEImageJPX resource of the PDEImage content element when the image filter type is `"JPXDecode"`, or `0` if it is not. Call PDERelease() to dispose of the PDEImageJPX when finished with it. **Parameters** - `image` (`IN PDEImage`): IN/OUT The PDEImage object. **Returns:** [`PDEImageJPX`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageJPX) a PDEImageJPX resource object. **Exceptions** - `peErrWrongPDEObjectType` #### PDEImageCreate ```cpp PDEImage PDEImageCreate(IN PDEImageAttrsP attrsP, IN ASUns32 attrsSize, IN ASFixedMatrixP matrixP, IN ASUns32 flags, IN PDEColorSpace colorSpace, IN PDEColorValueP colorValueP, IN PDEFilterArrayP filtersP, IN ASStm dataStm, IN ASUns8 *data, IN ASUns32 encodedLen) ``` Header: `PEWProcs.h:591` Superseded by PDEImageCreateEx() in Acrobat 10.0. Creates an image object. The image data may be specified as a stream or as a buffer. If `data` is non-`NULL`, `dataStm` is ignored. See PDEImageSetDataStm() for information on handling the stream. The caller must dispose of `dataStm` after calling this method. Call PDERelease() to dispose of the returned image object when finished with it. **Parameters** - `attrsP` (`IN PDEImageAttrsP`): IN/OUT A pointer to a PDEImageAttrs object with attributes of the image. - `attrsSize` (`IN ASUns32`): IN/OUT The size of the `attrsP` buffer in bytes. - `matrixP` (`IN ASFixedMatrixP`): IN/OUT A pointer to an `ASFixedMatrix` that holds the transformation matrix to use for the image. - `flags` (`IN ASUns32`): IN/OUT PDEImageDataFlags flags. If the kPDEImageEncodedData flag is set, and the data is provided directly (not as a stream), then `encodedLen` must specify the length of data. - `colorSpace` (`IN PDEColorSpace`): IN/OUT The color space of the image. When the image is an image mask, `colorSpace` is the color space of the `colorValueP` argument. - `colorValueP` (`IN PDEColorValueP`): IN/OUT A pointer to a `PDEColorValue` structure. If the image is an image mask, `colorValueP` must be provided. - `filtersP` (`IN PDEFilterArrayP`): IN/OUT A pointer to a `PDEFilterArray` structure that specifies which filters to use in encoding the contents; it may be `NULL`. Filters will be used to encode the data in the order in which they are specified in the array. - `dataStm` (`IN ASStm`): IN/OUT The stream holding the image data. - `data` (`IN ASUns8 *`): IN/OUT The image data. If `data` is non-`NULL`, `dataStm` is ignored. If there is a great deal of data, as for a large image, it is recommended you use the `dataStm` parameter for the image data or use the PDEImageCreateFromCosObj() method. - `encodedLen` (`IN ASUns32`): IN/OUT The encoded length of `data` in bytes. **Returns:** [`PDEImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage) The image. **Exceptions** - `peErrUnknownPDEColorSpace` - `pageErrReadLessImageData` - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDEImageCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreateFromCosObj), [`PDEImageCreateEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreateEx) #### PDEImageCreateEx ```cpp PDEImage PDEImageCreateEx(IN PDEImageAttrsP attrsP, IN ASUns32 attrsSize, IN ASDoubleMatrixP matrixP, IN ASUns32 flags, IN PDEColorSpace colorSpace, IN PDEColorValueP colorValueP, IN PDEFilterArrayP filtersP, IN ASStm dataStm, IN ASUns8 *data, IN ASUns64 encodedLen) ``` Header: `PEWProcs.h:3412` Creates an image object. Supersedes PDEImageCreate() in Acrobat 10.0. The image data may be specified as a stream or as a buffer. If `dataStm` is non-`NULL`, `data` is ignored. See PDEImageSetDataStm() for information on handling the stream. The caller must dispose of `dataStm` after calling this method. Call PDERelease() to dispose of the returned image object when finished with it. **Parameters** - `attrsP` (`IN PDEImageAttrsP`): IN/OUT A pointer to a PDEImageAttrs object with attributes of the image. - `attrsSize` (`IN ASUns32`): IN/OUT The size of the `attrsP` buffer in bytes. - `matrixP` (`IN ASDoubleMatrixP`): IN/OUT A pointer to an `ASDoubleMatrix` that holds the transformation matrix to use for the image. - `flags` (`IN ASUns32`): IN/OUT PDEImageDataFlags flags. If the kPDEImageEncodedData flag is set, and the data is provided directly (not as a stream), then `encodedLen` must specify the length of data. - `colorSpace` (`IN PDEColorSpace`): IN/OUT The color space of the image. When the image is an image mask, `colorSpace` is the color space of the `colorValueP` argument. - `colorValueP` (`IN PDEColorValueP`): IN/OUT A pointer to a `PDEColorValue` structure. If the image is an image mask, `colorValueP` must be provided. - `filtersP` (`IN PDEFilterArrayP`): IN/OUT A pointer to a `PDEFilterArray` structure that specifies which filters to use in encoding the contents; it may be `NULL`. Filters will be used to encode the data in the order in which they are specified in the array. - `dataStm` (`IN ASStm`): IN/OUT The stream holding the image data. - `data` (`IN ASUns8 *`): IN/OUT The image data. If `dataStm` is non-`NULL`, `data` is ignored. If there is a great deal of data, as for a large image, it is recommended you use the `dataStm` parameter for the image data or use the PDEImageCreateFromCosObjEx() method. - `encodedLen` (`IN ASUns64`): IN/OUT The encoded length of `data` in bytes. **Returns:** [`PDEImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage) The image. **Exceptions** - `peErrUnknownPDEColorSpace` - `pageErrReadLessImageData` - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDEImageCreateFromCosObjEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreateFromCosObjEx), [`PDEImageCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreate) #### PDEImageCreateFromCosObj ```cpp PDEImage PDEImageCreateFromCosObj(IN const CosObj *imageObjP, IN ASFixedMatrixP matrixP, IN PDEColorSpace colorSpace, IN PDEColorValueP colorValueP) ``` Header: `PEWProcs.h:621` Superseded by PDEImageCreateFromCosObjEx() in Acrobat 10.0. Creates an image object from a Cos object. Call PDERelease() to dispose of the returned image object when finished with it. **Parameters** - `imageObjP` (`IN const CosObj *`): IN/OUT The Cos object for the image. - `matrixP` (`IN ASFixedMatrixP`): IN/OUT A pointer to an `ASFixedMatrix` that holds the transformation matrix to use for the image. - `colorSpace` (`IN PDEColorSpace`): IN/OUT The color space used for the image, if the image is an image mask; otherwise, set it to `NULL`. - `colorValueP` (`IN PDEColorValueP`): IN/OUT A pointer to a `PDEColorValue` structure. If the image is an image mask, `colorValueP` must be provided. **Returns:** [`PDEImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage) An image corresponding to the Cos object. **Exceptions** - `peErrUnknownPDEColorSpace` - `pageErrReadLessImageData` - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDEImageCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreate), [`PDEImageGetCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetCosObj), [`PDEImageCreateFromCosObjEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreateFromCosObjEx) #### PDEImageCreateFromCosObjEx ```cpp PDEImage PDEImageCreateFromCosObjEx(IN const CosObj *imageObjP, IN ASDoubleMatrixP matrixP, IN PDEColorSpace colorSpace, IN PDEColorValueP colorValueP) ``` Header: `PEWProcs.h:3480` Creates an image object from a Cos object. Supersedes PDEImageCreateFromCosObj() in Acrobat 10.0. Call PDERelease() to dispose of the returned image object when finished with it. **Parameters** - `imageObjP` (`IN const CosObj *`): IN/OUT The Cos object for the image. - `matrixP` (`IN ASDoubleMatrixP`): IN/OUT A pointer to an `ASDoubleMatrix` that holds the transformation matrix to use for the image. - `colorSpace` (`IN PDEColorSpace`): IN/OUT The color space used for the image, if the image is an image mask; otherwise, set it to `NULL`. - `colorValueP` (`IN PDEColorValueP`): IN/OUT A pointer to a `PDEColorValue` structure. If the image is an image mask, `colorValueP` must be provided. **Returns:** [`PDEImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage) An image corresponding to the Cos object. **Exceptions** - `peErrUnknownPDEColorSpace` - `pageErrReadLessImageData` - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDEImageCreateEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreateEx), [`PDEImageGetCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetCosObj), [`PDEImageCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreateFromCosObj) #### PDEImageCreateInCosDoc ```cpp PDEImage PDEImageCreateInCosDoc(IN PDEImageAttrsP attrsP, IN ASUns32 attrsSize, IN ASFixedMatrixP matrixP, IN ASUns32 flags, IN PDEColorSpace colorSpace, IN PDEColorValueP colorValueP, IN PDEFilterArrayP filtersP, IN ASStm dataStm, IN ASUns8 *data, IN ASUns32 encodedLen, IN CosDoc cosDoc) ``` Header: `PEWProcs.h:2842` Superseded by PDEImageCreateInCosDocEx() in Acrobat 10.0. Creates an image object like PDEImageCreate(), except that the client can specify the CosDoc in which the image is created. The image data may be specified as a stream or as a buffer. If `data` is non-`NULL`, `dataStm` is ignored. See PDEImageSetDataStm() for information on handling the stream. The caller must dispose of `dataStm` after calling this method. Call PDERelease() to dispose of the returned image object when finished with it. **Parameters** - `attrsP` (`IN PDEImageAttrsP`): IN/OUT A pointer to a PDEImageAttrs object with attributes of the image. - `attrsSize` (`IN ASUns32`): IN/OUT The size of the `attrsP` buffer in bytes. - `matrixP` (`IN ASFixedMatrixP`): IN/OUT A pointer to an `ASFixedMatrix` that holds the transformation matrix to use for the image. - `flags` (`IN ASUns32`): IN/OUT PDEImageDataFlags flags. If the kPDEImageEncodedData flag is set, and the data is provided directly (not as a stream), then `encodedLen` must specify the length of data. - `colorSpace` (`IN PDEColorSpace`): IN/OUT The color space of the image. When the image is an image mask, `colorSpace` is the color space of the `colorValueP` argument. - `colorValueP` (`IN PDEColorValueP`): IN/OUT A pointer to a `PDEColorValue` structure. If the image is an image mask, `colorValueP` must be provided. - `filtersP` (`IN PDEFilterArrayP`): IN/OUT A pointer to a `PDEFilterArray` structure that specifies which filters to use in encoding the contents; it may be `NULL`. Filters will be used to encode the data in the order in which they are specified in the array. - `dataStm` (`IN ASStm`): IN/OUT The stream holding the image data. - `data` (`IN ASUns8 *`): IN/OUT The image data. If `data` is non-`NULL`, `dataStm` is ignored. If there is a great deal of data, as for a large image, it is recommended you use the `dataStm` parameter for the image data or use the PDEImageCreateFromCosObj() method. - `encodedLen` (`IN ASUns32`): IN/OUT The encoded length of `data` in bytes. - `cosDoc` (`IN CosDoc`): IN/OUT Document in which to put Cos representation of resource. May be NULL. **Returns:** [`PDEImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage) The image. **Exceptions** - `peErrUnknownPDEColorSpace` - `pageErrReadLessImageData` - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDEImageCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreateFromCosObj), [`PDEImageCreateInCosDocEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreateInCosDocEx) #### PDEImageCreateInCosDoc64 ```cpp PDEImage PDEImageCreateInCosDoc64(IN PDEImageAttrsP attrsP, IN ASUns32 attrsSize, IN ASFixedMatrixP matrixP, IN ASUns32 flags, IN PDEColorSpace colorSpace, IN PDEColorValueP colorValueP, IN PDEFilterArrayP filtersP, IN ASStm dataStm, IN ASUns8 *data, IN ASUns64 encodedLen, IN CosDoc cosDoc) ``` Header: `PEWProcs.h:3212` Superseded by PDEImageCreateInCosDocEx() in Acrobat 10.0. Creates an image object like PDEImageCreateInCosDoc(), except that the client can create an image with a large amount of data. The image data may be specified as a stream or as a buffer. If `data` is non-`NULL`, `dataStm` is ignored. See PDEImageSetDataStm() for information on handling the stream. The caller must dispose of `dataStm` after calling this method. Call PDERelease() to dispose of the returned image object when finished with it. **Parameters** - `attrsP` (`IN PDEImageAttrsP`): IN/OUT A pointer to a PDEImageAttrs object with attributes of the image. - `attrsSize` (`IN ASUns32`): IN/OUT The size of the `attrsP` buffer in bytes. - `matrixP` (`IN ASFixedMatrixP`): IN/OUT A pointer to an `ASFixedMatrix` that holds the transformation matrix to use for the image. - `flags` (`IN ASUns32`): IN/OUT PDEImageDataFlags flags. If the kPDEImageEncodedData flag is set, and the data is provided directly (not as a stream), then `encodedLen` must specify the length of data. - `colorSpace` (`IN PDEColorSpace`): IN/OUT The color space of the image. When the image is an image mask, `colorSpace` is the color space of the `colorValueP` argument. - `colorValueP` (`IN PDEColorValueP`): IN/OUT A pointer to a `PDEColorValue` structure. If the image is an image mask, `colorValueP` must be provided. - `filtersP` (`IN PDEFilterArrayP`): IN/OUT A pointer to a `PDEFilterArray` structure that specifies which filters to use in encoding the contents; it may be `NULL`. Filters will be used to encode the data in the order in which they are specified in the array. - `dataStm` (`IN ASStm`): IN/OUT The stream holding the image data. - `data` (`IN ASUns8 *`): IN/OUT The image data. If `data` is non-`NULL`, `dataStm` is ignored. If there is a great deal of data, as for a large image, it is recommended you use the `dataStm` parameter for the image data or use the PDEImageCreateFromCosObj() method. - `encodedLen` (`IN ASUns64`): IN/OUT The encoded length of `data` in bytes. - `cosDoc` (`IN CosDoc`): IN/OUT The document in which to put the Cos representation of the resource. It may be `NULL`. **Returns:** [`PDEImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage) The image. **Exceptions** - `peErrUnknownPDEColorSpace` - `pageErrReadLessImageData` - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDEImageCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreateFromCosObj), [`PDEImageCreateInCosDocEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreateInCosDocEx) #### PDEImageCreateInCosDocEx ```cpp PDEImage PDEImageCreateInCosDocEx(IN PDEImageAttrsP attrsP, IN ASUns32 attrsSize, IN ASDoubleMatrixP matrixP, IN ASUns32 flags, IN PDEColorSpace colorSpace, IN PDEColorValueP colorValueP, IN PDEFilterArrayP filtersP, IN ASStm dataStm, IN ASUns8 *data, IN ASUns64 encodedLen, IN CosDoc cosDoc) ``` Header: `PEWProcs.h:3357` Creates an image object like PDEImageCreateInCosDoc(), except that the client can create an image with a large amount of data, and using a double precision transformation matrix. Supersedes PDEImageCreateInCosDoc() and PDEImageCreateInCosDoc64() in Acrobat 10.0. The image data may be specified as a stream or as a buffer. If `dataStm` is non-`NULL`, `data` is ignored. See PDEImageSetDataStm() for information on handling the stream. The caller must dispose of `dataStm` after calling this method. Call PDERelease() to dispose of the returned image object when finished with it. **Parameters** - `attrsP` (`IN PDEImageAttrsP`): IN/OUT A pointer to a PDEImageAttrs object with attributes of the image. - `attrsSize` (`IN ASUns32`): IN/OUT The size of the `attrsP` buffer in bytes. - `matrixP` (`IN ASDoubleMatrixP`): IN/OUT A pointer to an `ASDoubleMatrix` that holds the transformation matrix to use for the image. - `flags` (`IN ASUns32`): IN/OUT PDEImageDataFlags flags. If the kPDEImageEncodedData flag is set, and the data is provided directly (not as a stream), then `encodedLen` must specify the length of data. - `colorSpace` (`IN PDEColorSpace`): IN/OUT The color space of the image. When the image is an image mask, `colorSpace` is the color space of the `colorValueP` argument. - `colorValueP` (`IN PDEColorValueP`): IN/OUT A pointer to a `PDEColorValue` structure. If the image is an image mask, `colorValueP` must be provided. - `filtersP` (`IN PDEFilterArrayP`): IN/OUT A pointer to a `PDEFilterArray` structure that specifies which filters to use in encoding the contents; it may be `NULL`. Filters will be used to encode the data in the order in which they are specified in the array. - `dataStm` (`IN ASStm`): IN/OUT The stream holding the image data. - `data` (`IN ASUns8 *`): IN/OUT The image data. If `dataStm` is non-`NULL`, `data` is ignored. If there is a great deal of data, as for a large image, it is recommended you use the `dataStm` parameter for the image data or use the PDEImageCreateFromCosObjEx() method. - `encodedLen` (`IN ASUns64`): IN/OUT The encoded length of `data` in bytes. - `cosDoc` (`IN CosDoc`): IN/OUT The document in which to put the Cos representation of the resource. It may be `NULL`. **Returns:** [`PDEImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage) The image. **Exceptions** - `peErrUnknownPDEColorSpace` - `pageErrReadLessImageData` - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDEImageCreateFromCosObjEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreateFromCosObjEx), [`PDEImageCreateInCosDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreateInCosDoc), [`PDEImageCreateInCosDoc64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreateInCosDoc64) #### PDEImageDataIsEncoded ```cpp ASBool PDEImageDataIsEncoded(IN PDEImage image, OUT ASUns32 *encodedLenP) ``` Header: `PERProcs.h:818` Determines if image data is encoded or not. It is used only for inline images; it is not relevant to XObject images. It always returns `false` for XObject images; XObject image data can be obtained from PDEImageGetData() or PDEImageGetDataStm(), either encoded or decoded. If an inline image is obtained via PDEContentCreateFromCosObj() or related methods, the inline image data is always decoded. That is, if PDFEdit parses the stream, the data is always decoded. Only if PDEImageCreate() is used to explicitly create a new image using encoded data does PDEImageDataIsEncoded() return `true`. **Parameters** - `image` (`IN PDEImage`): IN/OUT The image to examine. - `encodedLenP` (`OUT ASUns32 *`): IN/OUT (Filled by the method) The length of the encoded data. If the data is encoded, the method returns `true`.`true` if PDEImageGetData returns encoded data, `false` otherwise. It returns `false` for XObject images. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEImageGetData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetData) #### PDEImageGetAttrs ```cpp void PDEImageGetAttrs(IN PDEImage image, IN PDEImageAttrsP attrsP, IN ASUns32 attrsSize) ``` Header: `PERProcs.h:758` Gets the attributes for an image. **Parameters** - `image` (`IN PDEImage`): IN/OUT The image whose attributes are obtained. - `attrsP` (`IN PDEImageAttrsP`): IN/OUT (Filled by the method) A pointer to a PDEImageAttrs structure with attributes of image. - `attrsSize` (`IN ASUns32`): IN/OUT The size of the `attrsP` buffer in bytes. **Returns:** `void` **Exceptions** - `peErrUnknownPDEColorSpace` **See also:** [`PDEImageGetColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetColorSpace), [`PDEImageGetData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetData), [`PDEImageGetDataLen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetDataLen), [`PDEImageGetDataStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetDataStm), [`PDEImageGetDecodeArray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetDecodeArray), [`PDEImageGetFilterArray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetFilterArray) #### PDEImageGetColorSpace ```cpp PDEColorSpace PDEImageGetColorSpace(IN PDEImage image) ``` Header: `PERProcs.h:778` Gets the color space object for an image. **Parameters** - `image` (`IN PDEImage`): IN/OUT The image whose color space is obtained. **Returns:** [`PDEColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpace) **See also:** [`PDEImageGetAttrs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetAttrs), [`PDEImageGetData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetData), [`PDEImageGetDataLen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetDataLen), [`PDEImageGetDataStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetDataStm), [`PDEImageGetDecodeArray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetDecodeArray), [`PDEImageGetFilterArray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetFilterArray) #### PDEImageGetColorSpaceEx ```cpp PDEColorSpace PDEImageGetColorSpaceEx(IN PDEImage image, IN ASUns32 flags) ``` Header: `PERProcs.h:2992` Retrieves a `PDEImage` object's color space, in the desired bits per component, based on the `flags` parameter. **Parameters** - `image` (`IN PDEImage`): IN The `PDEImage` instance whose color space is desired. - `flags` (`IN ASUns32`): IN A set of flags to specify the desired bits per component (bpc) of the returned color space. **Returns:** [`PDEColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpace) **See also:** [`PDEImageGetColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetColorSpace), [`PDEImageColorSpaceFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageColorSpaceFlags) #### PDEImageGetCosObj ```cpp void PDEImageGetCosObj(IN PDEImage image, OUT CosObj *cosObjP) ``` Header: `PERProcs.h:917` Gets a Cos object for an image. **Parameters** - `image` (`IN PDEImage`): IN/OUT The image whose Cos object is obtained. - `cosObjP` (`OUT CosObj *`): IN/OUT (Filled by the method) The Cos object for the image. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEImageCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreateFromCosObj), [`PDEImageIsCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageIsCosObj) #### PDEImageGetData ```cpp void PDEImageGetData(IN PDEImage image, IN ASUns32 flags, IN ASUns8 *buffer) ``` Header: `PERProcs.h:850` Gets an image's data. If the image is an XObject image, data is always returned as decoded data. See the note about inline images under PDEImageDataIsEncoded(). **Parameters** - `image` (`IN PDEImage`): IN/OUT The image whose data is obtained. - `flags` (`IN ASUns32`): IN/OUT Unused - must be zero. - `buffer` (`IN ASUns8 *`): IN/OUT The image data. If the data is decoded, `buffer` must be large enough to contain the number of bytes specified in the PDEImageAttrs structure obtained by PDEImageGetAttrs(). If the data is encoded, `buffer` must be large enough to contain the number of bytes in the `encodedLenP` parameter obtained by PDEImageDataIsEncoded(). **Returns:** `void` **Exceptions** - `peErrUnknownPDEColorSpace` - `genErrBadParm` - `peErrWrongPDEObjectType` **See also:** [`PDEImageDataIsEncoded`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageDataIsEncoded), [`PDEImageSetColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageSetColorSpace), [`PDEImageGetAttrs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetAttrs), [`PDEImageGetColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetColorSpace), [`PDEImageGetDataLen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetDataLen), [`PDEImageGetDataStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetDataStm), [`PDEImageGetDecodeArray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetDecodeArray), [`PDEImageGetFilterArray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetFilterArray) #### PDEImageGetDataLen ```cpp ASInt32 PDEImageGetDataLen(IN PDEImage image) ``` Header: `PERProcs.h:885` Gets the length of data for an image. **Parameters** - `image` (`IN PDEImage`): IN/OUT The image whose data length is obtained. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The number of bytes of image data, specified by the width, height, bits per component, and color space of the image. **Exceptions** - `peErrUnknownPDEColorSpace` - `genErrBadParm` - `peErrWrongPDEObjectType` **See also:** [`PDEImageGetData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetData) #### PDEImageGetDataLen64 ```cpp ASInt64 PDEImageGetDataLen64(IN PDEImage image) ``` Header: `PEWProcs.h:3151` Gets the length of data for an image. **Parameters** - `image` (`IN PDEImage`): IN/OUT The image whose data length is obtained. **Returns:** [`ASInt64`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt64) The number of bytes of image data, specified by the width, height, bits per component, and color space of the image. Clients should switch to this routine. PDEImageGetDataLen() will raise an error if it encounters an image with a length that is larger than `2^31 - 1`. **Exceptions** - `peErrUnknownPDEColorSpace` - `genErrBadParm` - `peErrWrongPDEObjectType` **See also:** [`PDEImageGetDataLen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetDataLen) #### PDEImageGetDataStm ```cpp ASStm PDEImageGetDataStm(IN PDEImage image, IN ASUns32 flags) ``` Header: `PERProcs.h:871` Gets a data stream for an image. It may only be called for XObject images. The caller must dispose of the returned ASStm by calling ASStmClose. **Parameters** - `image` (`IN PDEImage`): IN/OUT The image whose data stream is obtained. - `flags` (`IN ASUns32`): IN/OUT PDEImageDataFlags flags. If the kPDEImageEncodedData flag is set, data is returned in encoded form. Otherwise, data is decoded. **Returns:** [`ASStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStm) The stream for the image. **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDEImageSetDataStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageSetDataStm), [`PDEImageGetDataLen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetDataLen) #### PDEImageGetDecodeArray ```cpp ASUns32 PDEImageGetDecodeArray(IN PDEImage image, OUT ASFixed *decode, IN ASUns32 decodeSize) ``` Header: `PERProcs.h:1850` Gets the decode array from the attributes of the image. This array specifies the parameters used with the array of filters used to decode the image. This should be called first with a `NULL` `decode` to obtain the number of elements that may be returned so that a properly sized array can be allocated for a subsequent call. There are two decode entries per colorant in normal use. **Parameters** - `image` (`IN PDEImage`): The image whose decode array is obtained. - `decode` (`OUT ASFixed *`): (Filled by the method) A pointer to the `decode` array. If it is `NULL`, the number of `decode` elements required is returned. - `decodeSize` (`IN ASUns32`): The number of elements in `decode`. **Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32) The number of elements in the `decode` array. **See also:** [`PDEImageSetDecodeArray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageSetDecodeArray) #### PDEImageGetFilterArray ```cpp ASInt32 PDEImageGetFilterArray(IN PDEImage image, OUT PDEFilterArrayP filtersP) ``` Header: `PERProcs.h:904` Gets the filter array for an image. **Parameters** - `image` (`IN PDEImage`): IN/OUT The image whose filter array is obtained. - `filtersP` (`OUT PDEFilterArrayP`): IN/OUT (Filled by the method) A pointer to `PDEFilterArray` structure to fill with the current filter array for the image. `filtersP` must be large enough to contain all of the elements. It may be `NULL` to obtain the number of filter elements. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The number of filter elements. **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEImageGetAttrs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetAttrs), [`PDEImageGetColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetColorSpace), [`PDEImageGetDataLen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetDataLen), [`PDEImageGetDecodeArray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetDecodeArray) #### PDEImageGetMatteArray ```cpp ASUns32 PDEImageGetMatteArray(IN PDEImage image, OUT ASFixed *matte, IN ASUns32 numComp) ``` Header: `PERProcs.h:2204` Gets the matte array for the image XObject. **Parameters** - `image` (`IN PDEImage`): IN/OUT The image XObject. - `matte` (`OUT ASFixed *`): IN/OUT (Filled by the method) An array of values. - `numComp` (`IN ASUns32`): IN/OUT The number of values in `matte`. **Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32) The number of values copied. #### PDEImageGetSMask ```cpp PDEImage PDEImageGetSMask(IN PDEImage image) ``` Header: `PERProcs.h:2192` Gets the soft mask for an image. Use PDERelease() to dispose of the object when it is no longer referenced. **Parameters** - `image` (`IN PDEImage`): An object of type PDEImage. **Returns:** [`PDEImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage) An object of type PDEImage. **Exceptions** - `peErrWrongPDEObjectType` #### PDEImageGetType ```cpp ASAtom PDEImageGetType(IN PDEImage image) ``` Header: `PERProcs.h:2651` Returns the type of image as `"FlateDecode"`, `"JPXDecode"`, or `"Unknown"` when the image filter is not one of these types. **Parameters** - `image` (`IN PDEImage`): IN/OUT The PDEImage object. **Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom) See above. **Exceptions** - `peErrWrongPDEObjectType` #### PDEImageHasSMask ```cpp ASBool PDEImageHasSMask(IN PDEImage image) ``` Header: `PERProcs.h:2182` Checks whether the image has a soft mask. **Parameters** - `image` (`IN PDEImage`): IN/OUT An object of type PDEImage. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the soft mask exists, `false` otherwise. **Exceptions** - `peErrWrongPDEObjectType` #### PDEImageIsCosObj ```cpp ASBool PDEImageIsCosObj(IN PDEImage image) ``` Header: `PERProcs.h:790` Determines if an image is an XObject image. **Parameters** - `image` (`IN PDEImage`): IN/OUT The image to examine. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the image is an XObject image, `false` otherwise. **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEImageGetCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetCosObj) #### PDEImageSetColorSpace ```cpp void PDEImageSetColorSpace(IN PDEImage image, IN PDEColorSpace space) ``` Header: `PEWProcs.h:2227` Sets the color space of the image. **Parameters** - `image` (`IN PDEImage`): IN/OUT The image whose color space is obtained. - `space` (`IN PDEColorSpace`): IN/OUT An object of type PDEColorSpace. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEImageGetColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetColorSpace), [`PDEImageSetColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageSetColorSpace) #### PDEImageSetColorValue ```cpp void PDEImageSetColorValue(IN PDEImage image, IN PDEColorValueP color) ``` Header: `PERProcs.h:3379` Sets an image's Color Value. This call is valid only for a PDEImage which is an Image Mask **Parameters** - `image` (`IN PDEImage`): IN/OUT The image whose data is set. - `color` (`IN PDEColorValueP`) **Returns:** `void` **Exceptions** - `peErrUnknownPDEColorSpace` - `genErrBadParm` - `peErrWrongPDEObjectType` #### PDEImageSetData ```cpp void PDEImageSetData(IN PDEImage image, IN ASUns32 flags, IN ASUns8 *buffer, IN ASUns32 encodedLen) ``` Header: `PEWProcs.h:507` Sets data for an image. **Parameters** - `image` (`IN PDEImage`): IN/OUT The image whose data is set. - `flags` (`IN ASUns32`): IN/OUT A set of PDEImageDataFlags flags. If kPDEImageEncodedData is set, the data must be encoded for the current filters, and `encodedLen` is the length of the encoded data. If the kPDEImageEncodedData flag is not set, data is not encoded and `encodedLen` is the size of the decoded data. - `buffer` (`IN ASUns8 *`): IN/OUT The image data. - `encodedLen` (`IN ASUns32`): IN/OUT The length of the encoded data. **Returns:** `void` **Exceptions** - `peErrUnknownPDEColorSpace` - `genErrBadParm` - `peErrWrongPDEObjectType` **See also:** [`PDEImageGetData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetData), [`PDEImageGetDataLen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetDataLen), [`PDEImageGetDataStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetDataStm) #### PDEImageSetDataStm ```cpp void PDEImageSetDataStm(IN PDEImage image, IN ASUns32 flags, IN PDEFilterArrayP filtersP, IN ASStm stm) ``` Header: `PEWProcs.h:538` Sets a data stream for an image. It can only be used for XObject images. The caller must dispose of the stream by calling ASStmClose(). **Parameters** - `image` (`IN PDEImage`): IN/OUT The image whose data stream is set. - `flags` (`IN ASUns32`): IN/OUT PDEImageDataFlags flags. If the kPDEImageEncodedData flag is set, the stream must be encoded. - `filtersP` (`IN PDEFilterArrayP`): IN/OUT A pointer to a `PDEFilterArray` structure. If it is not `NULL`, it is used to build Cos objects for the Filter, DecodeParms, and EncodeParms objects. If `filtersP` is `NULL` and `kPDEImageEncodedData` is set in `flags`, the existing Filter and DecodeParms are used. If `kPDEImageEncodedData` is not set and `filtersP` is `NULL`, the existing Cos objects (if any) for Filter and DecodeParms are removed and the resulting image is no longer compressed. EncodeParms is set it to DecodeParms if it exists (unless the filter is DCTDecode, for which EncodeParms is mandatory). - `stm` (`IN ASStm`): IN/OUT The stream for the image data. **Returns:** `void` **Exceptions** - `peErrUnknownPDEColorSpace` - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDEImageGetData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetData), [`PDEImageGetDataLen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetDataLen), [`PDEImageGetDataStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetDataStm) #### PDEImageSetDecodeArray ```cpp void PDEImageSetDecodeArray(IN PDEImage image, IN ASFixed *decode, IN ASUns32 decodeSize) ``` Header: `PEWProcs.h:1572` Sets the decode array of an image. Normally, the decode array is accessed through the `decode` field in the PDEImageAttrs structure. However, this method defines a decode array to handle images with a color space that has more than four components. **Parameters** - `image` (`IN PDEImage`): The image whose decode array is set. - `decode` (`IN ASFixed *`): A pointer to the decode array. - `decodeSize` (`IN ASUns32`): The number of elements in the decode array. **Returns:** `void` **See also:** [`PDEImageGetDecodeArray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetDecodeArray), [`PDEImageGetFilterArray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetFilterArray) #### PDEImageSetMatteArray ```cpp void PDEImageSetMatteArray(IN PDEImage image, IN ASFixed *matte, IN ASUns32 numComp) ``` Header: `PEWProcs.h:1978` Sets the matte array for the image XObject. **Parameters** - `image` (`IN PDEImage`): IN/OUT The image XObject. - `matte` (`IN ASFixed *`): IN/OUT An array of values. - `numComp` (`IN ASUns32`): IN/OUT The number of values in mArray. **Returns:** `void` #### PDEImageSetSMask ```cpp void PDEImageSetSMask(IN PDEImage image, IN PDEImage sMask) ``` Header: `PEWProcs.h:1968` Sets the soft mask. **Parameters** - `image` (`IN PDEImage`): IN/OUT The image XObject. - `sMask` (`IN PDEImage`): IN/OUT The soft mask. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` ### Structures (2) #### PDEImage ```cpp typedef struct _t_PDEImage* PDEImage ``` Header: `PEExpT.h:183` A PDEElement that contains an Image XObject or an inline image. You can associate data or a stream with an image. **See also:** `PDEElement (superclass)`, [`PDEImageCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreate), [`PDEImageCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreateFromCosObj), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease) #### PDEImageAttrsP ```cpp typedef struct PDEImageAttrs * PDEImageAttrsP ``` Header: `PEExpT.h:930` ### Enums (3) #### PDEImageAttrFlags Header: `PEExpT.h:1872` Flags for PDEImageAttrs. See the description of image attributes in "Image Dictionaries" in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 8.9.5, page 206. You can find this document on the web store of the International Standards Organization (ISO). **Values** - `kPDEImageExternal = 0x0001`: The image is an XObject. - `kPDEImageIsMask = 0x0002`: The image is an imagemask. - `kPDEImageInterpolate = 0x0004`: `interpolate` is `true`. - `kPDEImageHaveDecode = 0x0008`: The image has a decode array. - `kPDEImageIsIndexed = 0x0010`: The image uses an indexed color space. - `kPDEImageMaskedByPosition = 0x0020`: The image has a Mask key containing an ImageMask stream. - `kPDEImageMaskedByColor = 0x0040`: The image has a Mask key containing an array of color values. **See also:** [`PDEImageCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreate), [`PDEImageGetAttrs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetAttrs), [`PDEImageGetData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetData) #### PDEImageColorSpaceFlags Header: `PEExpT.h:1921` Flags to enable `PDEImageGetColorSpaceEx()` to return a color space with a particular bpc, depending on the image's bpc. **Values** - `kPDEImageConvert16bpcColorSpace = 0x0001`: Indicates conversion of the color space of 16 bpc image to 8 bpc. **See also:** [`PDEImageGetColorSpaceEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetColorSpaceEx), [`PDEImageGetColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetColorSpace) #### PDEImageDataFlags Header: `PEExpT.h:1904` Flags for `PDEImageGetData()`, `PDEImageGetDataStm()`, `PDEImageSetData()`, and `PDEImageSetDataStm()`. **Values** - `kPDEImageEncodedData = 0x0001`: Indicates that the filter is active; data is encoded. - `kPDEImageAllowDelayedRead = 0x0002` - `kPDEImage16bpcData = 0x0004`: Indicates if the accompanying image data is 16-bit. Should be passed in for 16-bit images to PDEImageGetData/PDEImageGetDataStm to prevent the return of 8-bit converted data. **See also:** [`PDEImageGetData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetData), [`PDEImageGetDataStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetDataStm), [`PDEImageSetData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageSetData), [`PDEImageSetDataStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageSetDataStm), [`PDEImageCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageCreate) ## PDEImageFlate ### Functions (4) #### PDEImageFlateAcquireColorSpace ```cpp PDEColorSpace PDEImageFlateAcquireColorSpace(IN PDEImageFlate imgFlate) ``` Header: `PERProcs.h:2725` Acquires the color space of the flate image. PDERelease should be used to release the color space when it is no longer referenced by the caller. **Parameters** - `imgFlate` (`IN PDEImageFlate`): IN/OUT An object of type PDEImageFlate. **Returns:** [`PDEColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpace) The color space of the flate image; otherwise it returns `NULL`. **See also:** [`PDEImageGetType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetType), [`PDEImageAcquireImageFlate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageAcquireImageFlate) #### PDEImageFlateGetAttrs ```cpp void PDEImageFlateGetAttrs(IN PDEImageFlate imgFlate, OUT PDEImageFlateAttrsP attrsP, IN ASUns32 attrsSize) ``` Header: `PERProcs.h:2713` Gets the attributes of a flate image. **Parameters** - `imgFlate` (`IN PDEImageFlate`): IN/OUT A flate image resource object. - `attrsP` (`OUT PDEImageFlateAttrsP`): IN/OUT (Filled by the method) A pointer to a `PDEImageFlateAttrs` structure containing the attributes of the flate image. - `attrsSize` (`IN ASUns32`): IN/OUT The size of the `attrsP` buffer in bytes. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` #### PDEImageFlateGetCosObj ```cpp void PDEImageFlateGetCosObj(IN PDEImageFlate pdeImageFlate, OUT CosObj *cosObjP) ``` Header: `PERProcs.h:2701` Gets a Cos object for an image. **Parameters** - `pdeImageFlate` (`IN PDEImageFlate`): IN/OUT The flate image whose Cos object is obtained. - `cosObjP` (`OUT CosObj *`): IN/OUT (Filled by the method) The Cos object for the image. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEImageGetType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetType), [`PDEImageAcquireImageFlate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageAcquireImageFlate) #### PDEImageFlateGetDataStm ```cpp ASStm PDEImageFlateGetDataStm(IN PDEImageFlate imgFlate, IN ASUns32 flags) ``` Header: `PERProcs.h:2744` Gets a data stream for a flate compressed image, PDEImageFlate object. The caller must dispose of the returned ASStm by calling ASStmClose(). **Parameters** - `imgFlate` (`IN PDEImageFlate`): IN/OUT The flate image whose data stream is obtained. - `flags` (`IN ASUns32`): IN/OUT PDEImageDataFlags flags. If the kPDEImageEncodedData flag is set, data is returned in encoded form. Otherwise, data is decoded. **Returns:** [`ASStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStm) The stream for the image. **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDEImageGetType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetType), [`PDEImageAcquireImageFlate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageAcquireImageFlate) ### Structures (1) #### PDEImageFlate ```cpp typedef struct _t_PDEImageFlate* PDEImageFlate ``` Header: `PEExpT.h:415` A reference to a PDEImageFlate. ## PDEImageJPX ### Functions (8) #### PDEImageJPXAcquireColorSpace ```cpp PDEColorSpace PDEImageJPXAcquireColorSpace(IN PDEImageJPX pdeImageJPX) ``` Header: `PERProcs.h:2774` Acquires the PDEColorSpace associated with the JPX encoded image, if one exists. If a PDF color space has not been associated with the JPX encoded image, `0` will be returned. This object is acquired and must be released using PDERelease() when it is no longer in use. @since **Parameters** - `pdeImageJPX` (`IN PDEImageJPX`): IN/OUT A JPX encoded image object. **Returns:** [`PDEColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpace) **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEImageGetType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetType), `PDEImageAcquireJPX` #### PDEImageJPXAcquireJPXColorSpace ```cpp JPXColorSpace PDEImageJPXAcquireJPXColorSpace(IN PDEImageJPX pdeImageJPX) ``` Header: `PERProcs.h:2817` Acquires a link list of JPXColorSpace objects defined with the JPX encoded image. if one exists. This object is acquired and must be released using PDERelease() when it is no longer in use. @since **Parameters** - `pdeImageJPX` (`IN PDEImageJPX`): IN/OUT A JPX encoded image object. **Returns:** [`JPXColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#JPXColorSpace) **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`JPXColorSpaceAcquireNext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#JPXColorSpaceAcquireNext), [`JPXColorSpaceGetType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#JPXColorSpaceGetType), [`JPXColorSpaceGetEnumAttrs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#JPXColorSpaceGetEnumAttrs), [`JPXColorSpaceGetProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#JPXColorSpaceGetProfile) #### PDEImageJPXAcquirePalette ```cpp JPXPalette PDEImageJPXAcquirePalette(IN PDEImageJPX pdeImageJPX) ``` Header: `PERProcs.h:2846` Acquires the JPXPalette from the JPX image object This object is acquired and must be released using PDERelease() when it is no longer in use. @since **Parameters** - `pdeImageJPX` (`IN PDEImageJPX`): IN/OUT A JPX encoded image object. **Returns:** [`JPXPalette`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#JPXPalette) **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`JPXPaletteGetNumEntries`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#JPXPaletteGetNumEntries), [`JPXPaletteGetBitDepths`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#JPXPaletteGetBitDepths), [`JPXPaletteGetNumComponents`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#JPXPaletteGetNumComponents), [`JPXPaletteGetTable`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#JPXPaletteGetTable) #### PDEImageJPXGetAttrs ```cpp void PDEImageJPXGetAttrs(IN PDEImageJPX pdeImageJPX, OUT PDEImageJPXAttrsP attrsP, IN ASUns32 attrsSize) ``` Header: `PERProcs.h:2758` Gets the attributes of a JPX encoded PDEImage. @since **Parameters** - `pdeImageJPX` (`IN PDEImageJPX`): IN/OUT A JPX encoded image object. - `attrsP` (`OUT PDEImageJPXAttrsP`): IN/OUT (Filled by the method) A pointer to a PDEImageJPXAttrs structure containing the attributes of the JPX encoded image. - `attrsSize` (`IN ASUns32`): IN/OUT The size of the `attrsP` buffer in bytes. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEImageGetAttrs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetAttrs) #### PDEImageJPXGetCosObj ```cpp void PDEImageJPXGetCosObj(IN PDEImageJPX pdeImageJPX, OUT CosObj *cosObjP) ``` Header: `PERProcs.h:2688` Gets a Cos object for an image. **Parameters** - `pdeImageJPX` (`IN PDEImageJPX`): IN/OUT The JPX image whose Cos object is obtained. - `cosObjP` (`OUT CosObj *`): IN/OUT (Filled by the method) The Cos object for the image. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEImageGetType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageGetType), [`PDEImageAcquireImageJPX`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageAcquireImageJPX) #### PDEImageJPXGetDataStm ```cpp ASStm PDEImageJPXGetDataStm(IN PDEImageJPX pdeImageJPX, IN ASUns32 flags) ``` Header: `PERProcs.h:2789` Returns a stream containing the image data. Color component values are interlaced. For images with greater then 8 bits per component, the component values occupy the least significant bits of a two byte value. Valid values of flags are `0`. @since **Parameters** - `pdeImageJPX` (`IN PDEImageJPX`): IN/OUT A JPX encoded image object. - `flags` (`IN ASUns32`): Unused. **Returns:** [`ASStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStm) **Exceptions** - `peErrWrongPDEObjectType` #### PDEImageJPXGetNumColorSpaces ```cpp ASInt32 PDEImageJPXGetNumColorSpaces(IN PDEImageJPX pdeImageJPX) ``` Header: `PERProcs.h:2800` Returns the number of JPX color spaces reference by the JPX encoded image. @since **Parameters** - `pdeImageJPX` (`IN PDEImageJPX`): IN/OUT A JPX encoded image object. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) **Exceptions** - `peErrWrongPDEObjectType` #### PDEImageJPXHasPalette ```cpp ASBool PDEImageJPXHasPalette(IN PDEImageJPX pdeImageJPX) ``` Header: `PERProcs.h:2829` Returns `true` if the JPX encoded image has a JPX palette @since **Parameters** - `pdeImageJPX` (`IN PDEImageJPX`): IN/OUT A JPX encoded image object. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEImageJPXAcquirePalette`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageJPXAcquirePalette) ### Structures (1) #### PDEImageJPX ```cpp typedef struct _t_PDEImageJPX* PDEImageJPX ``` Header: `PEExpT.h:419` A reference to a PDEImageJPX. ## PDEObject ### Functions (6) #### PDEAcquire ```cpp void PDEAcquire(IN PDEObject obj) ``` Header: `PERProcs.h:1225` Increments the reference count for an object. **Parameters** - `obj` (`IN PDEObject`): IN/OUT The element whose count is incremented. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease) #### PDEAddTag ```cpp void PDEAddTag(IN PDEObject object, IN ExtensionID clientID, IN ASUns32 tag, IN void *value) ``` Header: `PEWProcs.h:996` Adds an identifier-value pair to an object. The clientID-tag combination is a unique identifier for the value. Each client has its own identifier space. It is often convenient to use ASAtoms as tags. **Parameters** - `object` (`IN PDEObject`): The element to tag. The object may be a PDEElement, PDEContent, PDEFont, PDEColorSpace, and so on. - `clientID` (`IN ExtensionID`): Identifies the caller/client. For clients, this should be the gExtensionID extension. For the Adobe PDF Library, if there is only one client of the PDFEdit subsystem, `clientID` should be zero. If there are multiple clients, each should specify a nonzero, non-negative `clientID`. (A negative `clientID` is reserved for the implementation.)`object`. If `tag` is `0`, this is the same as calling PDERemoveTag(). In other words, you cannot tell the difference between a tag whose value is zero and a tag that is nonexistent. **Note:** Tags are a purely memory-resident feature. In addition, management of tags is the responsibility of the client. A client must manage any memory pointed to by a tag. This method only contains a pointer to the data passed in by the client. The data and the pointer will not be saved to a file. The generic pointer type is not in the PDF specification. - `tag` (`IN ASUns32`) - `value` (`IN void *`): A pointer to a value to associate with `object`. Only the pointer is stored. If the pointer points to data, it is the responsibility of the client to manage the data and its memory. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEGetTag`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEGetTag), [`PDERemoveTag`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERemoveTag) #### PDEGetTag ```cpp void * PDEGetTag(IN PDEObject object, IN ExtensionID clientID, IN ASUns32 tag) ``` Header: `PEWProcs.h:1017` Gets an object's value for a given clientID-tag identifier that was added by PDEAddTag. **Parameters** - `object` (`IN PDEObject`): The element whose value is obtained. - `clientID` (`IN ExtensionID`): Identifies the caller/client. For clients, this should be the gExtensionID extension. For the Adobe PDF Library, if there is only one client of the PDFEdit subsystem, `clientID` should be zero. If there are multiple clients, each should specify a nonzero, non-negative `clientID`. (A negative `clientID` is reserved for the implementation.) - `tag` (`IN ASUns32`): The object's tag. If object has no tag, this is `0`. **Returns:** `void *` The value associated with the clientID-tag identifier. **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEAddTag`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEAddTag), [`PDERemoveTag`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERemoveTag) #### PDEObjectGetType ```cpp ASInt32 PDEObjectGetType(IN PDEObject obj) ``` Header: `PERProcs.h:1211` Gets the type of an element. **Parameters** - `obj` (`IN PDEObject`): IN/OUT The element whose type is obtained. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The object type, which is one of PDEType. **Exceptions** - `peErrWrongPDEObjectType` #### PDERelease ```cpp void PDERelease(IN PDEObject obj) ``` Header: `PERProcs.h:1246` Decrements the reference count for the object. If the count becomes zero, the object is destroyed. Do not call PDERelease() on PDEContent that you acquired with PDPageAcquirePDEContent(); call PDPageReleasePDEContent() instead. **Note:** Objects should only be disposed of with PDERelease() if the method by which they were obtained incremented the reference count for the object. In general, methods that *get* an object do not increment the reference count. Methods that increment the reference count typically contain the word `acquire` or `create` in the method name and specifically state that you must release the object. **Parameters** - `obj` (`IN PDEObject`): IN/OUT The element released. **Returns:** `void` **See also:** [`PDEAcquire`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEAcquire) #### PDERemoveTag ```cpp void PDERemoveTag(IN PDEObject object, IN ExtensionID clientID, IN ASUns32 tag) ``` Header: `PEWProcs.h:1039` Removes an object's value for a given clientID-tag identifier that was added by PDEAddTag. If PDEAddTag is called with a `0` tag, this is the same as calling PDERemoveTag(). **Parameters** - `object` (`IN PDEObject`): The element whose tag is removed. - `clientID` (`IN ExtensionID`): Identifies the caller/client. For clients, this should be the gExtensionID extension. For the Adobe PDF Library, if there is only one client of the PDFEdit subsystem, `clientID` should be zero. If there are multiple clients, each should specify a nonzero, non-negative `clientID`. (A negative `clientID` is reserved for the implementation.) - `tag` (`IN ASUns32`): The tag value. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEAddTag`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEAddTag), [`PDEGetTag`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEGetTag) ### Structures (1) #### PDEObject ```cpp typedef struct _t_PDEObject* PDEObject ``` Header: `PEExpT.h:108` The abstract super class of the PDFEdit classes. You can find the type of any object with the PDEObjectGetType() method. You can then cast and apply that class' methods to the object. In addition, you can cast any of the PDFEdit objects to a PDEObject and use it anywhere a PDEObject is called for, such as in the PDEObject methods. **See also:** [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease), [`PDEObjectDump`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEObjectDump) ## PDEPS ### Functions (7) #### PDEPSCreate ```cpp PDEPS PDEPSCreate(IN PDEPSAttrsP attrsP, IN ASUns32 attrsSize, IN ASStm dataStm, IN ASUns8 *data, IN ASUns32 dataSize) ``` Header: `PEWProcs.h:762` **Parameters** - `attrsP` (`IN PDEPSAttrsP`) - `attrsSize` (`IN ASUns32`) - `dataStm` (`IN ASStm`) - `data` (`IN ASUns8 *`) - `dataSize` (`IN ASUns32`) **Returns:** [`PDEPS`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPS) #### PDEPSCreateFromCosObj ```cpp PDEPS PDEPSCreateFromCosObj(const CosObj *cosObjP) ``` Header: `PEWProcs.h:775` Creates a PDEPS object from a CosObj object. Call PDERelease() to dispose of the returned PDEPS object when finished with it. **Parameters** - `cosObjP` ([`const CosObj *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): IN/OUT An object of type CosObj. **Returns:** [`PDEPS`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPS) An object of type PDEPS. **Exceptions** - `genErrBadParm` **See also:** [`PDEPSCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPSCreate) #### PDEPSGetAttrs ```cpp void PDEPSGetAttrs(IN PDEPS ps, OUT PDEPSAttrsP attrsP, IN ASUns32 attrsSize) ``` Header: `PERProcs.h:1008` The following PDEPS methods have been deprecated and do nothing. **Parameters** - `ps` (`IN PDEPS`) - `attrsP` (`OUT PDEPSAttrsP`) - `attrsSize` (`IN ASUns32`) **Returns:** `void` #### PDEPSGetData ```cpp ASUns32 PDEPSGetData(IN PDEPS ps, OUT ASUns8 *buffer, IN ASUns32 bufferSize, IN ASInt32 offset) ``` Header: `PERProcs.h:1010` **Parameters** - `ps` (`IN PDEPS`) - `buffer` (`OUT ASUns8 *`) - `bufferSize` (`IN ASUns32`) - `offset` (`IN ASInt32`) **Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32) #### PDEPSGetDataStm ```cpp ASStm PDEPSGetDataStm(IN PDEPS ps) ``` Header: `PERProcs.h:1012` **Parameters** - `ps` (`IN PDEPS`) **Returns:** [`ASStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStm) #### PDEPSSetData ```cpp void PDEPSSetData(IN PDEPS ps, IN ASUns8 *buffer, IN ASUns32 bufferSize) ``` Header: `PEWProcs.h:758` The following PDEPS methods have been deprecated and do nothing. **Parameters** - `ps` (`IN PDEPS`) - `buffer` (`IN ASUns8 *`) - `bufferSize` (`IN ASUns32`) **Returns:** `void` #### PDEPSSetDataStm ```cpp void PDEPSSetDataStm(IN PDEPS ps, IN ASStm stm) ``` Header: `PEWProcs.h:760` **Parameters** - `ps` (`IN PDEPS`) - `stm` (`IN ASStm`) **Returns:** `void` ### Structures (1) #### PDEPS ```cpp typedef struct _t_PDEPS* PDEPS ``` Header: `PEExpT.h:210` An element representing inline or XObject pass-through PostScript object. XObject PostScripts are listed in page XObject resources. **See also:** `PDEElement (superclass)`, [`PDEPSCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPSCreate), [`PDEPSCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPSCreateFromCosObj) ### Enums (1) #### PDEPSFlags Header: `PEExpT.h:1928` Flags for `PDEPSAttrs`. **Values** - `kPDEPSExternal = 0x0001`: PS is an XObject. ## PDEPath ### Functions (8) #### PDEPathAddSegment ```cpp void PDEPathAddSegment(IN PDEPath path, IN ASUns32 segType, IN ASFixed x1, IN ASFixed y1, IN ASFixed x2, IN ASFixed y2, IN ASFixed x3, IN ASFixed y3) ``` Header: `PEWProcs.h:1367` Adds a segment to a path. The number of ASFixed values used depends upon `segType`: `segType` ASFixed values kPDEMoveTo `x1` `y1` kPDELineTo `x1` `y1` kPDECurveTo `x1` `y1` `x2` `y2` `y3` kPDECurveToV `x1` `y1` `x2` `y2` kPDECurveToY `x1` `y1` `x2` `y2` kPDERect `x1` `y1` `x2` (width) `y2` (height) kPDEClosePath None **Parameters** - `path` (`IN PDEPath`): IN/OUT The path to which a segment is added. - `segType` (`IN ASUns32`): IN/OUT A PDEPathElementType value indicating the type of path to add. - `x1` (`IN ASFixed`): IN/OUT The x-coordinate of the first point. - `y1` (`IN ASFixed`): IN/OUT The y-coordinate of the first point. - `x2` (`IN ASFixed`): IN/OUT The x-coordinate of the second point. - `y2` (`IN ASFixed`): IN/OUT The y-coordinate of the second point. - `x3` (`IN ASFixed`): IN/OUT The x-coordinate of the third point. - `y3` (`IN ASFixed`): IN/OUT The y-coordinate of the third point. **Returns:** `void` **Exceptions** - `genErrBadParm` **See also:** [`PDEPathSetData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathSetData) #### PDEPathCreate ```cpp PDEPath PDEPathCreate(void) ``` Header: `PEWProcs.h:479` Creates an empty path element. Call PDERelease() to dispose of the returned path object when finished with it. **Parameters** - (unnamed) (`void`) **Returns:** [`PDEPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPath) An empty path element. #### PDEPathGetData ```cpp ASUns32 PDEPathGetData(IN PDEPath path, OUT ASInt32 *data, IN ASUns32 dataSize) ``` Header: `PERProcs.h:715` Gets the size of the path data and, optionally, the path data. **Parameters** - `path` (`IN PDEPath`): IN/OUT The path whose data is obtained. - `data` (`OUT ASInt32 *`): IN/OUT (Filled by the method) A pointer to the path data. If `data` is non-`NULL`, it contains a variable-sized array of path operators and operands. The format is a 32-bit operator followed by 0 to 3 ASFixedPoint values, depending on the operator. Opcodes are codes for `moveto`, `lineto`, `curveto`, `rect`, or `closepath` operators; operands are `ASFixedPoint` values. If `data` is `NULL`, the number of bytes required for `data` is returned by the method. Note that it returns *raw* path data. If you want the points in page coordinates, concatenate the path data points with the PDEElement matrix obtained from PDEElementGetMatrix(). - `dataSize` (`IN ASUns32`): IN/OUT Specifies the size of the buffer provided in data. If it is less than the length of the path data, the method copies `dataSize` bytes. If it is zero, the ASFixed value of path->size is returned. **Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32) The length of the data of `path`. **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEPathSetData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathSetData), [`PDEPathSetDataEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathSetDataEx), [`PDEPathGetDataEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathGetDataEx) #### PDEPathGetDataEx ```cpp ASUns32 PDEPathGetDataEx(IN PDEPath path, OUT ASReal *data, IN ASUns32 dataSize) ``` Header: `PERProcs.h:3188` Gets the size of the path data and, optionally, the path data. This API is an extension to the `PDEPathGetData` API. **Parameters** - `path` (`IN PDEPath`): IN/OUT The path whose data is obtained. - `data` (`OUT ASReal *`): IN/OUT (Filled by the method) A pointer to the path data. If `data` is non-`NULL`, it contains a variable-sized array of path operators and operands. The format is a 32-bit operator followed by 0 to 3 ASReal values, depending on the operator. Opcodes are codes for `moveto`, `lineto`, `curveto`, `rect`, or `closepath` operators; operands are ASReal values. If `data` is `NULL`, the number of bytes required for `data` is returned by the method. Note that it returns *raw* path data. If you want the points in page coordinates, concatenate the path data points with the PDEElement matrix obtained from PDEElementGetMatrix(). - `dataSize` (`IN ASUns32`): IN/OUT Specifies the size of the buffer provided in data. If it is less than the length of the path data, the method copies `dataSize` bytes. **Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32) The length of the data of `path`. **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEPathGetData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathGetData), [`PDEPathSetData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathSetData), [`PDEPathSetDataEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathSetDataEx) #### PDEPathGetPaintOp ```cpp ASUns32 PDEPathGetPaintOp(IN PDEPath path) ``` Header: `PERProcs.h:727` Gets the fill and stroke attributes of a path. **Parameters** - `path` (`IN PDEPath`): The path whose fill and stroke attributes are obtained. **Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32) A set of PDEPathOpFlags flags describing fill and stroke attributes. **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEPathSetPaintOp`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathSetPaintOp) #### PDEPathSetData ```cpp void PDEPathSetData(IN PDEPath path, IN ASInt32 *data, IN ASUns32 dataSize) ``` Header: `PEWProcs.h:455` Sets new path data for a path element. **Parameters** - `path` (`IN PDEPath`): IN/OUT The path whose data is set. - `data` (`IN ASInt32 *`): IN/OUT A pointer to the path data. It is a variable-sized array of path operators and operands. The format is a 32-bit operator followed by zero to three `ASFixedPoint` values, depending on the operator. Operators are codes for `moveto`, `lineto`, `curveto`, `rect`, or `closepath` operators, and must be one of PDEPathElementType. Operands are `ASFixedPoint` values. The data is copied into the PDEPath object. - `dataSize` (`IN ASUns32`): IN/OUT The size of the new path data in bytes. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDEPathGetData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathGetData), [`PDEPathSetDataEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathSetDataEx), [`PDEPathGetDataEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathGetDataEx) #### PDEPathSetDataEx ```cpp void PDEPathSetDataEx(IN PDEPath path, IN ASReal *data, IN ASUns32 dataSize) ``` Header: `PEWProcs.h:3719` Sets new path data for a path element. This API is an extension to the `PDEPathSetData` API. **Parameters** - `path` (`IN PDEPath`): IN/OUT The path whose data is set. - `data` (`IN ASReal *`): IN/OUT A pointer to the path data. It is a variable-sized array of path operators and operands. The format is a 32-bit operator followed by zero to three ASReal values, depending on the operator. Operators are codes for `moveto`, `lineto`, `curveto`, `rect`, or `closepath` operators, and must be one of PDEPathElementType. Operands are ASReal values. The data is copied into the PDEPath object. - `dataSize` (`IN ASUns32`): IN/OUT The size of the new path data in bytes. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDEPathGetData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathGetData), [`PDEPathSetData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathSetData), [`PDEPathGetDataEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathGetDataEx) #### PDEPathSetPaintOp ```cpp void PDEPathSetPaintOp(IN PDEPath path, IN ASUns32 op) ``` Header: `PEWProcs.h:468` Sets the fill and stroke attributes of a path. **Parameters** - `path` (`IN PDEPath`): IN/OUT The path whose fill and stroke attributes are set. - `op` (`IN ASUns32`): IN/OUT The operation to set; it must be one of PDEPathOpFlags. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEPathGetPaintOp`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathGetPaintOp) ### Structures (1) #### PDEPath ```cpp typedef struct _t_PDEPath* PDEPath ``` Header: `PEExpT.h:174` A PDEElement that contains a path. Path objects can be stroked, filled, and/or serve as clipping paths. **See also:** `PDEElement (superclass)`, [`PDEPathCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathCreate), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease) ### Enums (2) #### PDEPathElementType Header: `PEExpT.h:1786` An enumerated data type for path segment operators in PDEPath elements. **Values** - `kPDEMoveTo = 0`: Designates the m (`moveto`) operator, which moves the current point. - `kPDELineTo = 1`: Designates the l (`lineto`) operator, which appends a straight line segment from the current point. - `kPDECurveTo = 2`: Designates the c (`curveto`) operator, which appends a bezier curve to the path. - `kPDECurveToV = 3`: Designates the v (`curveto`) operator, which appends a bezier curve to the current path when the first control point coincides with initial point on the curve. - `kPDECurveToY = 4`: Designates the y (`curveto`) operator, which appends a bezier curve to the current path when the second control point coincides with final point on the curve. - `kPDERect = 5`: Designates the re operator, which adds a rectangle to the current path. - `kPDEClosePath = 6`: Designates the h (`closepath`) operator, which closes the current sub-path. - `kPDEPathLastType = 7`: Designates a special path element which is used as a default. It does not represent any actual path operations like moveto, lineto, etc. **See also:** [`PDEPathAddSegment`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathAddSegment), [`PDEPathCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathCreate), [`PDEPathSetData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathSetData) #### PDEPathOpFlags Header: `PEExpT.h:1843` Flags for paint operators in a PDEPath. **Values** - `kPDEInvisible = 0x00`: The path is neither stroked nor filled, so it is invisible. - `kPDEStroke = 0x01`: Stroke the path, as with the S (`stroke`) operator. - `kPDEFill = 0x02`: Fills the path, using the nonzero winding number rule to determine the region to fill, as with the f (`fill`) operator. - `kPDEEoFill = 0x04`: Fills the path, using the even/odd rule to determine the region to fill, as with the f* (`eofill`) operator. **See also:** [`PDEPathGetPaintOp`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathGetPaintOp), [`PDEPathSetPaintOp`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPathSetPaintOp) ## PDEPattern ### Functions (2) #### PDEPatternCreate ```cpp PDEPattern PDEPatternCreate(const CosObj *cosObjP) ``` Header: `PEWProcs.h:1267` Creates a pattern object that can be used for a Pattern color space. See the description of Patterns in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 8.7, page 173. This document is provided on the web site of the International Standards Organization (ISO). Call PDERelease() to dispose of the returned pattern object when finished with it. **Parameters** - `cosObjP` ([`const CosObj *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): IN/OUT A CosObj stream for the pattern. **Returns:** [`PDEPattern`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPattern) A pattern. **See also:** [`PDEPatternGetCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPatternGetCosObj) #### PDEPatternGetCosObj ```cpp void PDEPatternGetCosObj(IN PDEPattern pattern, OUT CosObj *cosObjP) ``` Header: `PERProcs.h:1482` Gets a Cos object corresponding to a pattern object. **Parameters** - `pattern` (`IN PDEPattern`): IN/OUT The pattern whose Cos object is obtained. - `cosObjP` (`OUT CosObj *`): IN/OUT (Filled by the method) The Cos object for the pattern. **Returns:** `void` **See also:** [`PDEPatternCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPatternCreate) ### Structures (1) #### PDEPattern ```cpp typedef struct _t_PDEPattern* PDEPattern ``` Header: `PEExpT.h:352` A reference to a Pattern resource used on a page in a PDF file. **See also:** [`PDEPatternCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPatternCreate), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease), [`PDEPatternGetCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPatternGetCosObj) ## PDEPlace ### Functions (5) #### PDEPlaceCreate ```cpp PDEPlace PDEPlaceCreate(IN ASAtom mcTag, IN CosObj *cosObjP, IN ASBool isInline) ``` Header: `PEWProcs.h:1121` Creates a place object. Call PDERelease() to dispose of the returned place object when finished with it. **Parameters** - `mcTag` (`IN ASAtom`): IN/OUT The tag name for the place. It must not contain any white space characters (for example, spaces or tabs). - `cosObjP` (`IN CosObj *`): IN/OUT An optional Marked Content dictionary associated with the place. - `isInline` (`IN ASBool`): If `true`, it emits the place's dictionary into the content stream inline. If `false`, then the dictionary is emitted outside of the content stream and referenced by name. See the Property Lists section of the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 14.6.2, page 554. You can find this document on the web store of the International Standards Organization (ISO). **Returns:** [`PDEPlace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPlace) The place object. #### PDEPlaceGetDict ```cpp ASBool PDEPlaceGetDict(IN PDEPlace pdePlace, OUT CosObj *placeDictP, OUT ASBool *isInline) ``` Header: `PERProcs.h:1389` Gets the Marked Content dictionary for a PDEPlace. **Parameters** - `pdePlace` (`IN PDEPlace`): IN/OUT The place whose Marked Content dictionary is obtained. - `placeDictP` (`OUT CosObj *`): IN/OUT (Filled by the method) A pointer to the Marked Content dictionary; may be `NULL`. - `isInline` (`OUT ASBool *`): IN/OUT (Filled by the method) If `true`, the Marked Content dictionary is inline; may be `NULL`. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if dictionary is obtained, `false` if no dictionary is present. **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEPlaceSetDict`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPlaceSetDict) #### PDEPlaceGetMCTag ```cpp ASAtom PDEPlaceGetMCTag(IN PDEPlace pdePlace) ``` Header: `PERProcs.h:1372` Gets the Marked Content tag for a PDEPlace. **Parameters** - `pdePlace` (`IN PDEPlace`): IN/OUT The place whose Marked Content tag is obtained. **Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom) A tag for `pdePlace`. **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEPlaceSetMCTag`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPlaceSetMCTag) #### PDEPlaceSetDict ```cpp void PDEPlaceSetDict(IN PDEPlace pdePlace, IN CosObj *placeDictP, IN ASBool isInline) ``` Header: `PEWProcs.h:1156` Sets the Marked Content dictionary for a PDEPlace. The dictionary can be emitted inline or referenced from the `\\Properties` key in the `\Resources` dictionary of the containing stream. @since **Parameters** - `pdePlace` (`IN PDEPlace`): IN/OUT The place whose Marked Content dictionary is set. - `placeDictP` (`IN CosObj *`): IN/OUT The Marked Content dictionary for `pdePlace`. - `isInline` (`IN ASBool`): If `true`, it emits the place's dictionary into the content stream inline. If `false`, then the dictionary is emitted outside of the content stream and referenced by name. See the Property Lists section of the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 14.6.2, page 554. You can find this document on the web store of the International Standards Organization (ISO). **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEPlaceGetDict`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPlaceGetDict) #### PDEPlaceSetMCTag ```cpp void PDEPlaceSetMCTag(IN PDEPlace pdePlace, IN ASAtom mcTag) ``` Header: `PEWProcs.h:1133` Sets the Marked Content tag for a PDEPlace. **Parameters** - `pdePlace` (`IN PDEPlace`): IN/OUT The place whose Marked Content tag is set. - `mcTag` (`IN ASAtom`): IN/OUT The tag for `pdePlace`. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEPlaceGetMCTag`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPlaceGetMCTag) ### Structures (1) #### PDEPlace ```cpp typedef struct _t_PDEPlace* PDEPlace ``` Header: `PEExpT.h:232` A PDEElement that marks a place on a page in a PDF file. In a PDF file, a place is represented by the MP or DP Marked Content operators. Marked content is useful for adding structure information to a PDF file. For instance, a drawing program may want to mark a point with information, such as the start of a path of a certain type. Marked content provides a way to retain this information in the PDF file. A DP operator functions the same as the MP operator and, in addition, allows a property list dictionary to be associated with a place. **See also:** `PDEElement (superclass)`, [`PDEPlaceCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEPlaceCreate), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease) ## PDEShading ### Functions (3) #### PDEShadingCreateFromCosObj ```cpp PDEShading PDEShadingCreateFromCosObj(IN const CosObj *shadingP, IN ASFixedMatrixP matrixP) ``` Header: `PEWProcs.h:1471` Superseded by PDEShadingCreateFromCosObjEx() in Acrobat 10.0. Creates a smooth shading object. Call PDERelease() to dispose of the returned PDEShading object when finished with it. **Parameters** - `shadingP` (`IN const CosObj *`): IN/OUT The shading dictionary. - `matrixP` (`IN ASFixedMatrixP`): IN/OUT The location and transformation matrix of the shading object. **Returns:** [`PDEShading`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEShading) A smooth shading object. **Exceptions** - `peErrUnknownPDEColorSpace` - `cosErrInvalidObj` - `cosErrExpectedName` - `genErrBadParm` **See also:** [`PDEShadingCreateFromCosObjEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEShadingCreateFromCosObjEx) #### PDEShadingCreateFromCosObjEx ```cpp PDEShading PDEShadingCreateFromCosObjEx(IN const CosObj *shadingP, IN ASDoubleMatrixP matrixP) ``` Header: `PEWProcs.h:3296` Creates a smooth shading object. Supersedes PDEShadingCreateFromCosObj() in Acrobat 10.0. Call PDERelease() to dispose of the returned PDEShading object when finished with it. **Parameters** - `shadingP` (`IN const CosObj *`): IN/OUT The shading dictionary. - `matrixP` (`IN ASDoubleMatrixP`): IN/OUT The location and transformation matrix of the shading object. **Returns:** [`PDEShading`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEShading) A smooth shading object. **Exceptions** - `peErrUnknownPDEColorSpace` - `cosErrInvalidObj` - `cosErrExpectedName` - `genErrBadParm` **See also:** [`PDEShadingCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEShadingCreateFromCosObj) #### PDEShadingGetCosObj ```cpp void PDEShadingGetCosObj(IN PDEShading shading, OUT CosObj *cosObjP) ``` Header: `PERProcs.h:1798` Gets the CosObj for a PDEShading. **Parameters** - `shading` (`IN PDEShading`): IN/OUT A smooth shading object. - `cosObjP` (`OUT CosObj *`): IN/OUT The Cos dictionary corresponding to shading. **Returns:** `void` ### Structures (1) #### PDEShading ```cpp typedef struct _t_PDEShading* PDEShading ``` Header: `PEExpT.h:265` A PDEElement that represents smooth shading. **See also:** `PDEElement (superclass)`, [`PDEShadingCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEShadingCreateFromCosObj), [`PDEShadingGetCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEShadingGetCosObj) ## PDESoftMask ### Functions (12) #### PDESoftMaskAcquireForm ```cpp PDEForm PDESoftMaskAcquireForm(IN PDESoftMask pdeSoftMask, IN ASFixedMatrixP matrixP) ``` Header: `PERProcs.h:1916` Superseded by PDESoftMaskAcquireFormEx() in Acrobat 10.0. Acquires the PDEForm that defines the soft mask. Call PDERelease() to dispose of the PDEForm when finished with it. **Parameters** - `pdeSoftMask` (`IN PDESoftMask`): IN/OUT An object of type PDESoftMask. - `matrixP` (`IN ASFixedMatrixP`): IN/OUT A matrix defining the transformation from coordinate space to user space. **Returns:** [`PDEForm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEForm) The XObject form of the soft mask. **Exceptions** - `genErrBadParm` - `peErrWrongPDEObjectType` **See also:** [`PDESoftMaskAcquireFormEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDESoftMaskAcquireFormEx) #### PDESoftMaskAcquireFormEx ```cpp PDEForm PDESoftMaskAcquireFormEx(IN PDESoftMask pdeSoftMask, IN ASDoubleMatrixP matrixP) ``` Header: `PERProcs.h:3109` Supersedes PDESoftMaskAcquireForm() in Acrobat 10.0. Acquires the PDEForm that defines the soft mask. Call PDERelease() to dispose of the PDEForm when finished with it. **Parameters** - `pdeSoftMask` (`IN PDESoftMask`): IN/OUT An object of type PDESoftMask. - `matrixP` (`IN ASDoubleMatrixP`): IN/OUT A matrix defining the transformation from coordinate space to user space. **Returns:** [`PDEForm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEForm) The XObject form of the soft mask. **Exceptions** - `genErrBadParm` - `peErrWrongPDEObjectType` **See also:** [`PDESoftMaskAcquireForm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDESoftMaskAcquireForm) #### PDESoftMaskCreate ```cpp PDESoftMask PDESoftMaskCreate(IN CosDoc cosDoc, IN PDESoftMaskCreateFlags type, IN PDEForm pdeForm) ``` Header: `PEWProcs.h:1717` Creates a new soft mask object. Call PDERelease() to dispose of the returned PDESoftMask object when finished with it. **Parameters** - `cosDoc` (`IN CosDoc`): IN/OUT The container document. - `type` (`IN PDESoftMaskCreateFlags`): IN/OUT Specifies how the mask is to be computed. It is one of the PDESoftMaskCreateFlags. - `pdeForm` (`IN PDEForm`): IN/OUT The form XObject that defines the soft mask. It is the source of the mask values and the PDColorSpace in which the composite computation is to be done. **Returns:** [`PDESoftMask`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDESoftMask) The newly created object. #### PDESoftMaskCreateFromCosObj ```cpp PDESoftMask PDESoftMaskCreateFromCosObj(IN const CosObj *cosObjP) ``` Header: `PEWProcs.h:1702` Creates a new soft mask object from its Cos representation. Call PDERelease() to dispose of the returned PDESoftMask object when finished with it. **Parameters** - `cosObjP` (`IN const CosObj *`): IN/OUT The soft mask dictionary. **Returns:** [`PDESoftMask`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDESoftMask) The newly created object. #### PDESoftMaskCreateFromName ```cpp PDESoftMask PDESoftMaskCreateFromName(IN ASAtom name) ``` Header: `PEWProcs.h:2251` Create a new soft mask from a name. Call PDERelease() to dispose of the returned PDESoftMask object when finished with it. **Parameters** - `name` (`IN ASAtom`): IN/OUT The new name for the soft mask. Note that, currently, the only valid name is `None`. **Returns:** [`PDESoftMask`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDESoftMask) The newly created object. #### PDESoftMaskGetBackdropColor ```cpp ASInt32 PDESoftMaskGetBackdropColor(IN PDESoftMask pdeSoftMask, IN ASFixed *pColorValues, IN ASInt32 numValues) ``` Header: `PERProcs.h:1933` Gets the array of color values of the backdrop color. Given a pointer to an array and the length of the array, it copies the color values to that array and returns the number of values copied. If the pointer to the array is `NULL`, the number of color values is returned. **Parameters** - `pdeSoftMask` (`IN PDESoftMask`): IN/OUT An object of type PDESoftMask. - `pColorValues` (`IN ASFixed *`): IN/OUT (Filled by the method) A pointer to an array of color values. If it is `NULL`, the number of color values is returned. - `numValues` (`IN ASInt32`): IN/OUT The length of the array `pColorValues`. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The number of values copied. #### PDESoftMaskGetCosObj ```cpp void PDESoftMaskGetCosObj(IN PDESoftMask pdeSoftMask, OUT CosObj *cosObjP) ``` Header: `PERProcs.h:1899` Gets the associated CosObj of the soft mask. **Parameters** - `pdeSoftMask` (`IN PDESoftMask`): IN/OUT The soft mask. - `cosObjP` (`OUT CosObj *`): IN/OUT (Filled by the method) A pointer to the Cos object. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` #### PDESoftMaskGetName ```cpp ASAtom PDESoftMaskGetName(IN PDESoftMask pdeSoftMask) ``` Header: `PERProcs.h:2306` Gets the soft mask name. **Parameters** - `pdeSoftMask` (`IN PDESoftMask`): IN/OUT The soft mask. **Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom) The soft mask name if it is a name; it returns ASAtomNull otherwise. #### PDESoftMaskGetTransferFunction ```cpp CosObj PDESoftMaskGetTransferFunction(IN PDESoftMask pdeSoftMask) ``` Header: `PERProcs.h:1942` Gets the transfer function as a CosObj. **Parameters** - `pdeSoftMask` (`IN PDESoftMask`): IN/OUT The soft mask. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) The transfer function as a CosObj. #### PDESoftMaskSetBackdropColor ```cpp void PDESoftMaskSetBackdropColor(IN PDESoftMask pdeSoftMask, IN ASFixed *pColorValues, IN ASInt32 numValues) ``` Header: `PEWProcs.h:1737` Sets the backdrop color values. **Parameters** - `pdeSoftMask` (`IN PDESoftMask`): IN/OUT The soft mask object. - `pColorValues` (`IN ASFixed *`): IN/OUT A series of color values. - `numValues` (`IN ASInt32`): IN/OUT The number of values pointed to by `pColorValues`. **Returns:** `void` #### PDESoftMaskSetTransferFunction ```cpp void PDESoftMaskSetTransferFunction(IN PDESoftMask pdeSoftMask, IN CosObj cosTransferFunction) ``` Header: `PEWProcs.h:1748` Sets the transfer function associated with the soft mask. **Parameters** - `pdeSoftMask` (`IN PDESoftMask`): IN/OUT The soft mask object. - `cosTransferFunction` (`IN CosObj`): IN/OUT The transfer function dictionary. **Returns:** `void` #### PDESoftMaskSetXGroup ```cpp void PDESoftMaskSetXGroup(IN PDESoftMask pdeSoftMask, IN PDEForm pdeForm) ``` Header: `PEWProcs.h:1726` Sets the PDEForm that defines the soft mask. **Parameters** - `pdeSoftMask` (`IN PDESoftMask`): IN/OUT The soft mask object. - `pdeForm` (`IN PDEForm`): IN/OUT The form XObject. **Returns:** `void` ### Structures (1) #### PDESoftMask ```cpp typedef struct _t_PDESoftMask* PDESoftMask ``` Header: `PEExpT.h:375` An object for creating and manipulating a soft mask in a PDF file. **See also:** `PDEElement (superclass)`, [`PDESoftMaskCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDESoftMaskCreate), [`PDESoftMaskCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDESoftMaskCreateFromCosObj), [`PDESoftMaskCreateFromName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDESoftMaskCreateFromName), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease) ### Enums (1) #### PDESoftMaskCreateFlags Header: `PEExpT.h:2063` Flags for use with PDESoftMaskCreate(). **Values** - `kPDESoftMaskTypeLuminosity = 0x0001`: Specifies how the mask is to be computed. - `kPDESoftMaskTypeAlpha = 0x0002`: Specifies how the mask is to be computed. **See also:** [`PDESoftMaskCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDESoftMaskCreate) ## PDEText ### Functions (46) #### PDETextAdd ```cpp void PDETextAdd(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, IN ASUns8 *text, IN ASInt32 textLen, IN PDEFont font, IN PDEGraphicStateP gstateP, IN ASUns32 gstateLen, IN PDETextStateP tstateP, IN ASUns32 tstateLen, IN ASFixedMatrixP textMatrixP, IN ASFixedMatrixP strokeMatrixP) ``` Header: `PEWProcs.h:380` Superseded by PDETextAddEx() in Acrobat 10.0. Adds a character or a text run to a PDEThe text object. **Note:** This method does not change the reference count of `pdeText`; however, the reference count of the objects in the `gstateP` parameter are incremented. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run. **Parameters** - `pdeText` (`IN PDEText`): The text object to which a character or text run is added. - `flags` (`IN ASUns32`): A PDETextFlags that specifies what kind of text to add. It must be one of the following values: - `index` (`IN ASInt32`): The index after which to add the character or text run. - `text` (`IN ASUns8 *`): A pointer to the characters to add. Note that passing `NULL` for the text can invalidate the text object, but will not raise an error. Callers must not pass `NULL` for this parameter. - `textLen` (`IN ASInt32`): The length of the text in bytes. - `font` (`IN PDEFont`): The font for the element. - `gstateP` (`IN PDEGraphicStateP`): A pointer to a PDEGraphicStateP structure with the graphics state for the element. - `gstateLen` (`IN ASUns32`): The length of the graphics state for the element. - `tstateP` (`IN PDETextStateP`): A pointer to a `PDETextState` structure with the text state for the element. Note that PDFEdit ignores the `wasSetFlags` flag of the `PDETextState` structure, so you must initialize the `PDETextState` fields. - `tstateLen` (`IN ASUns32`): The length of the text state for the element. - `textMatrixP` (`IN ASFixedMatrixP`): A pointer to an `ASFixedMatrix` that holds the matrix for the element. - `strokeMatrixP` (`IN ASFixedMatrixP`): A pointer to an `ASFixedMatrix` that holds the matrix for the line width when stroking text. It may be `NULL`. Note that this field is not currently used. **Returns:** `void` **Exceptions** - `pdErrBadResMetrics` - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDETextIsAtPoint`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextIsAtPoint), [`PDETextReplaceChars`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextReplaceChars), [`PDETextSplitRunAt`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextSplitRunAt), [`PDETextAddEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextAddEx) #### PDETextAddEx ```cpp void PDETextAddEx(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, IN ASUns8 *text, IN ASInt32 textLen, IN PDEFont font, IN PDEGraphicStateP gstateP, IN ASUns32 gstateLen, IN PDETextStateP tstateP, IN ASUns32 tstateLen, IN ASDoubleMatrixP textMatrixP, IN ASDoubleMatrixP strokeMatrixP) ``` Header: `PEWProcs.h:3636` Adds a character or a text run to a PDEThe text object. Supersedes PDETextAdd() in Acrobat 10.0. **Note:** This method does not change the reference count of `pdeText`; however, the reference count of the objects in the `gstateP` parameter are incremented. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run. **Parameters** - `pdeText` (`IN PDEText`): The text object to which a character or text run is added. - `flags` (`IN ASUns32`): A PDETextFlags that specifies what kind of text to add. It must be one of the following values: - `index` (`IN ASInt32`): The index after which to add the character or text run. - `text` (`IN ASUns8 *`): A pointer to the characters to add. Note that passing `NULL` for the text can invalidate the text object, but will not raise an error. Callers must not pass `NULL` for this parameter. - `textLen` (`IN ASInt32`): The length of the text in bytes. - `font` (`IN PDEFont`): The font for the element. - `gstateP` (`IN PDEGraphicStateP`): A pointer to a PDEGraphicStateP structure with the graphics state for the element. - `gstateLen` (`IN ASUns32`): The length of the graphics state for the element. - `tstateP` (`IN PDETextStateP`): A pointer to a `PDETextState` structure with the text state for the element. Note that PDFEdit ignores the `wasSetFlags` flag of the `PDETextState` structure, so you must initialize the `PDETextState` fields. - `tstateLen` (`IN ASUns32`): The length of the text state for the element. - `textMatrixP` (`IN ASDoubleMatrixP`): A pointer to an `ASDoubleMatrix` that holds the matrix for the element. - `strokeMatrixP` (`IN ASDoubleMatrixP`): A pointer to an `ASDoubleMatrix` that holds the matrix for the line width when stroking text. It may be `NULL`. Note that this field is currently not used. **Returns:** `void` **Exceptions** - `pdErrBadResMetrics` - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDETextIsAtPoint`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextIsAtPoint), [`PDETextReplaceChars`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextReplaceChars), [`PDETextSplitRunAt`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextSplitRunAt), [`PDETextAdd`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextAdd) #### PDETextAddGlyphs ```cpp void PDETextAddGlyphs(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, IN PDEGlyphRunP glyphRun, IN PDEFont font, IN PDEGraphicStateP gstateP, IN ASUns32 gstateLen, IN PDETextStateP tstateP, IN ASUns32 tstateLen, IN ASFixedMatrixP textMatrixP, IN ASFixedMatrixP strokeMatrixP) ``` Header: `PEWProcs.h:2634` Superseded by PDETextAddGlyphsEx() in Acrobat 10.0. Adds Unicode text to a PDEText object. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run. **Note:** This method does not change the reference count of `pdeText`; however, the reference count of the objects in the `gstateP` parameter are incremented. **Parameters** - `pdeText` (`IN PDEText`): The text object to which a character or text run is added. - `flags` (`IN ASUns32`): A PDETextFlags that specifies what kind of text to add. It must be one of the following values: - `index` (`IN ASInt32`): The index after which to add the character or text run. - `glyphRun` (`IN PDEGlyphRunP`): A pointer to a `PDEGlyphRun` structure with Unicode data, GlyphIDs and their correspondence. - `font` (`IN PDEFont`): The font for the element. - `gstateP` (`IN PDEGraphicStateP`): A pointer to a PDEGraphicStateP structure with the graphics state for the element. - `gstateLen` (`IN ASUns32`): The length of the graphics state for the element. - `tstateP` (`IN PDETextStateP`): A pointer to a `PDETextState` structure with text state for the element. Note that PDFEdit ignores the `wasSetFlags` flag of the `PDETextState` structure, so you must initialize the `PDETextState` fields. - `tstateLen` (`IN ASUns32`): The length of the text state for the element. - `textMatrixP` (`IN ASFixedMatrixP`): A pointer to an `ASFixedMatrix` that holds the matrix for the element. - `strokeMatrixP` (`IN ASFixedMatrixP`): A pointer to an `ASFixedMatrix` that holds the matrix for the line width when stroking text. It may be `NULL`. Note that, currently, this field is not used. **Returns:** `void` **Exceptions** - `pdErrBadResMetrics` - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDETextAdd`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextAdd), [`PDETextAddGlyphsEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextAddGlyphsEx) #### PDETextAddGlyphsEx ```cpp void PDETextAddGlyphsEx(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, IN PDEGlyphRunP glyphRun, IN PDEFont font, IN PDEGraphicStateP gstateP, IN ASUns32 gstateLen, IN PDETextStateP tstateP, IN ASUns32 tstateLen, IN ASDoubleMatrixP textMatrixP, IN ASDoubleMatrixP strokeMatrixP) ``` Header: `PEWProcs.h:3581` Adds Unicode text to a PDEText object. Supersedes PDETextAddGlyphs() in Acrobat 10.0. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run. **Note:** This method does not change the reference count of `pdeText`; however, the reference count of the objects in the `gstateP` parameter are incremented. **Parameters** - `pdeText` (`IN PDEText`): The text object to which a character or text run is added. - `flags` (`IN ASUns32`): A PDETextFlags that specifies what kind of text to add. It must be one of the following values: - `index` (`IN ASInt32`): The index after which to add the character or text run. - `glyphRun` (`IN PDEGlyphRunP`): A pointer to a `PDEGlyphRun` structure with Unicode data, GlyphIDs and their correspondence. - `font` (`IN PDEFont`): The font for the element. - `gstateP` (`IN PDEGraphicStateP`): A pointer to a PDEGraphicStateP structure with the graphics state for the element. - `gstateLen` (`IN ASUns32`): The length of the graphics state for the element. - `tstateP` (`IN PDETextStateP`): A pointer to a `PDETextState` structure with text state for the element. Note that PDFEdit ignores the `wasSetFlags` flag of the `PDETextState` structure, so you must initialize the `PDETextState` fields. - `tstateLen` (`IN ASUns32`): The length of the text state for the element. - `textMatrixP` (`IN ASDoubleMatrixP`): A pointer to an `ASDoubleMatrix` that holds the matrix for the element. - `strokeMatrixP` (`IN ASDoubleMatrixP`): A pointer to an `ASDoubleMatrix` that holds the matrix for the line width when stroking text. It may be `NULL`. Note that this field is currently not used. **Returns:** `void` **Exceptions** - `pdErrBadResMetrics` - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDETextAddEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextAddEx), [`PDETextAddGlyphs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextAddGlyphs) #### PDETextAddItem ```cpp void PDETextAddItem(IN PDEText text, IN ASInt32 addIndex, IN PDETextItem textItem) ``` Header: `PEWProcs.h:2543` Adds a text item to a text element at a given index position. **Parameters** - `text` (`IN PDEText`): The text object to which the text item is added. - `addIndex` (`IN ASInt32`): The index of the text item in `pdeText`. - `textItem` (`IN PDETextItem`): The text item to add. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` - `pdErrBadResMetrics` **See also:** [`PDETextGetItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetItem), [`PDETextRemoveItems`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRemoveItems), [`PDETextItemCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemCreate) #### PDETextCreate ```cpp PDEText PDETextCreate(void) ``` Header: `PEWProcs.h:430` Creates an empty text object. Call PDERelease() to dispose of the returned text object when finished with it. **Parameters** - (unnamed) (`void`) **Returns:** [`PDEText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEText) An empty text object. #### PDETextGetAdvance ```cpp void PDETextGetAdvance(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, OUT ASFixedPointP advanceP) ``` Header: `PERProcs.h:2524` Gets the advance width of a character or a text element. Advance width is returned in either character space or user space. The advance width is the amount by which the current point advances when the character is drawn. Advance width may be horizontal or vertical, depending on the writing style. Thus `advanceP` has both a horizontal and vertical component. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run. In addition, set the kPDETextPageSpace flag to obtain the advance width in user space. If it is not set, the advance width is in character space. If this flag is not set, this method returns a value that is independent of any sizes, matrices, or scaling, simply adding up the font's raw glyph widths, supplemented only by unscaled character and word spacing. **Parameters** - `pdeText` (`IN PDEText`): A text object containing a character or text run whose advance width is found. - `flags` (`IN ASUns32`): A PDETextFlags value that specifies whether index refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values: - `index` (`IN ASInt32`): The index of the character or text run in `pdeText`. - `advanceP` (`OUT ASFixedPointP`): (Filled by the method) A pointer to a `ASFixedPoint` value indicating the advance width. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` - `pdErrBadResMetrics` **See also:** [`PDETextGetAdvanceWidth`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetAdvanceWidth) #### PDETextGetAdvanceWidth ```cpp void PDETextGetAdvanceWidth(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, OUT ASFixedPointP advanceP) ``` Header: `PERProcs.h:608` Gets the advance width of a character or a text element. Advance width is returned in either character space or user space. The advance width is the amount by which the current point advances when the character is drawn. Advance width may be horizontal or vertical, depending on the writing style. Thus `advanceP` has both a horizontal and vertical component. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run. In addition, set the kPDETextPageSpace flag to obtain the advance width in user space. If it is not set, the advance width is in character space. If this flag is not set, this method returns a value that is independent of any sizes, matrices, or scaling, simply adding up the font's raw glyph widths, supplemented only by unscaled character and word spacing. **Parameters** - `pdeText` (`IN PDEText`): A text object containing a character or text run whose advance width is found. - `flags` (`IN ASUns32`): A PDETextFlags value that specifies whether `index` refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values: - `index` (`IN ASInt32`): The index of the character or text run in `pdeText`. - `advanceP` (`OUT ASFixedPointP`): (Filled by the method) A pointer to a `ASFixedPoint` value indicating the advance width. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` - `pdErrBadResMetrics` #### PDETextGetBBox ```cpp void PDETextGetBBox(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, OUT ASFixedRectP bboxP) ``` Header: `PERProcs.h:399` Gets the bounding box of a character or a text run. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run. **Parameters** - `pdeText` (`IN PDEText`): IN/OUT A text object containing a character or text run whose bounding box is found. - `flags` (`IN ASUns32`): IN/OUT A PDETextFlags that specifies whether `index` refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values: - `index` (`IN ASInt32`): IN/OUT The index of the character or text run in `pdeText`. - `bboxP` (`OUT ASFixedRectP`): IN/OUT (Filled by the method) A pointer to `ASFixedRect` to set to the bounding box of specified character or text run. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` - `pdErrBadResMetrics` #### PDETextGetFont ```cpp PDEFont PDETextGetFont(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index) ``` Header: `PERProcs.h:498` Gets the font for a text character or element. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run. **Note:** This method does not change the reference count of the returned PDEFont. **Parameters** - `pdeText` (`IN PDEText`): IN/OUT A text object containing a character or text run whose font is found. - `flags` (`IN ASUns32`): IN/OUT A PDETextFlags that specifies whether `index` refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values: - `index` (`IN ASInt32`): IN/OUT The index of the character or text run in `pdeText`. **Returns:** [`PDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFont) The font of the specified character or text run. **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` - `pdErrBadResMetrics` **See also:** [`PDETextRunSetFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetFont) #### PDETextGetGState ```cpp void PDETextGetGState(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, OUT PDEGraphicStateP stateP, IN ASUns32 stateSize) ``` Header: `PERProcs.h:432` Gets the graphics state of a character or a text run. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run. **Note:** This method does not increment the reference count of the objects in `stateP`. **Parameters** - `pdeText` (`IN PDEText`): A text object containing a character or text run whose graphics state is found. - `flags` (`IN ASUns32`): A PDETextFlags that specifies whether `index` refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values: - `index` (`IN ASInt32`): The index of the character or text run in `pdeText`. - `stateP` (`OUT PDEGraphicStateP`): (Filled by the method) A pointer to a `PDEGraphicState` structure with the graphics state of the specified character or text run. - `stateSize` (`IN ASUns32`): The size of the `stateP` buffer in bytes. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDETextRunSetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetGState), [`PDETextGetGStateEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetGStateEx) #### PDETextGetGStateEx ```cpp void PDETextGetGStateEx(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, OUT PDEGraphicStateExP stateP, IN ASUns32 stateSize) ``` Header: `PERProcs.h:3289` Gets the graphics state of a character or a text run. This method fills `PDEGraphicStateEx` as output which is higher precision alternative of `PDEGraphicState` structure. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run. **Note:** This method does not increment the reference count of the objects in `stateP`. **Parameters** - `pdeText` (`IN PDEText`): A text object containing a character or text run whose graphics state is found. - `flags` (`IN ASUns32`): A PDETextFlags that specifies whether `index` refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values: - `index` (`IN ASInt32`): The index of the character or text run in `pdeText`. - `stateP` (`OUT PDEGraphicStateExP`): (Filled by the method) A pointer to a PDEGraphicStateExP structure with the graphics state of the specified character or text run. - `stateSize` (`IN ASUns32`): The size of the `stateP` buffer in bytes. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDETextRunSetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetGState), [`PDETextRunSetGStateEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetGStateEx), [`PDETextGetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetGState) #### PDETextGetItem ```cpp PDETextItem PDETextGetItem(IN PDEText text, IN ASUns32 index) ``` Header: `PERProcs.h:2640` Obtains a text item from a text element at a given index position. **Parameters** - `text` (`IN PDEText`): Text object from which the text item is obtained. - `index` (`IN ASUns32`): The index of the text item in `pdeText`. **Returns:** [`PDETextItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItem) The text item object. **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` - `pdErrBadResMetrics` **See also:** [`PDETextAddItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextAddItem), [`PDETextItemCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemCreate) #### PDETextGetMatrix ```cpp void PDETextGetMatrix(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, OUT ASFixedMatrixP matrixP) ``` Header: `PERProcs.h:2338` Superseded by PDETextGetMatrixEx() in Acrobat 10.0. Returns the matrix of a character or a text element. Unlike PDETextGetTextMatrix(), this function does not take `fontSize`, `hScale`, and `textRise` in the `textState` into account. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run. **Parameters** - `pdeText` (`IN PDEText`): IN/OUT A text object containing a character or text run whose graphics state is found. - `flags` (`IN ASUns32`): IN/OUT A PDETextFlags that specifies whether `index` refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values: - `index` (`IN ASInt32`): IN/OUT The index of the character or text run in `pdeText`. - `matrixP` (`OUT ASFixedMatrixP`): IN/OUT (Filled by the method) An ASFixedMatrixP that holds the matrix of the specified character or text run. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDETextGetTextMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetTextMatrix), [`PDETextGetMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetMatrixEx) #### PDETextGetMatrixEx ```cpp void PDETextGetMatrixEx(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, OUT ASDoubleMatrixP matrixP) ``` Header: `PERProcs.h:3158` Supersedes PDETextGetMatrix() in Acrobat 10.0. Returns the matrix of a character or a text element. Unlike PDETextGetTextMatrixEx(), this function does not take `fontSize`, `hScale`, and `textRise` in the `textState` into account. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run. **Parameters** - `pdeText` (`IN PDEText`): IN/OUT A text object containing a character or text run whose graphics state is found. - `flags` (`IN ASUns32`): IN/OUT A PDETextFlags that specifies whether `index` refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values: - `index` (`IN ASInt32`): IN/OUT The index of the character or text run in `pdeText`. - `matrixP` (`OUT ASDoubleMatrixP`): IN/OUT (Filled by the method) An ASDoubleMatrixP that holds the matrix of the specified character or text run. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDETextGetTextMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetTextMatrixEx), [`PDETextGetMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetMatrix) #### PDETextGetNumBytes ```cpp ASInt32 PDETextGetNumBytes(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index) ``` Header: `PERProcs.h:1619` Gets the number of bytes occupied by the character code or text run. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run. **Parameters** - `pdeText` (`IN PDEText`): IN/OUT A PDEText object returned from one of the `PDETextCreate` methods whose text is examined. - `flags` (`IN ASUns32`): IN/OUT A PDETextFlags that specifies whether `index` refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values: - `index` (`IN ASInt32`): IN/OUT The index of the character or text run in `pdeText`. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The number of bytes occupied by the text run or character. **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDEFontGetNumCodeBytes`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontGetNumCodeBytes) #### PDETextGetNumChars ```cpp ASInt32 PDETextGetNumChars(IN PDEText pdeText) ``` Header: `PERProcs.h:306` Gets the number of characters in a text object. **Parameters** - `pdeText` (`IN PDEText`): IN/OUT A text object whose number of characters is found. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The total number of characters in `pdeText`. **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDETextGetNumRuns`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetNumRuns), [`PDETextGetRunForChar`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetRunForChar) #### PDETextGetNumRuns ```cpp ASInt32 PDETextGetNumRuns(IN PDEText pdeText) ``` Header: `PERProcs.h:320` Gets the number of text runs (show strings) in a text object. **Parameters** - `pdeText` (`IN PDEText`): IN/OUT A text object whose number of text runs is found. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The number of text runs in `pdeText`. **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDETextGetNumBytes`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetNumBytes), [`PDETextGetRunForChar`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetRunForChar) #### PDETextGetQuad ```cpp void PDETextGetQuad(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, OUT ASFixedQuadP quadP) ``` Header: `PERProcs.h:1359` Gets the quad bounding the specified text run or character. The advance portion of the quad is based on the left side bearing and advance width. It must be one of the following values: Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run. In addition, if the kPDETextBounding flag is set, PDETextGetQuad() uses the font descriptor's `FontBBox`, which is the smallest rectangle that encloses all characters in the font. The advance portion is based on the x-coordinates of the left and right sides of `FontBBox` and the advance width. **Parameters** - `pdeText` (`IN PDEText`): IN/OUT A text object containing a character or text run whose quad is found. - `flags` (`IN ASUns32`): IN/OUT A PDETextFlags that specifies whether `index` refers to the character offset from the beginning of the text object or the index of the text run in the text object. - `index` (`IN ASInt32`): IN/OUT The index of the character or text run in `pdeText`. - `quadP` (`OUT ASFixedQuadP`): IN/OUT (Filled by the method) A pointer to `ASFixedQuad` that bounds the specified character or text run. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` - `pdErrBadResMetrics` #### PDETextGetRunForChar ```cpp ASInt32 PDETextGetRunForChar(IN PDEText pdeText, IN ASInt32 charIndex) ``` Header: `PERProcs.h:354` Gets the index of the text run that contains the nth character in a text object. **Parameters** - `pdeText` (`IN PDEText`): IN/OUT A text object to examine. - `charIndex` (`IN ASInt32`): IN/OUT The number of the character to find in `pdeText`. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The index of the text run with the specified character index into `pdeText`. **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` #### PDETextGetState ```cpp void PDETextGetState(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, OUT PDETextStateP stateP, IN ASUns32 stateSize) ``` Header: `PERProcs.h:2235` Returns the text state of a character or a text element. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run. **Parameters** - `pdeText` (`IN PDEText`): IN/OUT A text object containing a character or text run whose text state is found. - `flags` (`IN ASUns32`): IN/OUT A PDETextFlags that specifies whether `index` refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values: - `index` (`IN ASInt32`): IN/OUT The index of the character or text run in `pdeText`. - `stateP` (`OUT PDETextStateP`): IN/OUT (Filled by the method) A pointer to a `PDETextState` structure to fill with the text state of the specified character or text run. - `stateSize` (`IN ASUns32`): IN/OUT The size of the `stateP` buffer in bytes. **Returns:** `void` **Exceptions** - `genErrBadParm` - `peErrWrongPDEObjectType` **See also:** [`PDETextRunSetTextState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetTextState), [`PDETextGetTextState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetTextState) #### PDETextGetStrokeMatrix ```cpp void PDETextGetStrokeMatrix(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, OUT ASFixedMatrixP matrixP) ``` Header: `PERProcs.h:567` Superseded by PDETextGetStrokeMatrixEx() in Acrobat 10.0. Gets the stroke matrix of a character or a text run. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run. **Note:** This method returns no valid information. **Parameters** - `pdeText` (`IN PDEText`): A text object containing a character or text run whose stroke matrix is found. - `flags` (`IN ASUns32`): A PDETextFlags that specifies whether `index` refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values: - `index` (`IN ASInt32`): The index of the character or text run in `pdeText`. - `matrixP` (`OUT ASFixedMatrixP`): (Filled by the method) A pointer to `ASFixedMatrix` that holds the stroke matrix of the specified character or text run. This matrix is the transformation for line widths when stroking. The `h` and `v` values of the matrix are ignored. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDETextRunSetStrokeMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetStrokeMatrix), [`PDETextGetStrokeMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetStrokeMatrixEx) #### PDETextGetStrokeMatrixEx ```cpp void PDETextGetStrokeMatrixEx(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, OUT ASDoubleMatrixP matrixP) ``` Header: `PERProcs.h:3091` Supersedes PDETextGetStrokeMatrix() in Acrobat 10.0. Gets the stroke matrix of a character or a text run. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run. **Note:** This method returns no valid information. **Parameters** - `pdeText` (`IN PDEText`): A text object containing a character or text run whose stroke matrix is found. - `flags` (`IN ASUns32`): A PDETextFlags that specifies whether `index` refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values: - `index` (`IN ASInt32`): The index of the character or text run in `pdeText`. - `matrixP` (`OUT ASDoubleMatrixP`): (Filled by the method) A pointer to `ASDoubleMatrix` that holds the stroke matrix of the specified character or text run. This matrix is the transformation for line widths when stroking. The `h` and `v` values of the matrix are ignored. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDETextRunSetStrokeMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetStrokeMatrixEx), [`PDETextGetStrokeMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetStrokeMatrix) #### PDETextGetText ```cpp ASInt32 PDETextGetText(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, OUT ASUns8 *textBuffer) ``` Header: `PERProcs.h:640` Gets the text for a text run or character. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run. **Parameters** - `pdeText` (`IN PDEText`): IN/OUT A text object containing a character or text run whose text is found. - `flags` (`IN ASUns32`): IN/OUT A PDETextFlags that specifies whether `index` refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values: - `index` (`IN ASInt32`): IN/OUT The index of the character or text run in `pdeText`. - `textBuffer` (`OUT ASUns8 *`): IN/OUT (Filled by the method) The text of the specified character or text run. `textBuffer` must be large enough to hold the returned text. If `textBuffer` is `NULL`, it returns the number of bytes required to hold the data. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The number of bytes in the text run or character. **Exceptions** - `genErrBadParm` - `peErrWrongPDEObjectType` **See also:** [`PDETextGetTextMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetTextMatrix), [`PDETextGetTextState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetTextState) #### PDETextGetTextMatrix ```cpp void PDETextGetTextMatrix(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, OUT ASFixedMatrixP matrixP) ``` Header: `PERProcs.h:533` Superseded by PDETextGetTextMatrixEx() in Acrobat 10.0. Gets the matrix of a character or a text run. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run. **Parameters** - `pdeText` (`IN PDEText`): A text object containing a character or text run whose matrix is found. - `flags` (`IN ASUns32`): A PDETextFlags that specifies whether `index` refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values: - `index` (`IN ASInt32`): The index of the character or text run in `pdeText`. - `matrixP` (`OUT ASFixedMatrixP`): (Filled by the method) A pointer to `ASFixedMatrix` that holds the matrix of the specified character or text run. This is the transformation matrix from user space to the current text space. The `h` and `v` values of the matrix indicate the origin of the first character. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` - `pdErrBadResMetrics` **See also:** [`PDETextRunSetTextMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetTextMatrix), [`PDETextGetMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetMatrix), [`PDETextGetTextMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetTextMatrixEx) #### PDETextGetTextMatrixEx ```cpp void PDETextGetTextMatrixEx(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, OUT ASDoubleMatrixP matrixP) ``` Header: `PERProcs.h:3057` Supersedes PDETextGetTextMatrix() in Acrobat 10.0. Gets the matrix of a character or a text run. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run. **Parameters** - `pdeText` (`IN PDEText`): A text object containing a character or text run whose matrix is found. - `flags` (`IN ASUns32`): A PDETextFlags that specifies whether `index` refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values: - `index` (`IN ASInt32`): The index of the character or text run in `pdeText`. - `matrixP` (`OUT ASDoubleMatrixP`): (Filled by the method) A pointer to `ASDoubleMatrix` that holds the matrix of the specified character or text run. This is the transformation matrix from user space to the current text space. The `h` and `v` values of the matrix indicate the origin of the first character. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` - `pdErrBadResMetrics` **See also:** [`PDETextRunSetTextMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetTextMatrixEx), [`PDETextGetMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetMatrixEx), [`PDETextGetTextMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetTextMatrix) #### PDETextGetTextState ```cpp void PDETextGetTextState(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, OUT PDETextStateP stateP, IN ASUns32 stateSize) ``` Header: `PERProcs.h:467` Gets the text state of a character or a text element. **Note:** This function handles only `charSpacing`, `wordSpacing`, and `renderMode` for backward compatibility. For all attributes, use PDETextGetState() instead. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run. **Parameters** - `pdeText` (`IN PDEText`): IN/OUT A text object containing a character or text run whose text state is found. - `flags` (`IN ASUns32`): IN/OUT A PDETextFlags that specifies whether `index` refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values: - `index` (`IN ASInt32`): IN/OUT The index of the character or text run in `pdeText`. - `stateP` (`OUT PDETextStateP`): IN/OUT (Filled by the method) A pointer to a `PDETextState` structure to fill with the text state of the specified character or text run. - `stateSize` (`IN ASUns32`): IN/OUT The size of the `stateP` buffer in bytes. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDETextGetState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetState), [`PDETextRunSetTextState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetTextState) #### PDETextIsAtPoint ```cpp ASBool PDETextIsAtPoint(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, IN ASFixedPoint point) ``` Header: `PERProcs.h:1731` Tests whether a point is on specified text. It checks if the point is in a bounding box for the PDEText. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run. **Parameters** - `pdeText` (`IN PDEText`): IN/OUT The text to test. - `flags` (`IN ASUns32`): IN/OUT A PDETextFlags that specifies whether `index` refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values: - `index` (`IN ASInt32`): IN/OUT The index of the character or text run in `pdeText`. - `point` (`IN ASFixedPoint`): IN/OUT The point, specified in user space coordinates. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the point is on the text, `false` otherwise. **See also:** [`PDEElementIsAtPoint`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementIsAtPoint), [`PDEElementIsAtRect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementIsAtRect) #### PDETextIsAtRect ```cpp ASBool PDETextIsAtRect(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, IN ASFixedRect rect) ``` Header: `PERProcs.h:1760` Tests whether any part of a rectangle is on the specified text. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run. **Parameters** - `pdeText` (`IN PDEText`): IN/OUT The text to test. - `flags` (`IN ASUns32`): IN/OUT A PDETextFlags flag that specifies whether index refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values: - `index` (`IN ASInt32`): IN/OUT The index of the character or text run in `pdeText`. - `rect` (`IN ASFixedRect`): IN/OUT The rectangle, specified in user space coordinates. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the text is on the rectangle, `false` otherwise. **See also:** [`PDEElementIsAtPoint`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementIsAtPoint), [`PDEElementIsAtRect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElementIsAtRect), [`PDETextIsAtPoint`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextIsAtPoint) #### PDETextRemove ```cpp void PDETextRemove(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, IN ASInt32 count) ``` Header: `PEWProcs.h:417` Removes characters or text runs from a text object. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run. **Note:** This method decrements the reference count of objects associated with the `pdeText` in the graphic state and font. **Parameters** - `pdeText` (`IN PDEText`): IN/OUT The text object from which text is removed. - `flags` (`IN ASUns32`): IN/OUT A PDETextFlags that specifies whether `index` refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values: - `index` (`IN ASInt32`): IN/OUT The index of the character or text run in `pdeText`. - `count` (`IN ASInt32`): IN/OUT The number of characters or text runs to remove. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` - `pdErrBadResMetrics` **See also:** [`PDETextAdd`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextAdd), [`PDETextReplaceChars`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextReplaceChars), [`PDETextSplitRunAt`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextSplitRunAt) #### PDETextRemoveItems ```cpp void PDETextRemoveItems(IN PDEText text, IN ASUns32 index, IN ASUns32 count) ``` Header: `PEWProcs.h:2560` Removes contiguous text items from a text element starting at a given index position. **Parameters** - `text` (`IN PDEText`): The text object from which the text items are removed. - `index` (`IN ASUns32`): The index of the first text item in `pdeText` to remove. - `count` (`IN ASUns32`): The number of text items to remove. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` - `pdErrBadResMetrics` **See also:** [`PDETextAddItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextAddItem), [`PDETextGetItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetItem) #### PDETextReplaceChars ```cpp void PDETextReplaceChars(IN PDEText pdeText, IN ASUns32 flags, IN ASInt32 index, IN ASUns8 *textBuffer, IN ASInt32 numChars) ``` Header: `PEWProcs.h:1300` Replaces characters in a text object. This method does not change the number of characters in the text object; extra characters are ignored. Value Description kPDETextChar Used for a text character. kPDETextRun Used for a text run. **Parameters** - `pdeText` (`IN PDEText`): IN/OUT The text object in which characters are replaced. - `flags` (`IN ASUns32`): IN/OUT A PDETextFlags that specifies whether `index` refers to the character offset from the beginning of the text object or the index of the text run in the text object. It must be one of the following values: - `index` (`IN ASInt32`): IN/OUT The index of the character or text run in `pdeText`. - `textBuffer` (`IN ASUns8 *`): IN/OUT Replacement text. - `numChars` (`IN ASInt32`): IN/OUT The number of bytes to replace. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDETextAdd`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextAdd), [`PDETextIsAtPoint`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextIsAtPoint), [`PDETextSplitRunAt`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextSplitRunAt) #### PDETextRunGetCharOffset ```cpp ASInt32 PDETextRunGetCharOffset(IN PDEText pdeText, IN ASInt32 runIndex) ``` Header: `PERProcs.h:339` Gets the character offset of the first character of the specified text run. **Parameters** - `pdeText` (`IN PDEText`): IN/OUT A text object containing a character or text run whose graphics state is found. - `runIndex` (`IN ASInt32`): IN/OUT The index of the text run whose first character's index is returned. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The character offset of the first character of the specified text run in `pdeText`. **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDETextGetNumBytes`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetNumBytes), [`PDETextGetNumRuns`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetNumRuns), [`PDETextGetRunForChar`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetRunForChar) #### PDETextRunGetNumChars ```cpp ASInt32 PDETextRunGetNumChars(IN PDEText pdeText, IN ASInt32 runIndex) ``` Header: `PERProcs.h:371` Gets the number of characters in a text run. **Parameters** - `pdeText` (`IN PDEText`): IN/OUT A text object containing a text run whose number of characters is found. - `runIndex` (`IN ASInt32`): IN/OUT The index of the text run whose number of characters is returned. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The number of characters in the specified text run. **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDETextGetNumRuns`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetNumRuns), [`PDETextGetRunForChar`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetRunForChar), [`PDETextRunGetCharOffset`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunGetCharOffset) #### PDETextRunSetFont ```cpp void PDETextRunSetFont(IN PDEText pdeText, IN ASInt32 runIndex, IN PDEFont font) ``` Header: `PEWProcs.h:290` Sets the font of a text run. **Note:** This method decrements the reference count of the previous font and increments the reference count of the new font. **Parameters** - `pdeText` (`IN PDEText`): IN/OUT The text object containing a text run whose font is set. - `runIndex` (`IN ASInt32`): IN/OUT The index of the text run. - `font` (`IN PDEFont`): IN/OUT The font set for the text run. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDETextGetFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetFont) #### PDETextRunSetGState ```cpp void PDETextRunSetGState(IN PDEText pdeText, IN ASInt32 runIndex, IN PDEGraphicStateP stateP, IN ASUns32 stateSize) ``` Header: `PEWProcs.h:248` Sets the graphics state of a text run. **Note:** This method increments the reference count of objects in `stateP`. **Parameters** - `pdeText` (`IN PDEText`): The text object containing a text run whose graphics state is set. - `runIndex` (`IN ASInt32`): The index of the text run. - `stateP` (`IN PDEGraphicStateP`): A pointer to a `PDEGraphicState` structure with the graphics state to set. - `stateSize` (`IN ASUns32`): The size of the `stateP` buffer in bytes. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDETextGetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetGState), [`PDETextRunSetGStateEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetGStateEx) #### PDETextRunSetGStateEx ```cpp void PDETextRunSetGStateEx(IN PDEText pdeText, IN ASInt32 runIndex, IN PDEGraphicStateExP stateP, IN ASUns32 stateSize) ``` Header: `PEWProcs.h:3786` Sets the graphics state of a text run. This method takes pointer to PDEGraphicStateEx as input which is higher precision alternative of `PDEGraphicState` structure. @note This method increments the reference count of objects in `stateP`. @since **Parameters** - `pdeText` (`IN PDEText`): The text object containing a text run whose graphics state is set. - `runIndex` (`IN ASInt32`): The index of the text run. - `stateP` (`IN PDEGraphicStateExP`): A pointer to a PDEGraphicStateEx structure with the graphics state to set. - `stateSize` (`IN ASUns32`): The size of the `stateP` buffer in bytes. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDETextGetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetGState), [`PDETextGetGStateEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetGStateEx), [`PDETextRunSetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetGState) #### PDETextRunSetMatrix ```cpp void PDETextRunSetMatrix(IN PDEText pdeText, IN ASInt32 runIndex, IN ASFixedMatrixP matrixP) ``` Header: `PEWProcs.h:2269` Superseded by PDETextRunSetMatrixEx() in Acrobat 10.0. Sets the matrix of a text run. Unlike PDETextRunSetTextMatrix(), this function does not change `fontSize`, `hScale`, and `textRise` in the `textState` of PDEText. **Parameters** - `pdeText` (`IN PDEText`): IN/OUT The text object containing a text run. - `runIndex` (`IN ASInt32`): IN/OUT The index of the text run. - `matrixP` (`IN ASFixedMatrixP`): IN/OUT ASFixedMatrixP pointer. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDETextRunSetTextMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetTextMatrix), [`PDETextRunSetMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetMatrixEx) #### PDETextRunSetMatrixEx ```cpp void PDETextRunSetMatrixEx(IN PDEText pdeText, IN ASInt32 runIndex, IN ASDoubleMatrixP matrixP) ``` Header: `PEWProcs.h:3697` Sets the matrix of a text run. Supersedes PDETextRunSetMatrix() in Acrobat 10.0. Unlike PDETextRunSetTextMatrixEx(), this function does not change `fontSize`, `hScale`, and `textRise` in the `textState` of PDEText. **Parameters** - `pdeText` (`IN PDEText`): IN/OUT The text object containing a text run. - `runIndex` (`IN ASInt32`): IN/OUT The index of the text run. - `matrixP` (`IN ASDoubleMatrixP`): IN/OUT ASDoubleMatrixP pointer. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDETextRunSetTextMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetTextMatrixEx), [`PDETextRunSetMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetMatrix) #### PDETextRunSetState ```cpp void PDETextRunSetState(IN PDEText pdeText, IN ASInt32 runIndex, IN PDETextStateP stateP, IN ASUns32 stateSize) ``` Header: `PEWProcs.h:2067` Sets the text state of a text run. **Parameters** - `pdeText` (`IN PDEText`): The text object containing a text run whose state is set. - `runIndex` (`IN ASInt32`): The index of the text run. - `stateP` (`IN PDETextStateP`): A pointer to a `PDETextState` structure with the state to set. - `stateSize` (`IN ASUns32`): The size of the `stateP` buffer in bytes. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDETextRunSetTextState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetTextState) #### PDETextRunSetStrokeMatrix ```cpp void PDETextRunSetStrokeMatrix(IN PDEText pdeText, IN ASInt32 runIndex, IN ASFixedMatrixP matrixP) ``` Header: `PEWProcs.h:328` Superseded by PDETextRunSetStrokeMatrixEx() in Acrobat 10.0. Sets the stroke matrix of a text run. **Note:** Currently this method is not implemented. **Parameters** - `pdeText` (`IN PDEText`): The text object containing a text run whose stroke matrix is set. - `runIndex` (`IN ASInt32`): The index of the text run. - `matrixP` (`IN ASFixedMatrixP`): A pointer to an `ASFixedMatrix` that holds the stroke matrix. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDETextGetStrokeMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetStrokeMatrix), [`PDETextRunSetStrokeMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetStrokeMatrixEx) #### PDETextRunSetStrokeMatrixEx ```cpp void PDETextRunSetStrokeMatrixEx(IN PDEText pdeText, IN ASInt32 runIndex, IN ASDoubleMatrixP matrixP) ``` Header: `PEWProcs.h:3452` Sets the stroke matrix of a text run. Supersedes PDETextRunSetStrokeMatrix() in Acrobat 10.0. **Note:** Currently this method is not implemented (Acrobat 10 and later). **Parameters** - `pdeText` (`IN PDEText`): The text object containing a text run whose stroke matrix is set. - `runIndex` (`IN ASInt32`): The index of the text run. - `matrixP` (`IN ASDoubleMatrixP`): A pointer to an `ASDoubleMatrix` that holds the stroke matrix. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDETextGetStrokeMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetStrokeMatrixEx), [`PDETextRunSetStrokeMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetStrokeMatrix) #### PDETextRunSetTextMatrix ```cpp void PDETextRunSetTextMatrix(IN PDEText pdeText, IN ASInt32 runIndex, IN ASFixedMatrixP matrixP) ``` Header: `PEWProcs.h:309` Superseded by PDETextRunSetTextMatrixEx() in Acrobat 10.0. Sets the text matrix of a text run. **Parameters** - `pdeText` (`IN PDEText`): IN/OUT The text object containing a text run whose text matrix is set. - `runIndex` (`IN ASInt32`): IN/OUT The index of the text run. - `matrixP` (`IN ASFixedMatrixP`): IN/OUT A pointer to an `ASFixedMatrix` that holds the text matrix. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDETextGetTextMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetTextMatrix), [`PDETextRunSetMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetMatrix), [`PDETextRunSetTextMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetTextMatrixEx) #### PDETextRunSetTextMatrixEx ```cpp void PDETextRunSetTextMatrixEx(IN PDEText pdeText, IN ASInt32 runIndex, IN ASDoubleMatrixP matrixP) ``` Header: `PEWProcs.h:3433` Sets the text matrix of a text run. Supersedes PDETextRunSetTextMatrix() in Acrobat 10.0. **Parameters** - `pdeText` (`IN PDEText`): IN/OUT The text object containing a text run whose text matrix is set. - `runIndex` (`IN ASInt32`): IN/OUT The index of the text run. - `matrixP` (`IN ASDoubleMatrixP`): IN/OUT A pointer to an `ASDoubleMatrix` that holds the text matrix. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDETextGetTextMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetTextMatrixEx), [`PDETextRunSetMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetMatrixEx), [`PDETextRunSetTextMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetTextMatrix) #### PDETextRunSetTextState ```cpp void PDETextRunSetTextState(IN PDEText pdeText, IN ASInt32 runIndex, IN PDETextStateP stateP, IN ASUns32 stateSize) ``` Header: `PEWProcs.h:272` Sets the text state of a text run. **Note:** This method has the following side effect: It modifies the text matrix of the run. In order to maintain backward compatibility, this method only directly operates on the first four fields of `PDETextState`. When it is called, it calculates a new text matrix with three additional fields: `fontSize`, `hScale`, and `textRise` (see `PDETextState`). To avoid this behavior, use PDETextRunSetState() instead (which was added to address this problem). **Parameters** - `pdeText` (`IN PDEText`): The text object containing a text run whose text state is set. - `runIndex` (`IN ASInt32`): The index of the text run. - `stateP` (`IN PDETextStateP`): A pointer to a `PDETextState` structure with text state. - `stateSize` (`IN ASUns32`): The size of the `stateP` buffer in bytes. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDETextGetTextState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetTextState), [`PDETextRunSetState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetState) #### PDETextSplitRunAt ```cpp void PDETextSplitRunAt(IN PDEText pdeText, IN ASInt32 splitLoc) ``` Header: `PEWProcs.h:1250` Splits a text run into two text runs. **Parameters** - `pdeText` (`IN PDEText`): The text object containing a text run to split. - `splitLoc` (`IN ASInt32`): The split location, relative to the text object. The first text run is from character index `0` up to `splitLoc`. The second text run is from `splitLoc + 1` to the end of the run. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` - `pdErrBadResMetrics` **See also:** [`PDETextIsAtPoint`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextIsAtPoint), [`PDETextReplaceChars`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextReplaceChars) ### Structures (1) #### PDEText ```cpp typedef struct _t_PDEText* PDEText ``` Header: `PEExpT.h:166` A PDEElement representing text. It is a container for text as show strings or as individual characters. Each sub-element may have different graphics state properties. However, the same clip applies to all sub-elements of a PDEText. Also, the `charpath` of a PDEText can be used to represent a clip. **See also:** `PDEElement (superclass)`, [`PDETextCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextCreate), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease) ### Enums (3) #### PDETextFlags Header: `PEExpT.h:1740` A bit field used in PDEText methods. **Values** - `kPDETextRun = 0x0001`: Text run. - `kPDETextChar = 0x0002`: Character (text run with only one character). - `kPDETextPageSpace = 0x0004`: Obtain the advance width in page space. - `kPDETextGetBounds = 0x0008`: Fill in the left and right bounds of the text run's bounding box. - `kPDETextPreciseQuad = 0x0010` **See also:** [`PDETextAdd`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextAdd), [`PDETextGetFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetFont), [`PDETextGetText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetText) #### PDETextRenderMode Header: `PEExpT.h:1764` Flags indicating text rendering mode set by the Tr operator. **Values** - `kPDETextFill = 0`: Fill text. - `kPDETextStroke = 1`: Stroke text. - `kPDETextFillAndStroke = 2`: Fill and stroke text. - `kPDETextInvisible = 3`: Text with no fill and no stroke (invisible). **See also:** [`PDETextCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextCreate) #### PDETextStateWasSetFlags Header: `PEExpT.h:678` A structure describing the text state that was set. **Values** - `kPDECharSpacingWasSet = 0x0001`: Character spacing was set corresponding to the Tc operator. - `kPDEWordSpacingWasSet = 0x0002`: Word spacing was set corresponding to the Tw operator. - `kPDERenderModeWasSet = 0x0004`: Text rendering mode was set corresponding to the Tr operator. - `kPDEFontSizeWasSet = 0x0008`: Font size was set corresponding to the Tf operator. - `kPDEHScaleWasSet = 0x0010`: Horizontal Scaling was set corresponding to the Tz operator. - `kPDETextRiseWasSet = 0x0020`: Text rise was set corresponding to the Ts operator. **See also:** [`PDETextAdd`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextAdd), [`PDETextGetTextState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetTextState), [`PDETextRunSetTextState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextRunSetTextState) ## PDETextItem ### Functions (19) #### PDETextItemCopyText ```cpp ASUns32 PDETextItemCopyText(IN PDETextItem textItem, OUT ASUns8 *buffer, IN ASUns32 bufferSize) ``` Header: `PERProcs.h:2607` Copies the text from a text item element into a character buffer. **Parameters** - `textItem` (`IN PDETextItem`): A pointer to the characters to add. Note that passing `NULL` for text can invalidate the text object but will not raise an error. Callers must not pass `NULL` for this parameter. - `buffer` (`OUT ASUns8 *`): (Filled by the method) A pointer to a buffer in which to store the copy. - `bufferSize` (`IN ASUns32`): The length of the text buffer in bytes. **Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32) The length in bytes of `textItem`. **Exceptions** - `pdErrBadResMetrics` - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDETextGetItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextGetItem), [`PDETextAddItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextAddItem), [`PDETextItemGetTextLen`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemGetTextLen) #### PDETextItemCreate ```cpp PDETextItem PDETextItemCreate(IN ASUns8 *text, IN ASUns32 textLen, IN PDEFont font, IN PDEGraphicStateP gStateP, IN ASUns32 gStateLen, IN PDETextStateP textStateP, IN ASUns32 textStateLen, IN ASFixedMatrix *textMatrixP) ``` Header: `PEWProcs.h:2412` Superseded by PDETextItemCreateEx() in Acrobat 10.0. Creates a text item element containing a character or text run, which can be added to a PDEText text object. Call PDERelease() to dispose of the returned PDETextItem object when finished with it. **Parameters** - `text` (`IN ASUns8 *`): A pointer to the characters to add. Note that passing `NULL` for text can invalidate the text object but will not raise an error. Callers must not pass `NULL` for this parameter. - `textLen` (`IN ASUns32`): The length of the text in bytes. - `font` (`IN PDEFont`): The font for the element. - `gStateP` (`IN PDEGraphicStateP`): A pointer to a PDEGraphicStateP structure with the graphics state for the element. - `gStateLen` (`IN ASUns32`): The length of the graphics state for the element. - `textStateP` (`IN PDETextStateP`): A pointer to a `PDETextState` structure with the text state for the element. Note that PDFEdit ignores the `wasSetFlags` flag of the `PDETextState` structure, so you must initialize the `PDETextState` fields. - `textStateLen` (`IN ASUns32`): The length of the text state for the element. - `textMatrixP` (`IN ASFixedMatrix *`): A pointer to an `ASFixedMatrix` that holds the matrix for the element. **Returns:** [`PDETextItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItem) **Exceptions** - `pdErrBadResMetrics` - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDETextAdd`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextAdd), [`PDETextAddItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextAddItem), [`PDETextItemCreateEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemCreateEx) #### PDETextItemCreateEx ```cpp PDETextItem PDETextItemCreateEx(IN ASUns8 *text, IN ASUns32 textLen, IN PDEFont font, IN PDEGraphicStateP gStateP, IN ASUns32 gStateLen, IN PDETextStateP textStateP, IN ASUns32 textStateLen, IN ASDoubleMatrix *textMatrixP) ``` Header: `PEWProcs.h:3515` Creates a text item element containing a character or text run, which can be added to a PDEText text object. Supersedes PDETextItemCreate() in Acrobat 10.0. Call PDERelease() to dispose of the returned PDETextItem object when finished with it. **Parameters** - `text` (`IN ASUns8 *`): A pointer to the characters to add. Note that passing `NULL` for text can invalidate the text object but will not raise an error. Callers must not pass `NULL` for this parameter. - `textLen` (`IN ASUns32`): The length of the text in bytes. - `font` (`IN PDEFont`): The font for the element. - `gStateP` (`IN PDEGraphicStateP`): A pointer to a PDEGraphicStateP structure with the graphics state for the element. - `gStateLen` (`IN ASUns32`): The length of the graphics state for the element. - `textStateP` (`IN PDETextStateP`): A pointer to a `PDETextState` structure with the text state for the element. Note that PDFEdit ignores the `wasSetFlags` flag of the `PDETextState` structure, so you must initialize the `PDETextState` fields. - `textStateLen` (`IN ASUns32`): The length of the text state for the element. - `textMatrixP` (`IN ASDoubleMatrix *`): A pointer to an `ASDoubleMatrix` that holds the matrix for the element. **Returns:** [`PDETextItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItem) **Exceptions** - `pdErrBadResMetrics` - `peErrWrongPDEObjectType` - `genErrBadParm` **See also:** [`PDETextAddEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextAddEx), [`PDETextAddItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextAddItem), [`PDETextItemCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemCreate) #### PDETextItemGetFont ```cpp PDEFont PDETextItemGetFont(IN PDETextItem textItem) ``` Header: `PERProcs.h:2540` Gets the font for a text item. **Note:** This method does not change the reference count of the returned PDEFont. **Parameters** - `textItem` (`IN PDETextItem`): The text item whose font is obtained. **Returns:** [`PDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFont) The font of the specified text item. **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` - `pdErrBadResMetrics` **See also:** [`PDETextItemSetFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemSetFont) #### PDETextItemGetGState ```cpp void PDETextItemGetGState(IN PDETextItem textItem, OUT PDEGraphicStateP stateP, IN ASUns32 stateSize) ``` Header: `PERProcs.h:2624` Gets the graphics state for a text item. **Parameters** - `textItem` (`IN PDETextItem`): Text item whose graphic state is obtained. - `stateP` (`OUT PDEGraphicStateP`): (Filled by the method) A pointer to a `PDEGraphicState` structure with graphics state of the text item. - `stateSize` (`IN ASUns32`): The size of the `stateP` buffer in bytes. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` - `pdErrBadResMetrics` **See also:** [`PDETextItemSetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemSetGState), [`PDETextItemGetGStateEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemGetGStateEx) #### PDETextItemGetGStateEx ```cpp void PDETextItemGetGStateEx(IN PDETextItem textItem, OUT PDEGraphicStateExP stateP, IN ASUns32 stateSize) ``` Header: `PERProcs.h:3310` Gets the graphics state for a text item. This method fills `PDEGraphicStateEx` as output which is higher precision alternative of `PDEGraphicState` structure. **Parameters** - `textItem` (`IN PDETextItem`): Text item whose graphic state is obtained. - `stateP` (`OUT PDEGraphicStateExP`): (Filled by the method) A pointer to a `PDEGraphicStateEx` structure with graphics state of the text item. - `stateSize` (`IN ASUns32`): The size of the `stateP` buffer in bytes. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` - `pdErrBadResMetrics` **See also:** [`PDETextItemSetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemSetGState), [`PDETextItemGetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemGetGState) #### PDETextItemGetTextLen ```cpp ASUns32 PDETextItemGetTextLen(IN PDETextItem textItem) ``` Header: `PERProcs.h:2586` Gets the text length for a text item. **Parameters** - `textItem` (`IN PDETextItem`): The text item whose text length is obtained. **Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32) The text length in bytes. **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` - `pdErrBadResMetrics` **See also:** [`PDETextItemCopyText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemCopyText) #### PDETextItemGetTextMatrix ```cpp void PDETextItemGetTextMatrix(IN PDETextItem textItem, IN ASUns32 charOffset, OUT ASFixedMatrix *textMatrixP) ``` Header: `PERProcs.h:2558` Superseded by PDETextItemGetTextMatrixEx() in Acrobat 10.0. Gets the text matrix for a character in a text item. **Parameters** - `textItem` (`IN PDETextItem`): The text item. - `charOffset` (`IN ASUns32`): The offset of the character whose text matrix is obtained. - `textMatrixP` (`OUT ASFixedMatrix *`): (Filled by the method) A pointer to a `ASFixedMatrix` structure with the text matrix of the character. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` - `pdErrBadResMetrics` **See also:** [`PDETextItemSetTextMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemSetTextMatrix), [`PDETextItemGetTextMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemGetTextMatrixEx) #### PDETextItemGetTextMatrixEx ```cpp void PDETextItemGetTextMatrixEx(IN PDETextItem textItem, IN ASUns32 charOffset, OUT ASDoubleMatrix *textMatrixP) ``` Header: `PERProcs.h:3127` Supersedes PDETextItemGetTextMatrix() in Acrobat 10.0. Gets the text matrix for a character in a text item. **Parameters** - `textItem` (`IN PDETextItem`): The text item. - `charOffset` (`IN ASUns32`): The offset of the character whose text matrix is obtained. - `textMatrixP` (`OUT ASDoubleMatrix *`): (Filled by the method) A pointer to a `ASDoubleMatrix` structure with the text matrix of the character. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` - `pdErrBadResMetrics` **See also:** [`PDETextItemSetTextMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemSetTextMatrixEx), [`PDETextItemGetTextMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemGetTextMatrix) #### PDETextItemGetTextState ```cpp void PDETextItemGetTextState(IN PDETextItem textItem, OUT PDETextStateP textStateP, IN ASUns32 textStateSize) ``` Header: `PERProcs.h:2574` Gets the text state of a text item. **Parameters** - `textItem` (`IN PDETextItem`): The text item whose text state is obtained. - `textStateP` (`OUT PDETextStateP`): (Filled by the method) A pointer to a PDETextStateP structure with text state of the text item. - `textStateSize` (`IN ASUns32`): The size of the `texStateP` structure in bytes. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` - `pdErrBadResMetrics` **See also:** [`PDETextItemSetTextState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemSetTextState) #### PDETextItemRemoveChars ```cpp void PDETextItemRemoveChars(IN PDETextItem textItem, IN ASUns32 charOffset, IN ASUns32 count) ``` Header: `PEWProcs.h:2528` Removes contiguous characters from a text item. **Parameters** - `textItem` (`IN PDETextItem`): The text item whose characters are removed. - `charOffset` (`IN ASUns32`): The offset of the first character to remove. - `count` (`IN ASUns32`): The number of characters to remove. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` - `pdErrBadResMetrics` **See also:** [`PDETextItemReplaceChars`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemReplaceChars), [`PDETextItemReplaceText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemReplaceText) #### PDETextItemReplaceChars ```cpp void PDETextItemReplaceChars(IN PDETextItem textItem, IN ASUns32 charIndex, IN ASUns8 *newChar, IN ASUns32 newCharLen) ``` Header: `PEWProcs.h:2512` Replaces characters in a text item. This method does not change the number of characters in the text item; extra characters are ignored. **Parameters** - `textItem` (`IN PDETextItem`): The text item whose characters are replaced. - `charIndex` (`IN ASUns32`): The index position of the characters to replace. - `newChar` (`IN ASUns8 *`): The replacement text. - `newCharLen` (`IN ASUns32`): The number of bytes to replace. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` - `pdErrBadResMetrics` **See also:** [`PDETextItemRemoveChars`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemRemoveChars), [`PDETextItemReplaceText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemReplaceText) #### PDETextItemReplaceText ```cpp void PDETextItemReplaceText(IN PDETextItem textItem, IN ASUns8 *newText, IN ASUns32 newTextLen) ``` Header: `PEWProcs.h:2491` Replaces all of the text in a text item. **Parameters** - `textItem` (`IN PDETextItem`): The text item whose text are replaced. - `newText` (`IN ASUns8 *`): The replacement text. - `newTextLen` (`IN ASUns32`): The number of bytes to replace. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` - `pdErrBadResMetrics` **See also:** [`PDETextItemRemoveChars`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemRemoveChars), [`PDETextItemReplaceChars`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemReplaceChars) #### PDETextItemSetFont ```cpp void PDETextItemSetFont(IN PDETextItem textItem, IN PDEFont font) ``` Header: `PEWProcs.h:2429` Sets the font for a text item. **Note:** This method decrements the reference count of the previous font and increments the reference count of the new font. **Parameters** - `textItem` (`IN PDETextItem`): The text item whose font is set. - `font` (`IN PDEFont`): The new font object. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` - `pdErrBadResMetrics` **See also:** [`PDETextItemGetFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemGetFont) #### PDETextItemSetGState ```cpp void PDETextItemSetGState(IN PDETextItem textItem, OUT PDEGraphicStateP stateP, IN ASUns32 stateSize) ``` Header: `PEWProcs.h:2476` Sets the graphics state for a text item. **Parameters** - `textItem` (`IN PDETextItem`): Text item whose graphics state is set. - `stateP` (`OUT PDEGraphicStateP`): A pointer to a `PDEGraphicState` structure with graphics state of the text item. - `stateSize` (`IN ASUns32`): The size of the `stateP` buffer in bytes. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` - `pdErrBadResMetrics` **See also:** [`PDETextItemGetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemGetGState), [`PDETextItemSetGStateEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemSetGStateEx) #### PDETextItemSetGStateEx ```cpp void PDETextItemSetGStateEx(IN PDETextItem textItem, OUT PDEGraphicStateExP stateP, IN ASUns32 stateSize) ``` Header: `PEWProcs.h:3806` Sets the graphics state for a text item. This method takes pointer to PDEGraphicStateEx as input which is higher precision alternative of `PDEGraphicState` structure. @since **Parameters** - `textItem` (`IN PDETextItem`): Text item whose graphics state is set. - `stateP` (`OUT PDEGraphicStateExP`): A pointer to a PDEGraphicStateEx structure with graphics state of the text item. - `stateSize` (`IN ASUns32`): The size of the `stateP` buffer in bytes. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` - `pdErrBadResMetrics` **See also:** [`PDETextItemGetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemGetGState), [`PDETextItemGetGStateEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemGetGStateEx), [`PDETextItemSetGState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemSetGState) #### PDETextItemSetTextMatrix ```cpp void PDETextItemSetTextMatrix(IN PDETextItem textItem, IN ASFixedMatrix *textMatrixP) ``` Header: `PEWProcs.h:2446` Superseded by PDETextItemSetTextMatrixEx() in Acrobat 10.0. Sets the text matrix for a text item. **Parameters** - `textItem` (`IN PDETextItem`): The text item whose text matrix is set. - `textMatrixP` (`IN ASFixedMatrix *`): A pointer to a `ASFixedMatrix` structure with the new text matrix of the text item. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` - `pdErrBadResMetrics` **See also:** [`PDETextItemGetTextMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemGetTextMatrix), [`PDETextItemSetTextMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemSetTextMatrixEx) #### PDETextItemSetTextMatrixEx ```cpp void PDETextItemSetTextMatrixEx(IN PDETextItem textItem, IN ASDoubleMatrix *textMatrixP) ``` Header: `PEWProcs.h:3533` Sets the text matrix for a text item. Supersedes PDETextItemSetTextMatrix() in Acrobat 10.0. **Parameters** - `textItem` (`IN PDETextItem`): The text item whose text matrix is set. - `textMatrixP` (`IN ASDoubleMatrix *`): A pointer to a `ASDoubleMatrix` structure with the new text matrix of the text item. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` - `pdErrBadResMetrics` **See also:** [`PDETextItemGetTextMatrixEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemGetTextMatrixEx), [`PDETextItemSetTextMatrix`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemSetTextMatrix) #### PDETextItemSetTextState ```cpp void PDETextItemSetTextState(IN PDETextItem textItem, IN PDETextStateP textStateP, IN ASUns32 textStateSize) ``` Header: `PEWProcs.h:2461` Sets the text state for a text item. **Parameters** - `textItem` (`IN PDETextItem`): The text item whose text state is set. - `textStateP` (`IN PDETextStateP`): A PDETextStateP structure with the new text state of the text item. - `textStateSize` (`IN ASUns32`): The size of the `textStateP` structure in bytes. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` - `genErrBadParm` - `pdErrBadResMetrics` **See also:** [`PDETextItemGetTextState`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItemGetTextState) ### Structures (1) #### PDETextItem ```cpp typedef struct _t_PDETextItem* PDETextItem ``` Header: `PEExpT.h:411` A reference to a PDETextItem. ## PDEUnknown ### Functions (1) #### PDEUnknownGetOpName ```cpp ASAtom PDEUnknownGetOpName(IN PDEUnknown pdeUnknown) ``` Header: `PERProcs.h:1808` Gets the operator name of an unknown operator. **Parameters** - `pdeUnknown` (`IN PDEUnknown`): IN/OUT Unknown element whose operator name is obtained. **Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom) An ASAtom for the name of the operator for `pdeUnknown`. ### Structures (1) #### PDEUnknown ```cpp typedef struct _t_PDEUnknown* PDEUnknown ``` Header: `PEExpT.h:237` A PDEElement representing an unknown element. **See also:** `PDEElement (superclass)` ## PDEXGroup ### Functions (9) #### PDEXGroupAcquireColorSpace ```cpp PDEColorSpace PDEXGroupAcquireColorSpace(IN PDEXGroup pdeXGroup) ``` Header: `PERProcs.h:1987` Acquires the color space of the transparency group. Call PDERelease() to dispose of the PDEColorSpace when finished with it. **Parameters** - `pdeXGroup` (`IN PDEXGroup`): The transparency group object. **Returns:** [`PDEColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEColorSpace) The color space; otherwise it returns `NULL`. #### PDEXGroupCreate ```cpp PDEXGroup PDEXGroupCreate(IN CosDoc cosDoc, IN PDEXGroupCreateFlags type) ``` Header: `PEWProcs.h:1774` Create a new XGroup of the given type. Call PDERelease() to dispose of the returned PDEXGroup object when finished with it. **Parameters** - `cosDoc` (`IN CosDoc`): The document in which the object will be created. - `type` (`IN PDEXGroupCreateFlags`): It must be kPDEXGroupTypeTransparency. **Returns:** [`PDEXGroup`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEXGroup) The newly created transparency group object. #### PDEXGroupCreateFromCosObj ```cpp PDEXGroup PDEXGroupCreateFromCosObj(IN const CosObj *cosObjP) ``` Header: `PEWProcs.h:1763` Creates a new XGroup object from its Cos representation. Call PDERelease() to dispose of the returned PDEXGroup object when finished with it. **Parameters** - `cosObjP` (`IN const CosObj *`): IN/OUT The XGroup object dictionary. **Returns:** [`PDEXGroup`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEXGroup) The PDEXGroup object. #### PDEXGroupGetCosObj ```cpp void PDEXGroupGetCosObj(IN PDEXGroup pdeXGroup, OUT CosObj *cosObjP) ``` Header: `PERProcs.h:1957` Gets the CosObj of the transparency group. **Parameters** - `pdeXGroup` (`IN PDEXGroup`): The transparency group object. - `cosObjP` (`OUT CosObj *`): (Filled by the method) A pointer to the Cos object. **Returns:** `void` **Exceptions** - `genErrBadParm` - `peErrWrongPDEObjectType` #### PDEXGroupGetIsolated ```cpp ASBool PDEXGroupGetIsolated(IN PDEXGroup pdeXGroup) ``` Header: `PERProcs.h:1978` Gets the isolated boolean value of the transparency group. **Parameters** - `pdeXGroup` (`IN PDEXGroup`): The transparency group object. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the transparency group is isolated; `false` otherwise. **Exceptions** - `peErrWrongPDEObjectType` #### PDEXGroupGetKnockout ```cpp ASBool PDEXGroupGetKnockout(IN PDEXGroup pdeXGroup) ``` Header: `PERProcs.h:1967` Gets the knockout boolean value of the transparency group. **Parameters** - `pdeXGroup` (`IN PDEXGroup`): The transparency group object. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) The knockout value. **Exceptions** - `peErrWrongPDEObjectType` #### PDEXGroupSetColorSpace ```cpp void PDEXGroupSetColorSpace(IN PDEXGroup pdeXGroup, IN PDEColorSpace pdeColorSpace) ``` Header: `PEWProcs.h:1804` Sets the PDEXObject that defines the color space into which colors are converted when painted into this group. **Parameters** - `pdeXGroup` (`IN PDEXGroup`): The transparency group object. - `pdeColorSpace` (`IN PDEColorSpace`): The color space to associate with the XGroup. **Returns:** `void` #### PDEXGroupSetIsolated ```cpp void PDEXGroupSetIsolated(IN PDEXGroup pdeXGroup, IN ASBool isolated) ``` Header: `PEWProcs.h:1794` Sets the XGroup to be isolated or not. It corresponds to the / I key within the XGroup's dictionary. **Parameters** - `pdeXGroup` (`IN PDEXGroup`): IN/OUT The transparency group object. - `isolated` (`IN ASBool`): IN/OUT `true` to isolate the XGroup, `false` otherwise. **Returns:** `void` #### PDEXGroupSetKnockout ```cpp void PDEXGroupSetKnockout(IN PDEXGroup pdeXGroup, IN ASBool knockout) ``` Header: `PEWProcs.h:1783` Sets the knockout value. **Parameters** - `pdeXGroup` (`IN PDEXGroup`): IN/OUT The transparency group object. - `knockout` (`IN ASBool`): IN/OUT The knockout value. **Returns:** `void` ### Structures (1) #### PDEXGroup ```cpp typedef struct _t_PDEXGroup* PDEXGroup ``` Header: `PEExpT.h:383` A transparency (XGroup) resource. **See also:** `PDEElement (superclass)`, [`PDEXGroupCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEXGroupCreate), [`PDEXGroupCreateFromCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEXGroupCreateFromCosObj), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease) ### Enums (1) #### PDEXGroupCreateFlags Header: `PEExpT.h:2075` An enumerated data type used to specify the type of transparency group to create. **Values** - `kPDEXGroupTypeTransparency = 0x0001`: Creates a transparency XGroup object. **See also:** [`PDESoftMaskCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDESoftMaskCreate) ## PDEXObject ### Functions (2) #### PDEXObjectCreate ```cpp PDEXObject PDEXObjectCreate(IN const CosObj *cosObjP) ``` Header: `PEWProcs.h:707` Creates a new PDEXObject from a Cos object. Call PDERelease() to dispose of the returned PDEXObject when finished with it. **Parameters** - `cosObjP` (`IN const CosObj *`): IN/OUT The Cos object for the PDEXObject. **Returns:** [`PDEXObject`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEXObject) A PDEXObject corresponding to `cosObjP`. **See also:** [`PDEXObjectGetCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEXObjectGetCosObj) #### PDEXObjectGetCosObj ```cpp void PDEXObjectGetCosObj(IN PDEXObject xObject, OUT CosObj *cosObjP) ``` Header: `PERProcs.h:983` Gets a Cos object corresponding to a PDEXObject. **Parameters** - `xObject` (`IN PDEXObject`): IN/OUT The PDEXobject whose Cos object is obtained. - `cosObjP` (`OUT CosObj *`): IN/OUT (Filled by the method) The Cos object for `xObject`. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDEXObjectCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEXObjectCreate) ### Structures (1) #### PDEXObject ```cpp typedef struct _t_PDEXObject* PDEXObject ``` Header: `PEExpT.h:217` A PDEElement representing an arbitrary XObject. **See also:** `PDEElement (superclass)`, [`PDEXObjectCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEXObjectCreate), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease) ## PDSysEncoding ### Functions (8) #### PDSysEncodingCreateFromBaseName ```cpp PDSysEncoding PDSysEncodingCreateFromBaseName(IN ASAtom baseEncName, IN const char **diffEnc) ``` Header: `PEWProcs.h:2086` Create an encoding object from the base name. Call PDERelease() to dispose of the returned PDSysEncoding object when finished with it. **Parameters** - `baseEncName` (`IN ASAtom`): IN/OUT The base encoding. See the description of Base Encoding in the Character Encoding section of the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.6.6, page 262. You can find this document on the web store of the International Standards Organization (ISO). - `diffEnc` (`IN const char **`): IN/OUT An array of 256 `const char*` describing the differences from the encoding specified by `baseEncName`. It may be `NULL`. **Returns:** [`PDSysEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysEncoding) An object of type PDSysEncoding. **Exceptions** - `genErrBadParm` **See also:** [`PDSysEncodingSetIsUTF16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysEncodingSetIsUTF16) #### PDSysEncodingCreateFromCMapName ```cpp PDSysEncoding PDSysEncodingCreateFromCMapName(IN ASAtom cmapName) ``` Header: `PEWProcs.h:2097` Create an encoding object from a PDF CMap name. Call PDERelease() to dispose of the returned PDSysEncoding object when finished with it. **Parameters** - `cmapName` (`IN ASAtom`): The CMap name. **Returns:** [`PDSysEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysEncoding) An object of type PDSysEncoding. **Exceptions** - `genErrBadParm` **See also:** [`PDSysEncodingSetIsUTF16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysEncodingSetIsUTF16) #### PDSysEncodingCreateFromCMapStream ```cpp PDSysEncoding PDSysEncodingCreateFromCMapStream(IN CosObj cmapStream) ``` Header: `PEWProcs.h:3225` Creates an encoding object from a given PDF CMap stream. Call `PDERelease()` to dispose of the returned `PDSysEncoding` object when it is no longer needed. **Parameters** - `cmapStream` (`IN CosObj`): The CMap stream from which to create the encoding object. **Returns:** [`PDSysEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysEncoding) The encoding object to be created. **See also:** [`PDSysEncodingSetIsUTF16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysEncodingSetIsUTF16) #### PDSysEncodingCreateFromCodePage ```cpp PDSysEncoding PDSysEncodingCreateFromCodePage(IN ASInt32 codePage, IN ASInt16 wMode) ``` Header: `PEWProcs.h:2350` Create an encoding object from a code page. Call PDERelease() to dispose of the returned PDSysEncoding object when finished with it. **Parameters** - `codePage` (`IN ASInt32`): The code page character-mapping construct. See Code Page Values. - `wMode` (`IN ASInt16`): `0` for horizontal writing, `1` for vertical writiing. **Returns:** [`PDSysEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysEncoding) An object of type PDSysEncoding. **Exceptions** - `genErrBadParm` **See also:** [`PDSysEncodingSetIsUTF16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysEncodingSetIsUTF16) #### PDSysEncodingGetWMode ```cpp ASInt16 PDSysEncodingGetWMode(IN PDSysEncoding sysEnc) ``` Header: `PERProcs.h:2261` Returns writing mode. `0` for horizontal writing and `1` for vertical writing. **Parameters** - `sysEnc` (`IN PDSysEncoding`): IN/OUT An object of type PDSysEncoding. **Returns:** [`ASInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16) `0` for horizontal writing and `1` for vertical writing. **Exceptions** - `peErrWrongPDEObjectType` #### PDSysEncodingIsIdentity ```cpp ASBool PDSysEncodingIsIdentity(IN PDSysEncoding sysEnc) ``` Header: `PERProcs.h:2272` Returns `true` for Identity-H or Identity-V encoding, `false` otherwise. **Parameters** - `sysEnc` (`IN PDSysEncoding`): IN/OUT An object of type PDSysEncoding. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) See above. **Exceptions** - `peErrWrongPDEObjectType` #### PDSysEncodingIsMultiByte ```cpp ASBool PDSysEncodingIsMultiByte(IN PDSysEncoding sysEnc) ``` Header: `PERProcs.h:2282` Returns `true` for CMap encoding, `false` otherwise. **Parameters** - `sysEnc` (`IN PDSysEncoding`): IN/OUT An object of type PDSysEncoding. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) See above. **Exceptions** - `peErrWrongPDEObjectType` #### PDSysEncodingSetIsUTF16 ```cpp void PDSysEncodingSetIsUTF16(IN PDSysEncoding sysEnc, IN ASBool isUTF16) ``` Header: `PEWProcs.h:3829` **Parameters** - `sysEnc` (`IN PDSysEncoding`): IN/OUT An object of type PDSysEncoding. - `isUTF16` (`IN ASBool`): A boolean value specifying if the encoding is UTF-16 **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` ### Structures (1) #### PDSysEncoding ```cpp typedef struct _t_PDSysEncoding* PDSysEncoding ``` Header: `PEExpT.h:399` A PDEElement that provides system encoding for a PDF file. **See also:** `PDEElement (superclass)`, [`PDSysEncodingCreateFromBaseName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysEncodingCreateFromBaseName), [`PDSysEncodingCreateFromCMapName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysEncodingCreateFromCMapName), [`PDERelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDERelease) ## PDSysFont ### Functions (18) #### PDEmbedSysFontForPDEFont ```cpp void PDEmbedSysFontForPDEFont(IN PDEFont font, IN ASUns32 flags, IN CosDoc cosDoc) ``` Header: `PDSysFont.h:330` If there is a font on the system that matches this PDEFont, embed the full font regardless of whether it was subsetted or not embedded at all in the first place. This will not work for CID fonts, because they must be subsetted. The matching is based on the PDSysFontMatchFlags. Only the font object itself is modified; no content streams are changed. **Note:** This method does not change the reference count of the font. **Parameters** - `font` (`IN PDEFont`): IN/OUT A PDEFont object returned from one of the `PDEFontCreate` methods. - `flags` (`IN ASUns32`): IN/OUT Flags from PDSysFontMatchFlags that determine matches. - `cosDoc` (`IN CosDoc`): IN/OUT Currently unused. **Returns:** `void` **Exceptions** - `peErrFontToEmbedNotOnSys`: is raised if there is no system font that matches this PDEFont. - `genErrBadParm`: is raised if the PDEFont is a CID font. - `peErrCantCreateFontSubset` - `peErrCantGetAttrs` - `peErrCantGetWidths` **See also:** [`PDEFontCreateFromSysFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFontCreateFromSysFont), [`PDFindSysFontForPDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDFindSysFontForPDEFont) #### PDEnumSysFonts ```cpp void PDEnumSysFonts(IN PDSysFontEnumProc enumProc, IN void *clientData) ``` Header: `PDSysFont.h:62` Enumerates all of the system fonts with a user-supplied procedure. The PDSysFont must be acquired during the enumeration if the font is needed beyond the `enumProc`. Developers should not assume that the `enumProc` will be called. If no system fonts are found (for example, if the `PSRESOURCEPATH` environment variable is not set on UNIX platforms), `enumProc` is never called, and PDEnumSysFonts() does not raise an exception. **Note:** The font names that are returned from the methods PDEnumSysFonts() and PDSysFontGetAttrs() are different in 5.0 and later (compared to 4.05). The differences are shown in the table: Acrobat 4.05 Name Acrobat 4.05 PSname Acrobat 5.0 (and later) Name Acrobat 5.0 (and later) Psname `MS-Mincho` `NULL` `MSMincho` `MS-Mincho` `MS-Gothic` `NULL` `MSGothic` `MS-Gothic` `MS-PMincho` `NULL` `MSPMincho` `MS-PMincho` `MS-PGothic` `NULL` `MSPGothic` `MS-PGothic` `MS-UIGothic` `NULL` `MSUIGothic` `MS-UIGothic` **Parameters** - `enumProc` (`IN PDSysFontEnumProc`): IN/OUT A user-supplied callback to call once for each system font. Enumeration continues until all fonts have been enumerated, or until `enumProc` returns `false`. - `clientData` (`IN void *`): IN/OUT A pointer to user-supplied data to pass to `enumProc` each time it is called. **Returns:** `void` **See also:** [`PDFindSysFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDFindSysFont), [`PDFindSysFontForPDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDFindSysFontForPDEFont) #### PDFindSysFont ```cpp PDSysFont PDFindSysFont(IN PDEFontAttrsP attrs, IN ASUns32 attrsSize, IN ASUns32 flags) ``` Header: `PDSysFont.h:80` Finds a system font that matches the requested attributes. The method gets the PDSysFont rather than acquires it, so do not call PDERelease() on the returned PDSysFont when done with it. **Parameters** - `attrs` (`IN PDEFontAttrsP`): IN/OUT A pointer to a `PDEFontAttrs` structure with the attributes of the font you are searching for. - `attrsSize` (`IN ASUns32`): IN/OUT The size of the `attrs` buffer in bytes. - `flags` (`IN ASUns32`): IN/OUT Flags from PDSysFontMatchFlags. **Returns:** `PDSysFont` The desired system font. **See also:** [`PDEnumSysFonts`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEnumSysFonts), [`PDFindSysFontForPDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDFindSysFontForPDEFont), [`PDFindSysFontEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDFindSysFontEx) #### PDFindSysFontEx ```cpp PDSysFont PDFindSysFontEx(IN PDEFontAttrsP attrs, IN ASUns32 attrsSize, IN ASUns32 flags, OUT ASFixed *mmDesignVector, OUT ASInt32 *designVecLength) ``` Header: `PDSysFont.h:109` Finds a system font that matches the requested attributes. If the requested font is a multiple master font instance, the base font is returned, and the specified design vector is decoded and returned in mmDesignVector. The method gets the PDSysFont rather than acquires it, so do not call PDERelease() on the returned PDSysFont when done with it. **Parameters** - `attrs` (`IN PDEFontAttrsP`): IN/OUT A pointer to a `PDEFontAttrs` structure with the attributes of the font you are searching for. - `attrsSize` (`IN ASUns32`): IN/OUT The size of the `attrs` buffer in bytes. - `flags` (`IN ASUns32`): IN/OUT Flags from PDSysFontMatchFlags. - `mmDesignVector` (`OUT ASFixed *`): IN/OUT (Filled by the method) If the requested font is a Multiple Master font instance, the specified design vector is decoded and returned in `mmDesignVector`. - `designVecLength` (`OUT ASInt32 *`): IN/OUT (Filled by the method) Pass the length of `mmDesignVector`. This parameter also returns the number of elements filled in `mmDesignVector` (the maximum is `4`). **Returns:** `PDSysFont` The desired system font. **See also:** [`PDEnumSysFonts`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEnumSysFonts), [`PDFindSysFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDFindSysFont), [`PDFindSysFontForPDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDFindSysFontForPDEFont) #### PDFindSysFontForPDEFont ```cpp PDSysFont PDFindSysFontForPDEFont(IN PDEFont font, IN ASUns32 flags) ``` Header: `PDSysFont.h:135` Finds a system font that matches the requested PDEFont. The method gets the PDSysFont rather than acquires it, so do not call PDERelease() on the returned PDSysFont when done with it. **Parameters** - `font` (`IN PDEFont`): IN/OUT A PDEFont whose matching system font is found. - `flags` (`IN ASUns32`): IN/OUT A bit field comprised of PDSysFontMatchFlags values. • kPDSysFontMatchNameAndCharSet • kPDSysFontMatchFontType • PDSysFontMatchFlags Passing zero matches `font` by name only. **Returns:** `PDSysFont` The system font corresponding to `font`. **Exceptions** - `peErrCantGetAttrs` - `genErrBadParm` - `genErrResourceLoadFailed` **See also:** [`PDFindSysFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDFindSysFont) #### PDSysFontAcquirePlatformData ```cpp PDSysFontPlatDataP PDSysFontAcquirePlatformData(IN PDSysFont sysFont) ``` Header: `PDSysFont.h:280` Acquires platform-specific data for use by user interface code. It must be released when finished by PDSysFontReleasePlatformData(). **Parameters** - `sysFont` (`IN PDSysFont`): IN/OUT A PDSysFont object referencing a system font returned by either PDFindSysFont() or PDFindSysFontForPDEFont(). **Returns:** `PDSysFontPlatDataP` A pointer to a platform-dependent structure, `PDSysFontPlatData`, containing information relating to a system font. It returns `NULL` if it is out of memory. **See also:** [`PDSysFontReleasePlatformData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontReleasePlatformData) #### PDSysFontGetAttrs ```cpp void PDSysFontGetAttrs(IN PDSysFont sysFont, OUT PDEFontAttrsP attrsP, IN ASUns32 attrsSize) ``` Header: `PDSysFont.h:173` Gets the attributes of a system font. The attributes will be returned in the buffer pointed to by `attrsP`. No more than `attrsSize` bytes will be written to the buffer. This call can be expensive to execute, as it may involve parsing the font in order to determine attributes. **Note:** The font names that are returned from the methods PDEnumSysFonts() and PDSysFontGetAttrs() are different in 5.0 and later (compared to 4.05). The differences are shown in the table: Acrobat 4.05 Name Acrobat 4.05 PSname Acrobat 5.0 (and later) Name Acrobat 5.0 (and later) Psname `MS-Mincho` `NULL` `MSMincho` `MS-Mincho` `MS-Gothic` `NULL` `MSGothic` `MS-Gothic` `MS-PMincho` `NULL` `MSPMincho` `MS-PMincho` `MS-PGothic` `NULL` `MSPGothic` `MS-PGothic` `MS-UIGothic` `NULL` `MSUIGothic` `MS-UIGothic` **Parameters** - `sysFont` (`IN PDSysFont`): IN/OUT A PDSysFont object referencing a system font whose attributes are obtained. - `attrsP` (`OUT PDEFontAttrsP`): IN/OUT (Filled by the method) A pointer to a `PDEFontAttrs` structure with the attributes of a system font. - `attrsSize` (`IN ASUns32`): IN/OUT The size of the `attrsP` buffer in bytes. **Returns:** `void` **Exceptions** - `peErrCantGetAttrs` **See also:** [`PDSysFontGetEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetEncoding), [`PDSysFontGetInfo`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetInfo), [`PDSysFontGetName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetName), [`PDSysFontGetType0Widths`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetType0Widths) #### PDSysFontGetCIDSystemInfo ```cpp void PDSysFontGetCIDSystemInfo(IN PDSysFont sysFont, OUT ASAtom *registry, OUT ASAtom *ordering, OUT ASInt32 *supplement) ``` Header: `PDSysFont.h:350` Derives the registry, ordering, and supplement information of a multi-byte system font. This information can be used to create a PDEFont from a system font. For more information on CID fonts, see PDFontGetCIDSystemInfo(). **Parameters** - `sysFont` (`IN PDSysFont`): IN/OUT A PDSysFont object referencing a multi-byte system font. - `registry` (`OUT ASAtom *`): IN/OUT (Filled by the method) The ASAtom representing the CIDFont's Registry information (for example, `"Adobe"`). - `ordering` (`OUT ASAtom *`): IN/OUT (Filled by the method) The ASAtom representing the CIDFont's Ordering information (for example, `"Japan1"`). - `supplement` (`OUT ASInt32 *`): IN/OUT (Filled by the method) The `SystemSupplement` field from the CIDFont. **Returns:** `void` **See also:** [`PDFontGetCIDSystemInfo`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontGetCIDSystemInfo), [`PDFontGetCIDSystemSupplement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontGetCIDSystemSupplement) #### PDSysFontGetCreateFlags ```cpp ASInt32 PDSysFontGetCreateFlags(IN PDSysFont sysFont, IN PDSysEncoding sysEnc) ``` Header: `PEWProcs.h:2118` This function returns a `createFlags` that can be passed to PDEFontCreateFromSysFontAndEncoding(). If the combination of sysFont and sysEnc is not allowed, `-1` is returned. The returned flags describe what this combination of font and encoding *requires*, not what the font's licence *permits*: `kPDEFontCreateEmbedded` may be reported for a font whose `PDEFontAttrs` report `cantEmbed`. Use PDSysFontGetAttrs() to learn what the font permits. **Parameters** - `sysFont` (`IN PDSysFont`): IN/OUT An object of type PDSysFont. - `sysEnc` (`IN PDSysEncoding`): IN/OUT An object of type PDSysEncoding. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) See above. **Exceptions** - `peErrWrongPDEObjectType` **See also:** [`PDSysFontGetAttrs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetAttrs) #### PDSysFontGetEncoding ```cpp Uns8 ** PDSysFontGetEncoding(IN PDSysFont sysFont, OUT ASAtom *encodingNameP) ``` Header: `PDSysFont.h:235` Gets the encoding of a single byte encoded system font. The returned encoding must be freed via a call to ASfree(). If the return value is zero, encodingNameP contains the name of the encoding: • For a Type 1 font, the default encoding is that specified by the Encoding value in the font dictionary. • For a TrueType font, the default encoding is that specified in the single byte CMAP table. **Parameters** - `sysFont` (`IN PDSysFont`): IN/OUT A PDSysFont object referencing a system font whose encoding is obtained. - `encodingNameP` (`OUT ASAtom *`): IN/OUT (Filled by the method) An encoding name if the return value of PDSysFontGetEncoding() is zero. If `encodingNameP` is the `NULL` ASAtom, the font uses its default encoding. **Returns:** `Uns8 **` An encoding array of 256 C strings. Each entry in the array either contains a glyph name or `NULL`. If it is `NULL`, the corresponding entry uses the font's built in encoding value. **See also:** [`PDSysFontAcquirePlatformData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontAcquirePlatformData), [`PDSysFontGetInfo`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetInfo), [`PDSysFontGetName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetName), [`PDSysFontGetType0Widths`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetType0Widths) #### PDSysFontGetInfo ```cpp void PDSysFontGetInfo(IN PDSysFont sysFont, OUT PDEFontInfoP infoP, IN ASUns32 infoSize) ``` Header: `PDSysFont.h:251` Gets high-level information about a system font. **Parameters** - `sysFont` (`IN PDSysFont`): IN/OUT A PDSysFont object referencing a system font whose information is obtained. - `infoP` (`OUT PDEFontInfoP`): IN/OUT (Filled by the method) A pointer to `PDEFontInfoRec` structure to fill with font information for `sysFont`. No more than `infoSize` bytes are written to this buffer. - `infoSize` (`IN ASUns32`): IN/OUT The size of the `infoP` buffer in bytes. **Returns:** `void` **See also:** [`PDSysFontAcquirePlatformData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontAcquirePlatformData), [`PDSysFontGetEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetEncoding), [`PDSysFontGetName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetName), [`PDSysFontGetType0Widths`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetType0Widths) #### PDSysFontGetName ```cpp ASAtom PDSysFontGetName(IN PDSysFont sysFont) ``` Header: `PDSysFont.h:265` Gets the PostScript or TrueType styled name for a system font. **Parameters** - `sysFont` (`IN PDSysFont`): IN/OUT A PDSysFont object referencing a system font whose name is obtained. **Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom) The ASAtom for the system font's name. **See also:** [`PDSysFontAcquirePlatformData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontAcquirePlatformData), [`PDSysFontGetEncoding`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetEncoding), [`PDSysFontGetInfo`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetInfo), [`PDSysFontGetType0Widths`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetType0Widths) #### PDSysFontGetScript ```cpp PDScript PDSysFontGetScript(IN PDSysFont sysFont) ``` Header: `PDSysFont.h:299` Returns a PDScript value for the specified PDSysFont. **Parameters** - `sysFont` (`IN PDSysFont`): The font from which to acquire the script. **Returns:** `PDScript` #### PDSysFontGetType0Widths ```cpp void PDSysFontGetType0Widths(IN PDSysFont sysFont, IN ASAtom ordering, OUT ASBool *hasDW, OUT ASInt32 *dw, OUT CosObj *w, OUT ASBool *hasDW2, OUT ASInt32 *dw2, OUT CosObj *w2) ``` Header: `PDSysFont.h:409` Gets width information from a Type 0 system font. This information can be used to create a PDEFont from a system font. You can find this document on the web store of the International Standards Organization (ISO). You can find this document on the web store of the International Standards Organization (ISO). You can find this document on the web store of the International Standards Organization (ISO). You can find this document on the web store of the International Standards Organization (ISO). **Note:** In general, you are discouraged from using this method. Instead use PDEFontCreateFromSysFontAndEncoding() followed by PDEFontCreateWidthsNow() to create the W entry in a font. **Parameters** - `sysFont` (`IN PDSysFont`): IN/OUT A PDSysFont object referencing a multibyte system font. - `ordering` (`IN ASAtom`): IN/OUT An ASAtom representing the CIDFont's Ordering information. It is used to get a CMap object for `sysFont`. - `hasDW` (`OUT ASBool *`): IN/OUT (Filled by the method) `true` if `sysFont` has a valid `dw` value; `false` otherwise. - `dw` (`OUT ASInt32 *`): IN/OUT (Filled by the method) The default width for glyphs in a CIDFont. Currently, it is always `1000`. See the description of CIDFontType 0 in "Composite Fonts" in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7, page 267. - `w` (`OUT CosObj *`): IN/OUT (Filled by the method) A Cos array of a set of lists that define the widths for the glyphs in the CIDFont. Each list can specify individual widths for consecutive CIDs, or one width for a range of CIDs. For information on the format of this array, see the description of CID Fonts in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7.4, page 269. - `hasDW2` (`OUT ASBool *`): IN/OUT (Filled by the method) `true` if `sysFont` has a valid `dw2` value. The default is `false`. - `dw2` (`OUT ASInt32 *`): IN/OUT (Filled by the method) The default metrics for writing mode 1. This entry is an array of two ASInt32 numbers: the y component of the position vector and the y component of the displacement vector for writing mode 1. The x component of the position vector is always half the width of the character. The x component of the displacement vector is always `0`. The default value is `[880-1000]`. For information on writing mode 1, see the description of CID Fonts in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7.4, page 269. - `w2` (`OUT CosObj *`): IN/OUT (Filled by the method) A Cos array defining the metrics for vertical writing. Its format is similar to the format of the array in `w`. It defines the x and y components of the position vector, and the y component of the displacement vector. The x component of the displacement vector is always `0`. For information on the format of this array, see the description of CID Fonts in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.7.4, page 269. **Returns:** `void` **See also:** [`PDSysFontGetWidths`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetWidths), [`PDSysFontGetWidthsEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetWidthsEx), [`PDFontGetWidths`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontGetWidths) #### PDSysFontGetWidths ```cpp void PDSysFontGetWidths(IN PDSysFont sysFont, OUT ASInt16 *widthsP) ``` Header: `PDSysFont.h:187` Gets the widths of a single byte encoded system font. **Parameters** - `sysFont` (`IN PDSysFont`): IN/OUT A PDSysFont object referencing a system font whose widths are obtained. - `widthsP` (`OUT ASInt16 *`): IN/OUT (Filled by the method) A pointer to the widths array. `widthsP` must have room for 256 entries. **Returns:** `void` **Exceptions** - `peErrCantGetWidths` **See also:** [`PDSysFontGetType0Widths`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetType0Widths), [`PDSysFontGetWidthsEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetWidthsEx), [`PDFontGetWidths`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontGetWidths) #### PDSysFontGetWidthsEx ```cpp void PDSysFontGetWidthsEx(IN PDSysFont sysFont, OUT ASInt16 *widthsP, IN ASFixed *mmDesignVector) ``` Header: `PDSysFont.h:204` Gets the widths of a single byte encoded system font. **Parameters** - `sysFont` (`IN PDSysFont`): IN/OUT A PDSysFont object referencing a system font whose widths are obtained. - `widthsP` (`OUT ASInt16 *`): IN/OUT (Filled by the method) A pointer to the widths array. `widthsP` must have room for 256 entries. - `mmDesignVector` (`IN ASFixed *`): IN/OUT If `sysFont` is a multiple master font, it points to the design vector, whose length must equal the number of design axes of `sysFont`. **Returns:** `void` **Exceptions** - `peErrCantGetWidths` **See also:** [`PDSysFontGetType0Widths`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetType0Widths), [`PDSysFontGetWidths`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDSysFontGetWidths), [`PDFontGetWidths`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontGetWidths) #### PDSysFontReleasePlatformData ```cpp void PDSysFontReleasePlatformData(IN PDSysFontPlatDataP platDataP) ``` Header: `PDSysFont.h:291` Releases platform-specific data for the specified PDSysFont. **Parameters** - `platDataP` (`IN PDSysFontPlatDataP`): IN/OUT A pointer to a PDSysFontPlatDataP structure containing platform-specific data. **Returns:** `void` **See also:** `PDSysFontAcquirePlatformData Creates a new attribute object with the specified owner.` #### PDSysFontVerifyEncoding ```cpp ASInt32 PDSysFontVerifyEncoding(IN PDSysFont sysFont, IN PDSysEncoding sysEnc) ``` Header: `PEWProcs.h:2133` Similar to PDSysFontGetCreateFlags but avoids compatibility issues with changing PDSysFontGetCreateFlags. If the combination of sysFont and sysEnc is not allowed, `-1` is returned. If the combination is ok, then `0` is returned. If the combination only works if the font is embedded, kPDEFontCreateEmbedded is returned. **Parameters** - `sysFont` (`IN PDSysFont`): IN/OUT An object of type PDSysFont. - `sysEnc` (`IN PDSysEncoding`): IN/OUT An object of type PDSysEncoding. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) See above. **Exceptions** - `peErrWrongPDEObjectType` ### Enums (1) #### PDSysFontPackageType Header: `PEExpT.h:2048` **Values** - `kPDSysFontUnknown = 0` - `kPDSysFontType1 = 1` - `kPDSysFontTrueType = 2` - `kPDSysFontCID = 3` - `kPDSysFontATC = 4` - `kPDSysFontOCF = 5` - `kPDSysFontOpenTypeCFF = 6` - `kPDSysFontOpenTypeCID = 7` - `kPDSysFontOpenTypeTT = 8` --- # PDSEdit Layer Source: https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer ## General ### Typedefs (1) #### PDSOBJR ```cpp typedef CosObj PDSOBJR ``` Header: `PDSExpT.h:122` PDSOBJR ### Enums (1) #### PDSType Header: `PDSExpT.h:164` PDS object types. **Values** - `kPDSElement = 0` - `kPDSAttrObj = 1` - `kPDSMCR = 2` - `kPDSMC = 3` - `kPDSRoleMap = 4` - `kPDSClassMap = 5` - `kPDSLastType = 6` ### Definitions (20) #### IN Header: `PDSExpT.h:46` #### OUT Header: `PDSExpT.h:47` #### PDSRead_VERSION_2 Header: `PDSReadCalls.h:93` Value: `0x00020000` #### PDSRead_VERSION_5 Header: `PDSReadCalls.h:94` Value: `0x00050000` #### PDSRead_VERSION_6 Header: `PDSReadCalls.h:95` Value: `0x00060000` #### PDSRead_VERSION_7 Header: `PDSReadCalls.h:96` Value: `0x00070000` #### PDSRead_VERSION_8 Header: `PDSReadCalls.h:97` Value: `0x00080000` #### PDSWrite_VERSION_5 Header: `PDSWriteCalls.h:95` Value: `0x00050000` #### PDSWrite_VERSION_6 Header: `PDSWriteCalls.h:96` Value: `0x00060000` #### PDSWrite_VERSION_7 Header: `PDSWriteCalls.h:97` Value: `0x00070000` #### PDSWrite_VERSION_8 Header: `PDSWriteCalls.h:98` Value: `0x00080000` #### PDSWrite_VERSION_B Header: `PDSWriteCalls.h:94` Value: `0x00000006` #### _PDSRead_IS_BETA Header: `PDSReadCalls.h:87` Value: `0` #### _PDSRead_LAST_BETA_COMPATIBLE_VERSION Header: `PDSReadCalls.h:86` Value: `0x00080000` #### _PDSRead_LATEST_VERSION Header: `PDSReadCalls.h:85` Value: `0x00080000` #### _PDSWrite_IS_BETA Header: `PDSWriteCalls.h:88` Value: `0` #### _PDSWrite_LAST_BETA_COMPATIBLE_VERSION Header: `PDSWriteCalls.h:87` Value: `0x00080000` #### _PDSWrite_LATEST_VERSION Header: `PDSWriteCalls.h:86` Value: `0x00080000` #### kPDSAfterLast Header: `PDSExpT.h:215` Value: `(ASMAXInt32 - 1)` #### kPDSBeforeFirst Header: `PDSExpT.h:214` Value: `((ASInt32)-1)` ## PDSAttrObj ### Functions (4) #### PDSAttrObjCreate ```cpp void PDSAttrObjCreate(IN PDDoc pdDoc, IN ASAtom owner, IN ASBool indirect, OUT PDSAttrObj *attrObj) ``` Header: `PDSWriteProcs.h:582` Creates a new attribute object with the specified owner. This may raise various exceptions. **Parameters** - `pdDoc` (`IN PDDoc`): The document in which the attribute object is created. - `owner` (`IN ASAtom`): The owner of the new attribute object. - `indirect` (`IN ASBool`): If `true`, it creates the attribute object as an indirect Cos object and sets the `pdDoc` parameter's PDDocNeedsSave flag (see PDDocFlags). If `false`, it creates the attribute object as a direct object. - `attrObj` (`OUT PDSAttrObj *`): (Filled by the method) The newly created attribute object. **Returns:** `void` **See also:** [`PDSAttrObjCreateFromStream`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSAttrObjCreateFromStream) #### PDSAttrObjCreateFromStream ```cpp void PDSAttrObjCreateFromStream(IN ASAtom owner, IN OUT CosObj cosStreamObj, OUT PDSAttrObj *attrObj) ``` Header: `PDSWriteProcs.h:598` Creates an attribute object with the specified owner from the specified Cos stream. **Parameters** - `owner` (`IN ASAtom`): The owner of the new attribute object. - `cosStreamObj` (`IN OUT CosObj`): The Cos stream containing the data with which to create the attribute. The dictionary of this stream is modified. - `attrObj` (`OUT PDSAttrObj *`): (Filled by the method) A pointer to the newly created attribute object. This actually points to `cosStreamObj`. May be `NULL`. **Returns:** `void` **Exceptions** - `pdsErrWrongTypeParameter`: is raised if `cosStreamObj` is not a Cos stream. It may raise other exceptions as well. **See also:** [`PDSAttrObjCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSAttrObjCreate) #### PDSAttrObjGetCosObj ```cpp CosObj PDSAttrObjGetCosObj(PDSAttrObj attrObj) ``` Header: `PDSReadProcs.h:810` Gets the Cos object corresponding to the specified attribute object. This method does not copy the object, but is instead the logical equivalent of a type cast. **Parameters** - `attrObj` ([`PDSAttrObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSAttrObj)): The attribute object whose Cos object is obtained. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) The dictionary Cos object for the attribute object. #### PDSAttrObjGetOwner ```cpp ASAtom PDSAttrObjGetOwner(IN PDSAttrObj element) ``` Header: `PDSReadProcs.h:477` Gets the value of the key (Owner) in the specified attribute object. This may throw various exceptions. **Parameters** - `element` (`IN PDSAttrObj`): The attribute object whose owner is obtained. **Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom) The ASAtom for the owner's name. **See also:** [`PDSAttrObjCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSAttrObjCreate) ### Typedefs (1) #### PDSAttrObj ```cpp typedef CosObj PDSAttrObj ``` Header: `PDSExpT.h:104` Represents PDF logical structure attribute objects, which are dictionaries containing application-specific data that can be attached to PDSElement objects. **See also:** [`PDSAttrObjCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSAttrObjCreate), [`PDSAttrObjCreateFromStream`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSAttrObjCreateFromStream), [`PDSClassMapGetAttrObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSClassMapGetAttrObj), [`PDSElementGetAttrObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetAttrObj), [`PDSElementRemoveAttrObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementRemoveAttrObj) ## PDSClassMap ### Functions (5) #### PDSClassMapAddAttrObj ```cpp void PDSClassMapAddAttrObj(IN PDSClassMap classMap, IN ASAtom classAtom, IN PDSAttrObj attrObj) ``` Header: `PDSWriteProcs.h:682` Adds the specified attribute object to the specified PDSClassMap for the given class name. If the attribute object is already present, it is not added a second time. **Parameters** - `classMap` (`IN PDSClassMap`): The PDSClassMap to which the specified attribute object is added. - `classAtom` (`IN ASAtom`): The ASAtom representing the class name. - `attrObj` (`IN PDSAttrObj`): The attribute object to add to the class in `classAtom`. **Returns:** `void` **Exceptions** - `pdsErrBadPDF`: is raised if an error is found in the PDF file. **See also:** [`PDSClassMapGetAttrObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSClassMapGetAttrObj), [`PDSClassMapRemoveAttrObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSClassMapRemoveAttrObj) #### PDSClassMapGetAttrObj ```cpp void PDSClassMapGetAttrObj(IN PDSClassMap classMap, IN ASAtom classAtom, IN ASInt32 index, OUT PDSAttrObj *attrObj) ``` Header: `PDSReadProcs.h:593` Gets the attribute object associated with the specified class name at an index in the class. If there is only one object and index is zero, that object is retrieved. This may throw various exceptions. **Parameters** - `classMap` (`IN PDSClassMap`): The PDSClassMap. - `classAtom` (`IN ASAtom`): The ASAtom of a class name for which an associated attribute objects is found. - `index` (`IN ASInt32`): The index of the desired attribute object in the class. - `attrObj` (`OUT PDSAttrObj *`): (Filled by the method) The attribute object at `index`. Set it to CosNull if there is no attribute object at the specified location. **Returns:** `void` **See also:** [`PDSClassMapAddAttrObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSClassMapAddAttrObj), [`PDSClassMapGetNumAttrObjs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSClassMapGetNumAttrObjs) #### PDSClassMapGetNumAttrObjs ```cpp ASInt32 PDSClassMapGetNumAttrObjs(IN PDSClassMap classMap, IN ASAtom classAtom) ``` Header: `PDSReadProcs.h:570` Gets the number of attribute objects associated with a class name. This may throw various exceptions. **Parameters** - `classMap` (`IN PDSClassMap`): IN/OUT The PDSClassMap. - `classAtom` (`IN ASAtom`): IN/OUT The ASAtom of a class name for which the number of associated attribute objects is found. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The number of attribute objects associated with the class in `classAtom`. **See also:** [`PDSClassMapGetAttrObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSClassMapGetAttrObj) #### PDSClassMapRemoveAttrObj ```cpp void PDSClassMapRemoveAttrObj(IN PDSClassMap classMap, IN ASAtom classAtom, IN PDSAttrObj attrObj) ``` Header: `PDSWriteProcs.h:714` Removes the specified attribute object from the specified PDSClassMap. If classAtom is ASAtomNull, it removes all occurrences of `attrObj` in the entire `classMap`. **Parameters** - `classMap` (`IN PDSClassMap`): The PDSClassMap from which the specified attribute object is removed. - `classAtom` (`IN ASAtom`): The ASAtom of a class name for which the associated attribute object is found. - `attrObj` (`IN PDSAttrObj`): The attribute object to remove from `classMap`. **Returns:** `void` **Exceptions** - `pdsErrBadPDF`: is raised if an error is found in the PDF file. **See also:** [`PDSClassMapAddAttrObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSClassMapAddAttrObj), [`PDSClassMapRemoveClass`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSClassMapRemoveClass) #### PDSClassMapRemoveClass ```cpp void PDSClassMapRemoveClass(IN PDSClassMap classMap, IN ASAtom classAtom) ``` Header: `PDSWriteProcs.h:697` Removes the specified class from the specified PDSClassMap, if it exists. This may raise various exceptions. **Parameters** - `classMap` (`IN PDSClassMap`): IN/OUT The PDSClassMap from which a class is removed. - `classAtom` (`IN ASAtom`): IN/OUT The ASAtom representing the class to remove from `classMap`. **Returns:** `void` **See also:** [`PDSClassMapRemoveAttrObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSClassMapRemoveAttrObj) ### Typedefs (1) #### PDSClassMap ```cpp typedef CosObj PDSClassMap ``` Header: `PDSExpT.h:139` Associates class identifiers, which are names, with objects of type PDSAttrObj. Structural elements maintain a list of names identifying classes to which they belong. The associated attributes are thus shared by all structural elements belonging to a given class. There is one class map per document, associated with the PDSTreeRoot. **Note:** The write functions in the `PDSEdit` API are not available in Adobe Reader. ## PDSElement ### Functions (64) #### PDDocEnumPDSElementsWithUserProperties ```cpp ASBool PDDocEnumPDSElementsWithUserProperties(PDDoc doc, EnumElementsWithUserPropertiesProc proc, void *clientData) ``` Header: `PDSReadProcs.h:841` Enumerates the elements in the document's structure tree that have UserProperties attributes or classes, calling the supplied enumeration procedure for each such element found. The procedure returns `true` to continue enumeration, or `false` to halt enumeration. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The PDDoc whose structure elements are to be enumerated. - `proc` ([`EnumElementsWithUserPropertiesProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#EnumElementsWithUserPropertiesProc)): The procedure to call for each PDSElement found to have UserProperties. - `clientData` (`void *`): Client-supplied data to be passed to the client callback. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the enumeration completes, `false` if the enumeration callback returns `false`. #### PDDocHasUserProperties ```cpp ASBool PDDocHasUserProperties(PDDoc doc) ``` Header: `PDSReadProcs.h:825` Returns `true` if the document declares that it has structure elements that conform to the UserProperties attributes or class conventions. This is based on both the presence of StructTreeRoot, and a value of `"true"` for the UserProperties key in the document's MarkInfo dictionary. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The PDDoc to be examined. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) An ASBool indicating whether the document declares that it has structure elements with UserProperties attributes or classes. #### PDSElementAddAttrObj ```cpp void PDSElementAddAttrObj(IN PDSElement element, IN PDSAttrObj attrObj) ``` Header: `PDSWriteProcs.h:258` Associates the specified attribute object with an element at the element's current revision value. This may raise various exceptions. **Parameters** - `element` (`IN PDSElement`): The element with which `attrObj` is associated. - `attrObj` (`IN PDSAttrObj`): The attribute object to associate with `element`. **Returns:** `void` **See also:** [`PDSElementGetAttrObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetAttrObj), [`PDSElementRemoveAttrObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementRemoveAttrObj) #### PDSElementAddClass ```cpp void PDSElementAddClass(IN PDSElement element, IN ASAtom classAtom) ``` Header: `PDSWriteProcs.h:311` Adds a class name to the element's list of classes to which it belongs at the element's current revision value. This may raise various exceptions. **Parameters** - `element` (`IN PDSElement`): IN/OUT The element to which a class is added. - `classAtom` (`IN ASAtom`): IN/OUT The ASAtom representing the class to add to `element`. If `classAtom` is already present among the `element` parameter's classes, it will not be added again. **Returns:** `void` **See also:** [`PDSElementGetClass`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetClass), [`PDSElementGetNumClasses`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetNumClasses), [`PDSElementRemoveAllClasses`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementRemoveAllClasses), [`PDSElementRemoveClass`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementRemoveClass) #### PDSElementClearID ```cpp void PDSElementClearID(IN PDSElement element) ``` Header: `PDSWriteProcs.h:558` Removes an element's ID, if it exists. **Parameters** - `element` (`IN PDSElement`): The element whose ID is removed. **Returns:** `void` **Exceptions** - `pdsErrWrongTypeParameter`: is raised if `element` is not a valid PDSElement. - `pdsErrBadPDF`: is raised if an error is found in the PDF file. **See also:** [`PDSElementGetID`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetID), [`PDSElementSetID`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementSetID) #### PDSElementCreate ```cpp void PDSElementCreate(IN PDDoc pdDoc, OUT PDSElement *element) ``` Header: `PDSWriteProcs.h:200` Creates a new (but empty) PDSElement. This may raise various exceptions. **Parameters** - `pdDoc` (`IN PDDoc`): The PDDoc in which the PDSElement is created. - `element` (`OUT PDSElement *`): (Filled by the method) The newly created PDSElement. **Returns:** `void` #### PDSElementEnumKidsWithUserProperties ```cpp ASBool PDSElementEnumKidsWithUserProperties(PDSElement elem, EnumElementsWithUserPropertiesProc proc, void *clientData) ``` Header: `PDSReadProcs.h:933` Enumerates PDSElement objects, beneath the supplied PDSElement, that have user properties attributes/classes. The elements in a structure tree that have user properties form a virtual tree themselves; this procedure enumerates the children of the given structure element in this virtual tree. In other words, this procedure enumerates all the descendents(`d`) of the supplied structure element(`e`) such that `PDSElementFindAncestorWithUserProperties(d)` would return (`e`). The enumeration continues as long as the callback returns `true`, and halts when the proc returns `false` or all virtual children have been enumerated. **Parameters** - `elem` ([`PDSElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElement)): The PDSElement below which to search for elements with user properties. - `proc` ([`EnumElementsWithUserPropertiesProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#EnumElementsWithUserPropertiesProc)): The client-supplied callback to call for each element found. - `clientData` (`void *`): Client-supplied data to be passed to the client callback. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the enumeration completes, `false` if the enumeration callback returns `false`. **See also:** [`PDSElementFindAncestorWithUserProperties`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementFindAncestorWithUserProperties) #### PDSElementEnumUserPropertiesAsASText ```cpp ASBool PDSElementEnumUserPropertiesAsASText(PDSElement elem, PDSElementEnumUserPropertiesAsASTextProc proc, void *clientData, ASBool includeHidden) ``` Header: `PDSReadProcs.h:872` Enumerates the PDSElement object's user properties by traversing the list of attribute objects and class objects, calling the caller-supplied procedure for each entry in the properties array. The enumeration proc receives the property information as a pair of ASText objects, for the property name and the property value. The enumeration continues as long as the callback returns `true`, and halts when the proc returns `false` or all properties have been enumerated. **Parameters** - `elem` ([`PDSElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElement)): The PDSElement whose user properties will be enumerated. - `proc` ([`PDSElementEnumUserPropertiesAsASTextProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementEnumUserPropertiesAsASTextProc)): The callback that is called for each user property item. - `clientData` (`void *`): Client-supplied data to be passed to the client callback. - `includeHidden` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): A boolean value indicating whether the client wants to be given property items that are marked as hidden. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the enumeration completes, `false` if the enumeration callback returns `false`. **See also:** [`PDSElementEnumUserPropertiesAsCosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementEnumUserPropertiesAsCosObj) #### PDSElementEnumUserPropertiesAsCosObj ```cpp ASBool PDSElementEnumUserPropertiesAsCosObj(PDSElement elem, PDSElementEnumUserPropertiesAsCosObjProc proc, void *clientData, ASBool includeHidden) ``` Header: `PDSReadProcs.h:895` Enumerates the PDSElement object's user properties by traversing the list of attribute objects and class objects, calling the caller-supplied procedure for each entry in the properties array. The enumeration proc receives the property information as a Cos Dictionary. See the description of objects in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.3, page 13. You can find this document on the web store of the International Standards Organization (ISO). The enumeration continues as long as the callback returns `true`, and halts when the proc returns `false` or all properties have been enumerated. **Parameters** - `elem` ([`PDSElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElement)): The PDSElement whose user properties will be enumerated. - `proc` ([`PDSElementEnumUserPropertiesAsCosObjProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementEnumUserPropertiesAsCosObjProc)): The callback that is called for each user property item. - `clientData` (`void *`): Client-supplied data to be passed to the client callback. - `includeHidden` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): A boolean value indicating whether the client wants to be given property items that are marked as hidden. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the enumeration completes, `false` if the enumeration callback returns `false`. **See also:** [`PDSElementEnumUserPropertiesAsASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementEnumUserPropertiesAsASText) #### PDSElementExportUserProperties ```cpp ASErrorCode PDSElementExportUserProperties(PDSElement userPropsElement, ASBool wholeSubtree, ASBool includeHidden, ASBool flattenClasses, PDUserPropertiesXMLLabels xmlLabels, ASStm output) ``` Header: `PDSReadProcs.h:1009` Exports user properties of the specified PDSElement in XML. **Parameters** - `userPropsElement` ([`PDSElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElement)): The element whose user properties are to be exported in XML format. - `wholeSubtree` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): A boolean value indicating whether to export user properties of the whole structure tree which contains `userPropsElement`, or just the subtree which starts from `userPropsElement`. - `includeHidden` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): A boolean value indicating whether the client wants to be given property items that are marked as hidden. - `flattenClasses` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): A boolean value indicating whether to flatten the attribute classes for each structure element. If `true`, the user properties for that class will be listed as properties for that stucture element. If `false`, the class will be listed for that structure element, and a list of classes and their properties will be listed near the end of the XML. - `xmlLabels` (`PDUserPropertiesXMLLabels`): The XML tag/label information for exporting user properties. These labels are output as is. There is no XML escaping done. It is the caller's responsibility to make sure they conform to the XML standard. - `output` ([`ASStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStm)): The output stream to which user properties are written. The encoding of the characters is UTF-8. **Returns:** [`ASErrorCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASErrorCode) An ASErrorCode to indicate the success of exporting user properties in XML format. If ASErrorCode is `0`, it indicates success in exporting user properties; non-zero value indicates otherwise. **See also:** `PDUserPropertiesXMLLabels` #### PDSElementFindAncestorWithUserProperties ```cpp PDSElement PDSElementFindAncestorWithUserProperties(PDSElement elem) ``` Header: `PDSReadProcs.h:909` Starting at the supplied structure element, this procedure follows the chain of parents (see PDSElementGetParent()) until a structure element is found that has user properties. If no such element is found (for example, the chain ended at the structure tree root), CosNull is returned. **Parameters** - `elem` ([`PDSElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElement)): The PDSElement at which to start searching upwards through the tree. **Returns:** [`PDSElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElement) The first ancestor of `elem` that contains UserProperties attributes or class information, or CosNull if none is found. **See also:** [`PDSElementEnumKidsWithUserProperties`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementEnumKidsWithUserProperties) #### PDSElementGetActualText ```cpp ASInt32 PDSElementGetActualText(IN PDSElement element, IN ASUns8 *buffer) ``` Header: `PDSReadProcs.h:653` Gets the actual text associated with the specified PDSElement. It returns the number of bytes in the text, or `0` if the element has no actual text or has an empty string. To check for the existence of alternate text, check for a non-zero return value. To get the needed size of `buffer`, call this method with a `NULL` buffer. **Note:** Due to implementation issues, make the buffer one byte larger than the required size. Code will not `NULL`-terminate the string correctly in the case of Unicode strings. **Parameters** - `element` (`IN PDSElement`): The structural element whose actual text is sought. - `buffer` (`IN ASUns8 *`): If not `NULL`, `buffer` contains the element's actual text. The string is `NULL`-terminated (but not correctly for Unicode). This is not a C-style string, so normal string handling functions may not work; the buffer may contain a Unicode string. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) An ASInt32 representing the number of bytes in the text, or `0` if the element has no actual text. **See also:** [`PDSElementSetActualText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementSetActualText) #### PDSElementGetActualTextASText ```cpp void PDSElementGetActualTextASText(PDSElement element, ASText text) ``` Header: `PDSReadProcs.h:963` Gets the actual text associated with the specified PDSElement as an ASText object. **Parameters** - `element` ([`PDSElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElement)): The element whose actual text is sought. - `text` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): (Filled by the method) The text object containing the element's actual text. The client must pass a valid ASText object. The routine does not allocate it. **Returns:** `void` **See also:** [`PDSElementGetActualText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetActualText), [`PDSElementSetActualTextASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementSetActualTextASText), [`PDSElementSetActualText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementSetActualText) #### PDSElementGetAlt ```cpp ASInt32 PDSElementGetAlt(IN PDSElement element, IN ASUns8 *buffer) ``` Header: `PDSReadProcs.h:328` Gets the alternate text associated with an element. It can first be called with a `NULL` buffer to find the size, so that buffer can then be appropriately sized. **Note:** The Alt text can be legally defined as an empty string. To differentiate between an Alt text string of zero length and no Alt text being defined, call PDSElementHasAlt() first. **Note:** Due to implementation issues, make the buffer one byte larger than the required size. The code will not `NULL`-terminate the string correctly in the case of Unicode strings. **Parameters** - `element` (`IN PDSElement`): The element whose alternate text is obtained. - `buffer` (`IN ASUns8 *`): (Filled by the method) A buffer into which the alternate text is placed. It may be `NULL`, if the method is called only to find the length of the element's alternate text. If it is not `NULL`, `buffer` contains the element's actual text. The string is `NULL`-terminated (but not correctly for Unicode). This is not a C-style string, so normal string handling functions may not work; the buffer may contain a Unicode string. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The number of bytes in the `element` parameter's alternate text. **Exceptions** - `pdsErrWrongTypeParameter`: is raised if `element` is not a valid PDSElement. **See also:** [`PDSElementSetAlt`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementSetAlt), [`PDSElementHasAlt`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementHasAlt) #### PDSElementGetAltASText ```cpp void PDSElementGetAltASText(PDSElement element, ASText text) ``` Header: `PDSReadProcs.h:981` Gets the alternate text associated with the specified PDSElement as an ASText object. **Parameters** - `element` ([`PDSElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElement)): The element whose alternate text is sought. - `text` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): (Filled by the method) The text object containing the element's alternate text. The client must pass a valid ASText object. The routine does not allocate it. **Returns:** `void` **Exceptions** - `pdsErrWrongTypeParameter`: is raised if `element` is not a valid PDSElement. **See also:** [`PDSElementGetAlt`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetAlt), [`PDSElementSetAltASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementSetAltASText), [`PDSElementSetAlt`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementSetAlt), [`PDSElementHasAlt`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementHasAlt) #### PDSElementGetAttrObj ```cpp ASInt32 PDSElementGetAttrObj(IN PDSElement element, IN ASInt32 index, OUT PDSAttrObj *attrObj) ``` Header: `PDSReadProcs.h:260` Gets the attribute object at a specified array index in the specified element. If there is only one attribute object (that is, there is no array of attributes), and `index` is zero, that attribute object is obtained. **Parameters** - `element` (`IN PDSElement`): IN/OUT The element whose attribute is obtained. - `index` (`IN ASInt32`): IN/OUT The index of the attribute object to obtain. - `attrObj` (`OUT PDSAttrObj *`): IN/OUT (Filled by the method) The attribute object at `index`. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The revision number of `element` at time of last association. **Exceptions** - `pdsErrRequiredMissing` - `pdsErrWrongTypeParameter`: is raised if `element` is not a valid PDSElement. **See also:** [`PDSElementAddAttrObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementAddAttrObj), [`PDSElementGetNumAttrObjs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetNumAttrObjs), [`PDSElementRemoveAttrObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementRemoveAttrObj) #### PDSElementGetClass ```cpp ASInt32 PDSElementGetClass(IN PDSElement element, IN ASInt32 index, OUT ASAtom *classAtom) ``` Header: `PDSReadProcs.h:296` Gets the class name at an array index in the specified element. If there is only one attribute object (that is, there is no array), and `index` is zero, that class name is obtained. **Parameters** - `element` (`IN PDSElement`): The element whose class is obtained. - `index` (`IN ASInt32`): The index of the class to obtain. - `classAtom` (`OUT ASAtom *`): (Filled by the method) The ASAtom describing the class. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The revision number of `element` at the time of the last association. **Exceptions** - `pdsErrRequiredMissing` - `pdsErrWrongTypeParameter`: is raised if `element` is not a valid PDSElement. **See also:** [`PDSElementAddClass`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementAddClass), [`PDSElementGetNumClasses`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetNumClasses), [`PDSElementRemoveAllClasses`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementRemoveAllClasses), [`PDSElementRemoveClass`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementRemoveClass) #### PDSElementGetCosObj ```cpp CosObj PDSElementGetCosObj(PDSElement element) ``` Header: `PDSReadProcs.h:800` Gets the Cos object corresponding to the specified element object. This method does not copy the object, but is instead the logical equivalent of a type cast. **Parameters** - `element` ([`PDSElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElement)): The element object whose Cos object is obtained. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) The dictionary Cos object for the element object. #### PDSElementGetFirstPage ```cpp CosObj PDSElementGetFirstPage(IN PDSElement pdsElement, OUT ASAtom *firstKidType, OUT CosObj *firstCosObjKidOnAPage, OUT PDEContainer *firstMCKidOnAPage) ``` Header: `PDSReadProcs.h:425` Gets the Cos object for the page of the first kid of the element. This may throw various exceptions. **Note:** The order in which the returned page is first is the order of kids, not the order of pages. That is, the first descendant with page content determines which page is returned. **Parameters** - `pdsElement` (`IN PDSElement`): IN/OUT The element whose kid's first page is found. - `firstKidType` (`OUT ASAtom *`): IN/OUT (Filled by the method) A pointer to an ASAtom for the name that appears as the Type entry of the actual first kid of `element`. Possible values are the values that PDSElementGetKid() can return. Pass `NULL` to inhibit setting `firstKidType`. - `firstCosObjKidOnAPage` (`OUT CosObj *`): IN/OUT (Filled by the method) The kid whose content determined that the page returned was the first page with content, if that kid is a CosObj. Pass `NULL` to inhibit setting `firstCosObjKidOnAPage`. - `firstMCKidOnAPage` (`OUT PDEContainer *`): IN/OUT (Filled by the method) The kid whose content determined that the page returned was the first page with content, if that kid is marked content that is not a CosObj. Pass `NULL` to inhibit setting `firstMCKidOnAPage`. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) The CosObj of the page found, CosObjNull if the element has no page content. **See also:** [`PDSElementGetKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetKid) #### PDSElementGetID ```cpp ASInt32 PDSElementGetID(IN PDSElement pdsElement, OUT ASUns8 *idBuf) ``` Header: `PDSReadProcs.h:445` Gets the ID of an element, or CosObjNull if there is no ID set. **Parameters** - `pdsElement` (`IN PDSElement`): The element whose ID is obtained. - `idBuf` (`OUT ASUns8 *`): (Filled by the method) A pointer to the buffer containing the element's ID. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The number of bytes in the ID, or zero if the element has no ID. **Exceptions** - `pdsErrWrongTypeParameter`: is raised if `element` is not a valid PDSElement. - `pdsErrBadPDF`: is raised if an error is found in the PDF file. **See also:** [`PDSElementClearID`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementClearID), [`PDSElementSetID`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementSetID), [`PDSTreeRootGetElementFromID`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSTreeRootGetElementFromID) #### PDSElementGetKid ```cpp ASAtom PDSElementGetKid(IN PDSElement element, IN ASInt32 index, OUT CosObj *cosObjKid, OUT void **pointerKid, OUT CosObj *cosPage) ``` Header: `PDSReadProcs.h:392` Gets the kid at an array index in the specified element. A PDF structural element, unlike the structure tree root, can have several different kinds of children: marked content, another element, or an entire PDF object. The parameter in which the kid is placed depends on the type of kid. If the kid is a structural element or an object reference, PDSElementGetKid() places the result in `cosObjKid`; if the kid is page content, it is placed in `pointerKid`. Any or all of cosObjKid, pointerKid, and cosPage can be `NULL` to get the kid's type without setting that parameter. **Parameters** - `element` (`IN PDSElement`): The element whose specified kid is found. - `index` (`IN ASInt32`): The index of the kid to obtain. - `cosObjKid` (`OUT CosObj *`): (Filled by the method) The CosObj of the specified kid, if that kid is a PDSElement or an OBJR. If `cosObjKid` is `NULL`, it is not filled in, but the type of the kid is returned regardless. Note that this CosObj can be treated as a PDSElement or a PDSObjR. Use the return type to decide which to use. - `pointerKid` (`OUT void **`): (Filled by the method) A pointer to the kid at `index`, if that kid is an MC. If `pointerKid` is `NULL`, it is not filled in, but the type of the kid is returned regardless. **Note:** When the kid is an MC, it is actually a pointer of the type PDEContainer. As with all PDFEdit objects, you must be careful to manage the reference count of the object by calling PDEAcquire() and PDERelease(). PDSElementGetKid() does not call PDEAcquire() for you. **Note:** This method cannot access marked content inside a Form XObject. - `cosPage` (`OUT CosObj *`): (Filled by the method) A pointer to the CosObj of the page containing the kid. If `cosPage` is `NULL`, it is not filled in, but the type of the kid is returned regardless. **Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom) The ASAtom representing the kid's Type value: StructElem, MC, or OBJR. MCR is never returned. **Exceptions** - `pdsErrWrongTypeParameter`: is raised if `element` is not a valid PDSElement. - `pdsErrBadPDF`: is raised if an error is found in the PDF file. **See also:** [`PDSElementGetFirstPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetFirstPage), [`PDSElementGetKidEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetKidEx), [`PDSElementGetKidWithMCInfo`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetKidWithMCInfo), [`PDSElementGetNumKids`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetNumKids), [`PDSElementInsertKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementInsertKid) #### PDSElementGetKidEx ```cpp ASAtom PDSElementGetKidEx(IN PDSElement element, IN ASInt32 index, OUT CosObj *cosObjKid, OUT ASInt32 *mcid, OUT void **pointerKid, OUT CosObj *cosPage) ``` Header: `PDSReadProcs.h:626` Functions identically to PDSElementGetKid(), but for children that are marked contents can return the `mcid` as well as or instead of the actual object. **Note:** This method cannot access marked content inside a Form XObject. **Parameters** - `element` (`IN PDSElement`): The PDSElement containing the kid that is retrieved. - `index` (`IN ASInt32`): The index of the kid. - `cosObjKid` (`OUT CosObj *`): (Filled in by method) The kid being accessed (depending on the kid's type) or `NULL`. - `mcid` (`OUT ASInt32 *`): (Filled in by method) The kid's `mcid` or `NULL`. - `pointerKid` (`OUT void **`): (Filled in by method) A pointer to the kid, or `NULL`. - `cosPage` (`OUT CosObj *`): (Filled in by method) The CosObj of the page containing the kid, or `NULL`. **Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom) An ASAtom representing the Type value of the kid. See above. **Exceptions** - `pdsErrWrongTypeParameter`: is raised if `element` is not a valid PDSElement. - `pdsErrBadPDF`: is raised if an error is found in the PDF file. **See also:** [`PDSElementGetKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetKid), [`PDSElementGetKidWithMCInfo`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetKidWithMCInfo) #### PDSElementGetKidWithMCInfo ```cpp ASAtom PDSElementGetKidWithMCInfo(PDSElement element, ASInt32 index, CosObj *cosObjKid, PDSMCInfoP mcidInfo, void **pointerKid, CosObj *cosPage) ``` Header: `PDSReadProcs.h:740` Functions identically to PDSElementGetKidEx(), but returns additional information about marked content kids that are in streams other than the page content streams. **Parameters** - `element` ([`PDSElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElement)): The PDSElement containing the kid that is retrieved. - `index` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The index of the kid. - `cosObjKid` ([`CosObj *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): (Filled in by method) The kid being accessed (depending on the kid's type), or `NULL`. - `mcidInfo` (`PDSMCInfoP`): (Filled in by method) The kid's information object, or `NULL`. - `pointerKid` (`void **`): (Filled in by method) A pointer to the kid, or `NULL`. - `cosPage` ([`CosObj *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): (Filled in by method) The CosObj of the page containing the kid, or `NULL`. **Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom) An ASAtom representing the Type value of the kid. **Exceptions** - `pdsErrWrongTypeParameter`: is raised if `element` is not a valid PDSElement. - `pdsErrBadPDF`: is raised if an error is found in the PDF file. **See also:** [`PDSElementGetKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetKid), [`PDSElementGetKidEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetKidEx) #### PDSElementGetLanguage ```cpp ASInt32 PDSElementGetLanguage(IN PDSElement element, IN ASUns8 *buffer) ``` Header: `PDSReadProcs.h:683` Gets the language associated with the specified PDSElement. It returns the number of bytes in the language string, or `0` if the element has no language or has an empty string. To check for the existence of expansion text, call PDSElementHasLanguage(). To get the needed buffer size, call this method with a `NULL` buffer. **Note:** Due to implementation issues, make the buffer one byte larger than the required size. Code will not `NULL`-terminate the string correctly in the case of Unicode strings. **Parameters** - `element` (`IN PDSElement`): The structural element whose expansion text is sought. - `buffer` (`IN ASUns8 *`): (Filled by the method) A buffer containing the element's expansion text, or `NULL`. See PDSElementSetLanguage() for format and languages. If not `NULL`, buffer contains the element's expansion text. The string is `NULL`-terminated (but not correctly for Unicode). This is not a C-style string, so normal string handling functions may not work; the buffer may contain a Unicode string. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) An ASInt32 representing the number of bytes in the language string. **See also:** [`PDSElementSetLanguage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementSetLanguage), [`PDSElementHasLanguage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementHasLanguage) #### PDSElementGetNumAttrObjs ```cpp ASInt32 PDSElementGetNumAttrObjs(IN PDSElement element) ``` Header: `PDSReadProcs.h:235` Gets the number of attribute objects directly attached to the specified element. **Parameters** - `element` (`IN PDSElement`): IN/OUT The element whose number of attributes is obtained. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The number of attribute objects directly attached to `element`. **Exceptions** - `pdsErrWrongTypeParameter`: is raised if `element` is not a valid PDSElement. **See also:** [`PDSElementGetAttrObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetAttrObj) #### PDSElementGetNumClasses ```cpp ASInt32 PDSElementGetNumClasses(IN PDSElement element) ``` Header: `PDSReadProcs.h:273` Gets the number of classes to which the specified element belongs. **Parameters** - `element` (`IN PDSElement`): The element whose number of classes is obtained. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The number of classes to which `element` belongs. **Exceptions** - `pdsErrWrongTypeParameter`: is raised if `element` is not a valid PDSElement. **See also:** [`PDSElementGetClass`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetClass) #### PDSElementGetNumKids ```cpp ASInt32 PDSElementGetNumKids(IN PDSElement element) ``` Header: `PDSReadProcs.h:340` Gets the number of kids of the specified element. **Parameters** - `element` (`IN PDSElement`): IN/OUT The element whose number of kids is obtained. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The number of direct kids of `element`. **Exceptions** - `pdsErrWrongTypeParameter`: is raised if `element` is not a valid PDSElement. **See also:** [`PDSElementGetKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetKid) #### PDSElementGetParent ```cpp void PDSElementGetParent(IN PDSElement element, OUT PDSElement *parent, OUT ASBool *parentIsTreeRoot) ``` Header: `PDSReadProcs.h:186` Gets the immediate ancestor element of the specified element in the tree. If the element's parent is another element, `parent` is set to that parent and `parentIsTreeRoot` is set to `false`. If the element's parent is the structure tree root, `parent` is set to CosNull and `parentIsTreeRoot` is set to `true`. If `parentIsTreeRoot` is `NULL`, it is not set. **Parameters** - `element` (`IN PDSElement`): The element whose parent is obtained. - `parent` (`OUT PDSElement *`): (Filled by the method) The element's parent. - `parentIsTreeRoot` (`OUT ASBool *`): (Filled by the method) The element's parent is the structure tree root. **Returns:** `void` **Exceptions** - `pdsErrWrongTypeParameter`: is raised if `element` is not a valid PDSElement. **See also:** [`PDSElementGetKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetKid), [`PDSElementGetStructTreeRoot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetStructTreeRoot), [`PDSMCGetInfo`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSMCGetInfo), [`PDSOBJGetParent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSOBJGetParent) #### PDSElementGetRevision ```cpp ASInt32 PDSElementGetRevision(IN PDSElement element) ``` Header: `PDSReadProcs.h:221` Gets the revision number of an element. **Parameters** - `element` (`IN PDSElement`): IN/OUT The element whose revision is obtained. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The revision number of `element`. **Exceptions** - `pdsErrWrongTypeParameter`: is raised if `element` is not a valid PDSElement. **See also:** [`PDSElementIncrementRevision`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementIncrementRevision) #### PDSElementGetStructTreeRoot ```cpp ASBool PDSElementGetStructTreeRoot(IN PDSElement element, OUT PDSTreeRoot *treeRoot) ``` Header: `PDSReadProcs.h:461` Gets the structure tree root of the document containing element. **Parameters** - `element` (`IN PDSElement`): The element whose title is obtained. - `treeRoot` (`OUT PDSTreeRoot *`): (Filled by the method) The structure tree root. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the document has a structure tree root, `false` otherwise. If there is a structure tree root, it sets `treeRoot` to be the structure tree root. **Exceptions** - `pdsErrWrongTypeParameter`: is raised if `element` is not a valid PDSElement. **See also:** [`PDSTreeRootGetKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSTreeRootGetKid) #### PDSElementGetTitle ```cpp ASInt32 PDSElementGetTitle(IN PDSElement element, OUT ASUns8 *buffer) ``` Header: `PDSReadProcs.h:209` Gets the title of the specified element, returning the number of bytes in the title. It can first be called with a `NULL` buffer to find the title size, so that buffer can be appropriately sized as one greater than the title's length. **Parameters** - `element` (`IN PDSElement`): IN/OUT The element whose title is obtained. - `buffer` (`OUT ASUns8 *`): IN/OUT (Filled by the method) A buffer into which the title text is placed. It may be `NULL`, in which case the number of bytes in the title is returned.`element` parameter's title, or zero if `element` has no title. **Note:** Due to implementation issues, make the buffer one byte larger than the required size. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) **Exceptions** - `pdsErrWrongTypeParameter`: is raised if `element` is not a valid PDSElement. **See also:** [`PDSElementSetTitle`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementSetTitle) #### PDSElementGetTitleASText ```cpp void PDSElementGetTitleASText(PDSElement element, ASText title) ``` Header: `PDSReadProcs.h:949` Gets the title associated with the specified PDSElement as an ASText object. **Parameters** - `element` ([`PDSElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElement)): The element whose title is sought. - `title` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): (Filled by the method) The text object containing the title. The client must pass a valid ASText object. The routine does not allocate it. **Returns:** `void` **Exceptions** - `pdsErrWrongTypeParameter`: is raised if `element` is not a valid PDSElement. **See also:** [`PDSElementGetTitle`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetTitle), [`PDSElementSetTitleASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementSetTitleASText), [`PDSElementSetTitle`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementSetTitle) #### PDSElementGetType ```cpp ASAtom PDSElementGetType(IN PDSElement element) ``` Header: `PDSReadProcs.h:161` Gets the element's structural element type. The type corresponds to the Subtype key in the structure element dictionary. PDSElementGetType() gets the value of the Subtype key (not the Type key) in the structure element dictionary. All PDSElement objects have a Type value of StructElem. **Parameters** - `element` (`IN PDSElement`): The element whose structural element type is obtained. **Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom) The ASAtom representing element's type. **Exceptions** - `pdsErrWrongTypeParameter`: is raised if `element` is not a valid PDSElement. **See also:** [`PDSElementSetType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementSetType) #### PDSElementHasActualText ```cpp ASBool PDSElementHasActualText(IN PDSElement element) ``` Header: `PDSReadProcs.h:704` Tests whether ActualText is defined for a given PDSElement. **Parameters** - `element` (`IN PDSElement`): The PDSElement being tested. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if text exists (including the empty string); `false` otherwise. #### PDSElementHasAlt ```cpp ASBool PDSElementHasAlt(IN PDSElement element) ``` Header: `PDSReadProcs.h:694` Tests whether Alt text is defined for a given PDSElement. **Parameters** - `element` (`IN PDSElement`): The PDSElement being tested. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if text exists (including the empty string); `false` otherwise. **See also:** [`PDSElementGetAlt`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetAlt) #### PDSElementHasLanguage ```cpp ASBool PDSElementHasLanguage(IN PDSElement element) ``` Header: `PDSReadProcs.h:714` Tests whether a language string is defined for a given PDSElement. **Parameters** - `element` (`IN PDSElement`): The PDSElement being tested. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if text exists (including the empty string); `false` otherwise. #### PDSElementHasUserProperties ```cpp ASBool PDSElementHasUserProperties(PDSElement elem) ``` Header: `PDSReadProcs.h:851` Returns `true` if the PDSElement has attribute objects or class objects with an owner of UserProperties. **Parameters** - `elem` ([`PDSElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElement)): The PDSElement to examine. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) ASBool indicating that some attribute objects or class objects have an owner of UserProperties. #### PDSElementIncrementRevision ```cpp void PDSElementIncrementRevision(IN PDSElement element) ``` Header: `PDSWriteProcs.h:243` Increments an element's revision count by one. This may raise various exceptions. **Parameters** - `element` (`IN PDSElement`): The element whose revision count is incremented. **Returns:** `void` #### PDSElementInsertKid ```cpp void PDSElementInsertKid(IN PDSElement element, IN PDSElement kid, IN ASInt32 insertAfter) ``` Header: `PDSWriteProcs.h:389` Inserts the specified kid PDSElement object into the specified element after position `insertAfter`. **Parameters** - `element` (`IN PDSElement`): The element in which the specified kid is inserted. - `kid` (`IN PDSElement`): The kid to insert. - `insertAfter` (`IN ASInt32`): The position after which the kid is inserted. If `element` currently has no kids, `insertAfter` is ignored. **Returns:** `void` **Exceptions** - `pdsErrWrongTypeParameter` **See also:** [`PDSElementGetFirstPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetFirstPage), [`PDSElementGetKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetKid), [`PDSElementInsertMCAsKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementInsertMCAsKid), [`PDSElementInsertOBJAsKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementInsertOBJAsKid), [`PDSElementInsertStmMCAsKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementInsertStmMCAsKid), [`PDSElementRemoveKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementRemoveKid), [`PDSElementReplaceKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementReplaceKid) #### PDSElementInsertMCAsKid ```cpp void PDSElementInsertMCAsKid(IN PDSElement element, IN CosObj cosPage, IN PDSMC mc, IN ASInt32 insertAfter) ``` Header: `PDSWriteProcs.h:413` Inserts a reference to the specified PDSMC (marked content) in the specified element after position `insertAfter`. This method automatically creates MCR objects if needed. This may raise various exceptions. **Parameters** - `element` (`IN PDSElement`): The element in which the reference is inserted. - `cosPage` (`IN CosObj`): The CosObj for the page containing the reference to insert. - `mc` (`IN PDSMC`): The marked content to insert. - `insertAfter` (`IN ASInt32`): The position after which the reference is inserted. If `element` currently has no kids, `insertAfter` is ignored. **Returns:** `void` **See also:** [`PDSElementInsertKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementInsertKid), [`PDSElementInsertOBJAsKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementInsertOBJAsKid), [`PDSElementInsertStmMCAsKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementInsertStmMCAsKid), [`PDSElementReplaceKidMC`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementReplaceKidMC) #### PDSElementInsertMCAsKidEx ```cpp void PDSElementInsertMCAsKidEx(IN PDSElement element, IN CosObj cosPage, IN PDSMC mc, IN ASInt32 insertAfter, IN CosObj cosStream, IN CosObj streamOwner) ``` Header: `PDSWriteProcs.h:796` Extends PDSElementInsertMCAsKid(), inserting content that is in a stream other than a page content stream. This function is the same as PDSElementInsertStmMCAsKid(). This may raise various exceptions. **Parameters** - `element` (`IN PDSElement`): The element in which the reference is inserted. - `cosPage` (`IN CosObj`): The CosObj for the page containing the reference to insert. - `mc` (`IN PDSMC`): The marked content to insert. - `insertAfter` (`IN ASInt32`): The position after which the reference is inserted. If `element` currently has no kids, `insertAfter` is ignored. - `cosStream` (`IN CosObj`): The stream containing the content given by `mc`. - `streamOwner` (`IN CosObj`): A Cos object to record as the owner of the content. It can be CosNull if the owner is not important. **Returns:** `void` **See also:** [`PDSElementInsertKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementInsertKid), [`PDSElementInsertMCAsKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementInsertMCAsKid), [`PDSElementInsertOBJAsKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementInsertOBJAsKid), [`PDSElementInsertStmMCAsKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementInsertStmMCAsKid), [`PDSElementReplaceKidMC`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementReplaceKidMC) #### PDSElementInsertMCRefAsKid ```cpp ASBool PDSElementInsertMCRefAsKid(IN PDSElement element, IN PDSMCRef ref, IN ASInt32 insertAfter) ``` Header: `PDSWriteProcs.h:906` Takes a marked content reference and places the content that it identifies in the structure as a child of the element. This may raise various exceptions. **Note:** the content reference handle will be filled out automatically if PDPageSetPDEContent(), PDEFormSetContent(), or PDEGroupSetContent() is called. Otherwise, PDEContentSetPage() or PDEContentSetContainingStmAndOwner() must be called explicitly. **Parameters** - `element` (`IN PDSElement`): The structure element with which to associate marked content. - `ref` (`IN PDSMCRef`): The marked content reference describing the content on the page. It must have had a valid MCID, and must have been completed by subsequent content stream processing calls. - `insertAfter` (`IN ASInt32`): The position after which the marked content is inserted into the element's kids. If the element has no children, `insertAfter` is ignored. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) **See also:** [`PDSMCRefCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSMCRefCreate) #### PDSElementInsertOBJAsKid ```cpp void PDSElementInsertOBJAsKid(IN PDSElement element, IN CosObj cosPage, IN CosObj obj, IN ASInt32 insertAfter) ``` Header: `PDSWriteProcs.h:432` Inserts a reference to the specified PDF object as a kid into the specified element. This may raise various exceptions. **Parameters** - `element` (`IN PDSElement`): IN/OUT The element in which the reference is inserted. - `cosPage` (`IN CosObj`): IN/OUT The CosObj for the page containing the reference to insert. - `obj` (`IN CosObj`): IN/OUT The CosObj to insert. - `insertAfter` (`IN ASInt32`): IN/OUT The position after which the reference is inserted in `element`. If `element` currently has no kids, `insertAfter` is ignored. **Returns:** `void` **See also:** [`PDSElementReplaceKidOBJ`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementReplaceKidOBJ) #### PDSElementInsertStmMCAsKid ```cpp void PDSElementInsertStmMCAsKid(PDSElement element, CosObj cosPage, CosObj containingStm, CosObj stmOwner, PDSMC mc, ASInt32 insertAfter) ``` Header: `PDSWriteProcs.h:825` Inserts a marked content sequence from a non-page-content stream as a kid of the specified element. This may raise various exceptions. **Parameters** - `element` ([`PDSElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElement)): The element in which the reference is inserted. - `cosPage` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The CosObj for the page containing the reference to insert. - `containingStm` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The stream containing the content given by `mc`. - `stmOwner` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The PDF object owning the stream given in `cosStream` (for example, the annotation to which an appearance stream belongs). It can be CosNull if the owner is not important. - `mc` ([`PDSMC`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSMC)): The marked content to insert. - `insertAfter` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The position after which the reference is inserted. If `element` currently has no kids, `insertAfter` is ignored. **Returns:** `void` **See also:** [`PDSElementInsertKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementInsertKid), [`PDSElementInsertMCAsKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementInsertMCAsKid), [`PDSElementInsertOBJAsKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementInsertOBJAsKid), [`PDSElementReplaceKidMC`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementReplaceKidMC) #### PDSElementRemoveAllAttrObjs ```cpp void PDSElementRemoveAllAttrObjs(IN PDSElement element) ``` Header: `PDSWriteProcs.h:293` Removes all attribute objects directly associated with the specified element. **Parameters** - `element` (`IN PDSElement`): The element whose attributes are removed. **Returns:** `void` **Exceptions** - `pdsErrWrongTypeParameter`: is raised if `element` is not a valid PDSElement. **See also:** [`PDSElementRemoveAttrObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementRemoveAttrObj) #### PDSElementRemoveAllClasses ```cpp void PDSElementRemoveAllClasses(IN PDSElement element) ``` Header: `PDSWriteProcs.h:349` Removes all classes from the specified element. **Parameters** - `element` (`IN PDSElement`): IN/OUT The element whose classes are removed. **Returns:** `void` **Exceptions** - `pdsErrWrongTypeParameter`: is raised if `element` is not a valid PDSElement. **See also:** [`PDSElementAddClass`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementAddClass), [`PDSElementGetClass`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetClass), [`PDSElementGetNumClasses`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetNumClasses), [`PDSElementRemoveClass`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementRemoveClass) #### PDSElementRemoveAttrObj ```cpp void PDSElementRemoveAttrObj(IN PDSElement element, IN PDSAttrObj attrObj) ``` Header: `PDSWriteProcs.h:282` Removes the specified attribute object from an element. If `element` does not have an `attrObj` attribute, this method does nothing. **Note:** Calling PDSElementRemoveAttrObj() while iterating over the attribute objects of an element will change the relationship between the attribute object indices and attribute objects. Although it is possible to track this change in indices in a single loop, it is more straightforward to accumulate a list of attribute objects to remove during one pass over the attribute objects and to carry out the actual removals during a subsequent iteration over the accumulated list. **Parameters** - `element` (`IN PDSElement`): The element whose attribute is removed. - `attrObj` (`IN PDSAttrObj`): The attribute object to remove. **Returns:** `void` **Exceptions** - `pdsErrWrongTypeParameter`: is raised if `element` is not a valid PDSElement or `attrObj` is not a valid attribute object. **See also:** [`PDSElementAddAttrObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementAddAttrObj), [`PDSElementGetAttrObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetAttrObj), [`PDSElementRemoveAllAttrObjs`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementRemoveAllAttrObjs) #### PDSElementRemoveClass ```cpp void PDSElementRemoveClass(IN PDSElement element, IN ASAtom classAtom) ``` Header: `PDSWriteProcs.h:336` Removes the specified class name from the element's list of classes to which it belongs. **Note:** Calling PDSElementRemoveClass() while iterating over the classes of an element will change the relationship between class indices and classes. Although it is possible to track this change in indices in a single loop, it is more straightforward to accumulate a list of classes to remove during one pass over the classes and to carry out the actual removals during a subsequent iteration over the accumulated list. **Parameters** - `element` (`IN PDSElement`): The element from which the specified class is removed. - `classAtom` (`IN ASAtom`): The ASAtom representing the class to remove. **Returns:** `void` **Exceptions** - `pdsErrWrongTypeParameter`: is raised if `element` is not a valid PDSElement. **See also:** [`PDSElementAddClass`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementAddClass), [`PDSElementGetClass`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetClass), [`PDSElementGetNumClasses`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetNumClasses), [`PDSElementRemoveAllClasses`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementRemoveAllClasses) #### PDSElementRemoveKid ```cpp void PDSElementRemoveKid(IN PDSElement element, IN CosObj kid) ``` Header: `PDSWriteProcs.h:449` Removes the specified kid from an element. This may raise various exceptions. **Note:** The approved method of removing OBJ kids is PDSElementRemoveKidOBJ(). **Parameters** - `element` (`IN PDSElement`): The element whose kid is removed. - `kid` (`IN CosObj`): The kid to remove. **Returns:** `void` **See also:** [`PDSElementGetKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetKid), [`PDSElementInsertKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementInsertKid), [`PDSElementRemoveKidMC`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementRemoveKidMC), [`PDSElementRemoveKidOBJ`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementRemoveKidOBJ) #### PDSElementRemoveKidMC ```cpp void PDSElementRemoveKidMC(IN PDSElement element, IN CosObj cosPage, IN PDSMC mc) ``` Header: `PDSWriteProcs.h:469` Removes the specified PDSMC (marked content) from an element's kids, if it has any. After calling this method, use PDPageSetPDEContent() to commit any changes that have been made to the page contents. This may raise various exceptions. **Parameters** - `element` (`IN PDSElement`): The element whose reference is removed. - `cosPage` (`IN CosObj`): The CosObj for the page containing the reference to remove. - `mc` (`IN PDSMC`): The marked content to remove. **Returns:** `void` **See also:** [`PDSElementInsertMCAsKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementInsertMCAsKid), [`PDSElementReplaceKidMC`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementReplaceKidMC), [`PDSElementRemoveKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementRemoveKid) #### PDSElementRemoveKidOBJ ```cpp void PDSElementRemoveKidOBJ(IN PDSElement element, IN CosObj kid) ``` Header: `PDSWriteProcs.h:768` Removes an OBJ from among the kids of a given element. It does nothing if the given OBJ is not a kid of the given element. This may raise various exceptions. **Parameters** - `element` (`IN PDSElement`): The element whose kid is having an OBJ removed. - `kid` (`IN CosObj`): The kid whose OBJ is removed. **Returns:** `void` **See also:** [`PDSElementInsertMCAsKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementInsertMCAsKid), [`PDSElementReplaceKidMC`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementReplaceKidMC), [`PDSElementRemoveKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementRemoveKid) #### PDSElementReplaceKid ```cpp void PDSElementReplaceKid(IN PDSElement element, IN CosObj oldKid, IN CosObj newKid) ``` Header: `PDSWriteProcs.h:489` Replaces the specified kid in the specified element. This may raise various exceptions. **Note:** The approved method of replacing OBJ kids is PDSElementReplaceKidOBJ(). **Parameters** - `element` (`IN PDSElement`): IN/OUT The element whose kid is replaced. - `oldKid` (`IN CosObj`): IN/OUT The kid to replace. - `newKid` (`IN CosObj`): IN/OUT The kid that is replacing `oldKid`. **Returns:** `void` **See also:** [`PDSElementInsertKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementInsertKid), [`PDSElementGetFirstPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetFirstPage), [`PDSElementGetKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetKid), [`PDSElementRemoveKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementRemoveKid), [`PDSElementReplaceKidMC`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementReplaceKidMC), [`PDSElementReplaceKidOBJ`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementReplaceKidOBJ) #### PDSElementReplaceKidMC ```cpp void PDSElementReplaceKidMC(IN PDSElement element, IN CosObj oldCosPage, IN PDSMC oldMC, IN CosObj newCosPage, IN PDSMC newMC) ``` Header: `PDSWriteProcs.h:509` Replaces the specified PDSMC (on `oldCosPage`) with a new PDSMC (on `newCosPage`) in the specified element. This may raise various exceptions. **Parameters** - `element` (`IN PDSElement`): The element whose reference is replaced. - `oldCosPage` (`IN CosObj`): The CosObj for the page holding the reference to replace. - `oldMC` (`IN PDSMC`): The marked content to replace. - `newCosPage` (`IN CosObj`): The CosObj for the page holding the reference that is replacing `oldMC`. - `newMC` (`IN PDSMC`): The marked content that is replacing `oldMC`. **Returns:** `void` **See also:** [`PDSElementInsertMCAsKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementInsertMCAsKid), [`PDSElementRemoveKidMC`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementRemoveKidMC), [`PDSElementReplaceKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementReplaceKid) #### PDSElementReplaceKidOBJ ```cpp void PDSElementReplaceKidOBJ(IN PDSElement element, IN CosObj oldObj, IN CosObj newObj, IN CosObj newPage) ``` Header: `PDSWriteProcs.h:527` Replaces `oldObj` with `newObj` on the specified page in the specified element. This may raise various exceptions. **Parameters** - `element` (`IN PDSElement`): IN/OUT The element whose object is replaced. - `oldObj` (`IN CosObj`): IN/OUT The object to replace. - `newObj` (`IN CosObj`): IN/OUT The object that is replacing `oldObj`. - `newPage` (`IN CosObj`): IN/OUT The CosObj for the page holding the reference that is replacing `oldObj`. **Returns:** `void` **See also:** [`PDSElementInsertOBJAsKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementInsertOBJAsKid), [`PDSElementReplaceKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementReplaceKid), [`PDSElementReplaceKidMC`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementReplaceKidMC) #### PDSElementSetActualText ```cpp void PDSElementSetActualText(IN PDSElement element, IN const ASUns8 *buffer, IN ASInt32 nBytes) ``` Header: `PDSWriteProcs.h:730` Sets the actual text representation of the specified PDSElement object's contents to `buffer` (from `0` to `nBytes`). **Parameters** - `element` (`IN PDSElement`): The PDSElement whose contents are being set to `buffer`. - `buffer` (`IN const ASUns8 *`): The buffer to which the PDSElement object's contents are being set. - `nBytes` (`IN ASInt32`): The number of bytes in the text representation. **Returns:** `void` **See also:** [`PDSElementGetActualText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetActualText) #### PDSElementSetActualTextASText ```cpp void PDSElementSetActualTextASText(PDSElement element, const ASText text) ``` Header: `PDSWriteProcs.h:936` Sets an element's actual text. **Parameters** - `element` ([`PDSElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElement)): The element whose content is being set. - `text` ([`const ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): The text object containing the string to be made the element's actual text. **Returns:** `void` **See also:** [`PDSElementSetActualText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementSetActualText), [`PDSElementGetActualTextASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetActualTextASText), [`PDSElementGetActualText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetActualText) #### PDSElementSetAlt ```cpp void PDSElementSetAlt(IN PDSElement element, IN const ASUns8 *buffer, IN ASInt32 nBytes) ``` Header: `PDSWriteProcs.h:369` Sets the alternate text representation of an element's contents. **Parameters** - `element` (`IN PDSElement`): IN/OUT The element whose alternate text representation is set. - `buffer` (`IN const ASUns8 *`): IN/OUT A pointer to a buffer containing a string to be made the element's alternate text representation. - `nBytes` (`IN ASInt32`): IN/OUT The number of bytes in `buffer` to use as the `element` parameter's new alternate text representation. It may be zero. It sets an Alt string even if the buffer length is zero, but such an Alt string looks like no Alt string according to PDSElementGetAlt(). **Returns:** `void` **Exceptions** - `pdsErrWrongTypeParameter`: is raised if `element` is not a valid PDSElement. **See also:** [`PDSElementGetAlt`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetAlt), [`PDSElementHasAlt`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementHasAlt) #### PDSElementSetAltASText ```cpp void PDSElementSetAltASText(PDSElement element, const ASText text) ``` Header: `PDSWriteProcs.h:952` Sets the alternate text representation of an element's contents (ASText version of PDSElementSetAlt). **Parameters** - `element` ([`PDSElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElement)): The element whose alternate text representation is being set. - `text` ([`const ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): The text object containing the string to be set as the element's alternate text representation. **Returns:** `void` **Exceptions** - `Raises`: pdsErrWrongTypeParameter if element is not a valid PDSElement. **See also:** [`PDSElementSetAlt`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementSetAlt), [`PDSElementGetAltASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetAltASText), [`PDSElementGetAlt`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetAlt) #### PDSElementSetID ```cpp void PDSElementSetID(IN PDSElement element, IN const ASUns8 *buffer, IN ASInt32 nBytes) ``` Header: `PDSWriteProcs.h:545` Sets the ID of an element to the given Cos string. **Parameters** - `element` (`IN PDSElement`): The element whose ID is set. - `buffer` (`IN const ASUns8 *`): A pointer to a buffer containing a string to be made the element's ID. - `nBytes` (`IN ASInt32`): The number of bytes in `buffer` to use as the `element` parameter's new ID. It may be zero. It sets an ID even if the buffer length is zero, but such an ID looks like no ID according to PDSElementGetID(). **Returns:** `void` **Exceptions** - `ErrSysPDSEdit`: is raised if another element already has the ID as its ID. - `pdsErrWrongTypeParameter`: is raised if `element` is not a valid PDSElement. **See also:** [`PDSElementGetID`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetID), [`PDSElementClearID`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementClearID) #### PDSElementSetLanguage ```cpp void PDSElementSetLanguage(IN PDSElement element, IN const ASUns8 *buffer, IN ASInt32 nBytes) ``` Header: `PDSWriteProcs.h:752` Sets the language field associated with the PDSElement to the `buffer` parameter's contents (from 0 to nBytes). **Note:** IANA registered language codes can be found at [http://www.isi.edu](http://www.isi.edu). **Note:** The IETF Standard for Language Element Values (RFC 1766) can be found at [http://www.ietf.org/rfc/rfc1766.txt?number=1766](http://www.ietf.org/rfc/rfc1766.txt?number=1766). **Parameters** - `element` (`IN PDSElement`): The PDSElement whose language field is set to `buffer`. - `buffer` (`IN const ASUns8 *`): A pointer to a buffer containing a string to be made the element's language field. The empty string indicates that the language is unknown. The string should be in the format ``. Note that the ISO 639 language codes can be found at [http://lcweb.loc.gov/standards/iso639-2](http://lcweb.loc.gov/standards/iso639-2). - `nBytes` (`IN ASInt32`): The size of `buffer`. It may be zero. It sets the language even if the buffer length is zero, but such a language setting looks like no language according to PDSElementGetLanguage. **Returns:** `void` **See also:** [`PDSElementGetLanguage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetLanguage), [`PDSElementHasLanguage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementHasLanguage) #### PDSElementSetTitle ```cpp void PDSElementSetTitle(IN PDSElement element, IN const ASUns8 *buffer, IN ASInt32 nBytes) ``` Header: `PDSWriteProcs.h:233` Sets an element's title. **Parameters** - `element` (`IN PDSElement`): IN/OUT The element whose title is set. - `buffer` (`IN const ASUns8 *`): IN/OUT A pointer to a buffer containing a string to be made the element's title. - `nBytes` (`IN ASInt32`): IN/OUT The number of bytes in `buffer` to use as the `element` parameter's new title. It may be zero. It sets a title even if the buffer length is zero, but such a title looks like no title according to PDSElementGetTitle(). **Returns:** `void` **Exceptions** - `pdsErrWrongTypeParameter`: is raised if `element` is not a valid PDSElement. **See also:** [`PDSElementGetTitle`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetTitle) #### PDSElementSetTitleASText ```cpp void PDSElementSetTitleASText(PDSElement element, const ASText title) ``` Header: `PDSWriteProcs.h:922` Sets an element's title. **Parameters** - `element` ([`PDSElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElement)): The element whose title is being set. - `title` ([`const ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): The text object containing the string to be made the element's title. **Returns:** `void` **Exceptions** - `Raises`: pdsErrWrongTypeParameter if element is not a valid PDSElement. **See also:** [`PDSElementSetTitle`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementSetTitle), [`PDSElementGetTitleASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetTitleASText), [`PDSElementGetTitle`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetTitle) #### PDSElementSetType ```cpp void PDSElementSetType(IN PDSElement element, IN ASAtom type) ``` Header: `PDSWriteProcs.h:218` Sets an element's type value to the specified type. The type corresponds to the Subtype key in the structure element dictionary. PDSElementSetType() sets the value of the Subtype key, not the Type key, in the structure element dictionary. All PDSElement objects have a Type value of StructElem. **Parameters** - `element` (`IN PDSElement`): The element whose type is set. - `type` (`IN ASAtom`): The ASAtom representing the element's type. **Returns:** `void` **Exceptions** - `pdsErrWrongTypeParameter`: is raised if `element` is not a valid PDSElement. **See also:** [`PDSElementGetType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetType) #### PDSOBJGetParent ```cpp void PDSOBJGetParent(IN CosObj obj, OUT PDSElement *parent) ``` Header: `PDSReadProcs.h:517` Gets the parent element of the specified PDF object. This may throw various exceptions. **Parameters** - `obj` (`IN CosObj`): IN/OUT The PDF object whose parent element is obtained. It must be referred to via an OBJR from some element (that is, it has a `struct` parent key), otherwise it is undefined. - `parent` (`OUT PDSElement *`): IN/OUT (Filled by the method) The parent element of `obj`. **Returns:** `void` **See also:** [`PDSElementGetParent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetParent) ### Typedefs (4) #### PDSElement ```cpp typedef CosObj PDSElement ``` Header: `PDSExpT.h:83` Represents PDF structural elements, which are nodes in a tree giving a PDF document's logical structure. **See also:** [`PDSElementCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementCreate), [`PDSElementGetParent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetParent), [`PDSMCGetParent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSMCGetParent), [`PDSOBJGetParent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSOBJGetParent), [`PDSTreeRootGetElementFromID`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSTreeRootGetElementFromID) #### EnumElementsWithUserPropertiesProc ```cpp typedef ASBool(*) EnumElementsWithUserPropertiesProc(PDSElement elem, PDSElement closestAncestorWithUserProperties, void *clientData)(PDSElement elem, PDSElement closestAncestorWithUserProperties, void *clientData) ``` Header: `PDSExpT.h:253` A callback for PDDocEnumPDSElementsWithUserProperties() and PDSElementEnumKidsWithUserProperties(). #### PDSElementEnumUserPropertiesAsASTextProc ```cpp typedef ASBool(*) PDSElementEnumUserPropertiesAsASTextProc(ASText propName, ASText propVal, void *clientData)(ASText propName, ASText propVal, void *clientData) ``` Header: `PDSExpT.h:228` Callback for PDSElementEnumUserPropertiesAsASText(). #### PDSElementEnumUserPropertiesAsCosObjProc ```cpp typedef ASBool(*) PDSElementEnumUserPropertiesAsCosObjProc(CosObj propDict, void *clientData)(CosObj propDict, void *clientData) ``` Header: `PDSExpT.h:239` A callback for PDSElementEnumUserPropertiesAsCosObj(). ## PDSMC ### Functions (6) #### PDSMCGetInfo ```cpp void PDSMCGetInfo(CosObj containingObj, PDSMC mc, PDSMCInfoP info) ``` Header: `PDSReadProcs.h:759` Gets information about how the specified marked content is contained in its parent. **Note:** This method cannot access marked content inside a Form XObject. **Parameters** - `containingObj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The CosObj containing the MC whose information is obtained. For marked content on a page, this is the Cos object representing the page. For marked content elsewhere, this is the stream in which the marked content resides. - `mc` ([`PDSMC`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSMC)): The marked content whose information is obtained. - `info` (`PDSMCInfoP`): (Filled by the method) A pointer to a structure that the method fills with information about `containingObj`. **Returns:** `void` **Exceptions** - `pdsErrBadPDF`: is raised if an error is found in the PDF file. It will also raise the error if the PDSMC passed to it is not in the structure tree. #### PDSMCGetPDEContainer ```cpp PDEContainer PDSMCGetPDEContainer(PDSMC mc) ``` Header: `PDSReadProcs.h:789` Gets the PDE container object for the specified marked content. **Parameters** - `mc` ([`PDSMC`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSMC)): The marked content whose container is obtained. **Returns:** [`PDEContainer`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEContainer) The PDE container object. #### PDSMCGetParent ```cpp void PDSMCGetParent(IN CosObj containingObj, IN PDSMC mc, OUT PDSElement *parent) ``` Header: `PDSReadProcs.h:500` Gets the parent element of the specified marked content. **Parameters** - `containingObj` (`IN CosObj`): The CosObj containing the MC whose parent is obtained. For marked content on a page, this is the Cos object representing the page. For marked content elsewhere, this is the stream in which the marked content resides. - `mc` (`IN PDSMC`): The marked content whose parent is obtained. - `parent` (`OUT PDSElement *`): (Filled by the method) The parent element of `containingObj`. **Returns:** `void` **Exceptions** - `pdsErrBadPDF`: is raised if an error is found in the PDF file. It will also raise the error if the PDSMC passed to it is not in the structure tree. **See also:** [`PDSElementGetParent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetParent), [`PDSElementInsertMCAsKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementInsertMCAsKid), [`PDSElementRemoveKidMC`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementRemoveKidMC) #### PDSMCIDGetParent ```cpp ASBool PDSMCIDGetParent(ASInt32 mcid, CosObj containingObj, PDSElement *parent) ``` Header: `PDSReadProcs.h:781` Gets the parent element of the specified marked content, referred to by its containing object and marked-content identifier. **Parameters** - `mcid` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The identifier (MCID) of the marked content whose parent is obtained. - `containingObj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The CosObj containing the marked content whose parent is obtained. For marked content on a page, this is the Cos object representing the page. For marked content elsewhere, this is the stream in which the marked content resides. - `parent` ([`PDSElement *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElement)): (Filled by the method) The parent element of `containingObj`. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the parent is successfully obtained, `false` otherwise. **Exceptions** - `pdsErrBadPDF`: is raised if an error is found in the PDF file. It will also raise the error if the PDSMC passed to it is not in the structure tree. **See also:** [`PDSMCGetParent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSMCGetParent), [`PDSElementGetParent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetParent) #### PDSMCRefCreate ```cpp PDSMCRef PDSMCRefCreate(IN PDEElement container, IN CosDoc cosDoc, IN ASInt32 mcid) ``` Header: `PDSWriteProcs.h:868` Creates a reference handle to a piece of marked content that can be used to associate the content with structure. The handle can persist beyond the lifetime of the marked contents, allowing greater flexibility about when structure information can be created. This may raise various exceptions. **Note:** This must be called before placing the container within the content stream that owns it. **Note:** The handle will persist until PDSMCRefDestroy is called. **Note:** All values in the `PDSMCInfo` object apart from mcid are currently ignored. **Parameters** - `container` (`IN PDEElement`): The marked content to create a reference for. It must be either a PDEContainer or PDEBeginContainer. - `cosDoc` (`IN CosDoc`): The document within which the reference will be used. - `mcid` (`IN ASInt32`): The mcid to set for the container. **Returns:** [`PDSMCRef`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSMCRef) **See also:** [`PDSMCRefDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSMCRefDestroy), [`PDSElementInsertMCRefAsKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementInsertMCRefAsKid) #### PDSMCRefDestroy ```cpp void PDSMCRefDestroy(IN PDSMCRef ref) ``` Header: `PDSWriteProcs.h:884` Destroys a marked content reference created with PDSMCRefCreate(). This should only be called once the reference has been placed in the structure tree or if the reference is no longer needed. **Note:** If the PDSMCRef is associated with a PDSMC, it will be set as invalid and ignored on subsequent processing. **Parameters** - `ref` (`IN PDSMCRef`): The marked content reference to destroy. **Returns:** `void` **Exceptions** - `Unknown` **See also:** [`PDSMCRefCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSMCRefCreate), [`PDSElementInsertMCRefAsKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementInsertMCRefAsKid) ### Typedefs (2) #### PDSMC ```cpp typedef PDEContainer PDSMC ``` Header: `PDSExpT.h:117` Represents marked content, which are portions of the graphic content of a PDF document that may be included in the document's logical structure hierarchy. This type is identical with the PDFEdit layer type PDEContainer. **Note:** The write functions in the `PDSEdit` API are not available in Adobe Reader. #### PDSMCR ```cpp typedef CosObj PDSMCR ``` Header: `PDSExpT.h:109` PDSMCR ### Structures (1) #### PDSMCRef ```cpp typedef struct _t_PDSMCRef* PDSMCRef ``` Header: `PDSExpT.h:151` An opaque pointer type to a marked content reference handle. ## PDSRoleMap ### Functions (6) #### PDSRoleMapCopy ```cpp void PDSRoleMapCopy(IN PDSRoleMap srcRoleMap, IN PDSTreeRoot dstTreeRoot, OUT PDSRoleMap *dstRoleMap) ``` Header: `PDSWriteProcs.h:660` Makes a copy of a PDSRoleMap, making it the PDSRoleMap of the specified StructTreeRoot. This may raise various exceptions. **Parameters** - `srcRoleMap` (`IN PDSRoleMap`): The PDSRoleMap to copy. - `dstTreeRoot` (`IN PDSTreeRoot`): The structure tree root in which to place srcRoleMap. - `dstRoleMap` (`OUT PDSRoleMap *`): (Filled by the method) If not `NULL`, it points to the new, copied PDSRoleMap. **Returns:** `void` **See also:** [`PDSTreeRootGetRoleMap`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSTreeRootGetRoleMap) #### PDSRoleMapDoesMap ```cpp ASBool PDSRoleMapDoesMap(IN PDSRoleMap roleMap, IN ASAtom src, IN ASAtom dst) ``` Header: `PDSReadProcs.h:552` Determines whether the specified PDSRoleMap provides any mapping path for two given element types. **Parameters** - `roleMap` (`IN PDSRoleMap`): IN/OUT The PDSRoleMap. - `src` (`IN ASAtom`): IN/OUT The ASAtom for an element type whose mapping is tested. - `dst` (`IN ASAtom`): IN/OUT The ASAtom for an element type. Note that this may be a standard element type. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if an mapping path was found, `false` otherwise. **Exceptions** - `pdsErrBadPDF`: is raised if an error is found in the PDF file. **See also:** [`PDSRoleMapMap`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSRoleMapMap) #### PDSRoleMapGetDirectMap ```cpp ASAtom PDSRoleMapGetDirectMap(IN PDSRoleMap roleMap, IN ASAtom type) ``` Header: `PDSReadProcs.h:536` Gets the type, if any, directly mapped in the specified PDSRoleMap for the given element type. **Parameters** - `roleMap` (`IN PDSRoleMap`): The PDSRoleMap. - `type` (`IN ASAtom`): The ASAtom for an element type whose mapping is found. **Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom) The ASAtom for the equivalent type specified in `roleMap`, or ASAtomNull if type has no mapping in `roleMap`. **Exceptions** - `pdsErrBadPDF`: is raised if an error is found in the PDF file. **See also:** [`PDSRoleMapDoesMap`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSRoleMapDoesMap) #### PDSRoleMapMap ```cpp void PDSRoleMapMap(IN PDSRoleMap roleMap, IN ASAtom src, IN ASAtom dst) ``` Header: `PDSWriteProcs.h:616` Maps an element type (`src`) to another element type (`dst`) in the specified PDSRoleMap. **Parameters** - `roleMap` (`IN PDSRoleMap`): The PDSRoleMap in which to create a new mapping. - `src` (`IN ASAtom`): The element type to map to `dst`. - `dst` (`IN ASAtom`): The element type that `src` maps onto. Note that this may be a standard element type, such as P. **Returns:** `void` **Exceptions** - `ErrSysPDSEdit`: is raised if `src` is already mapped. **See also:** [`PDSRoleMapDoesMap`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSRoleMapDoesMap) #### PDSRoleMapUnMapDst ```cpp void PDSRoleMapUnMapDst(IN PDSRoleMap roleMap, IN ASAtom dst) ``` Header: `PDSWriteProcs.h:644` Makes the specified element type have no mapping. **Parameters** - `roleMap` (`IN PDSRoleMap`): The PDSRoleMap in which to un-map all element types that map onto the `dst` element type. - `dst` (`IN ASAtom`): The element type to which all mappings are removed. All element types that map to the `dst` element type are unmapped. **Returns:** `void` **Exceptions** - `pdsErrWrongTypeParameter` **See also:** [`PDSRoleMapUnMapSrc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSRoleMapUnMapSrc) #### PDSRoleMapUnMapSrc ```cpp void PDSRoleMapUnMapSrc(IN PDSRoleMap roleMap, IN ASAtom src, IN ASBool fixupOthers) ``` Header: `PDSWriteProcs.h:632` Makes the specified element type have no mapping. This may raise various exceptions. **Parameters** - `roleMap` (`IN PDSRoleMap`): IN/OUT The PDSRoleMap in which to un-map the `src` element type. - `src` (`IN ASAtom`): IN/OUT The element type whose mapping is removed. - `fixupOthers` (`IN ASBool`): IN/OUT If `true`, any element type that was directly mapped to `src` is mapped to whatever `src` previously mapped to. If `false`, PDSRoleMapUnMapSrc() only un-maps `src`. **Returns:** `void` **See also:** [`PDSRoleMapUnMapDst`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSRoleMapUnMapDst) ### Typedefs (1) #### PDSRoleMap ```cpp typedef CosObj PDSRoleMap ``` Header: `PDSExpT.h:130` Represents mappings of structural element types present in a PDF document to standard element types having similar uses. There is one PDSClassMap per document, associated with the PDSTreeRoot. **Note:** The write functions in the `PDSEdit` API are not available in Adobe Reader. ## PDSTreeRoot ### Functions (16) #### PDDocCreateStructTreeRoot ```cpp void PDDocCreateStructTreeRoot(IN PDDoc pdDoc, OUT PDSTreeRoot *treeRoot) ``` Header: `PDSWriteProcs.h:66` Creates a new StructTreeRoot element. If PDDocCreateStructTreeRoot() is called on a PDDoc that already has a structure tree root, it returns without modifying the document. It raises an exception if `pdDoc` already has a StructTreeRoot. **Parameters** - `pdDoc` (`IN PDDoc`): IN/OUT The PDDoc for which the StructTreeRoot element is created. - `treeRoot` (`OUT PDSTreeRoot *`): IN/OUT (Filled by the method) The newly-created StructTreeRoot element. **Returns:** `void` **See also:** [`PDDocGetStructTreeRoot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDDocGetStructTreeRoot), [`PDSTreeRootGetRoleMap`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSTreeRootGetRoleMap), [`PDSTreeRootGetClassMap`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSTreeRootGetClassMap), [`PDDocRemoveStructTreeRoot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDDocRemoveStructTreeRoot), [`PDSTreeRootCreateRoleMap`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSTreeRootCreateRoleMap), [`PDSTreeRootRemoveRoleMap`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSTreeRootRemoveRoleMap), [`PDSTreeRootCreateClassMap`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSTreeRootCreateClassMap), [`PDSTreeRootRemoveClassMap`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSTreeRootRemoveClassMap) #### PDDocGetStructTreeRoot ```cpp ASBool PDDocGetStructTreeRoot(IN PDDoc pdDoc, OUT PDSTreeRoot *treeRoot) ``` Header: `PDSReadProcs.h:59` Gets the structure tree root for a document. **Parameters** - `pdDoc` (`IN PDDoc`): The PDDoc whose root is obtained. - `treeRoot` (`OUT PDSTreeRoot *`): (Filled by the method) The structure tree root. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if structure tree root found, `false` otherwise. **See also:** [`PDDocCreateStructTreeRoot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDDocCreateStructTreeRoot), [`PDDocRemoveStructTreeRoot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDDocRemoveStructTreeRoot) #### PDDocRemoveStructTreeRoot ```cpp void PDDocRemoveStructTreeRoot(IN PDDoc pdDoc) ``` Header: `PDSWriteProcs.h:77` Removes, but does not destroy, the specified StructTreeRoot element from the specified PDDoc. **Parameters** - `pdDoc` (`IN PDDoc`): IN/OUT The PDDoc for which the StructTreeRoot element is removed. **Returns:** `void` **See also:** [`PDDocCreateStructTreeRoot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDDocCreateStructTreeRoot), [`PDDocGetStructTreeRoot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDDocGetStructTreeRoot) #### PDSTreeRootCreateClassMap ```cpp void PDSTreeRootCreateClassMap(IN PDSTreeRoot treeRoot, OUT PDSClassMap *classMap) ``` Header: `PDSWriteProcs.h:171` Creates a PDSClassMap in the specified tree root. Any previously existing PDSClassMap is unlinked. This may raise various exceptions. **Parameters** - `treeRoot` (`IN PDSTreeRoot`): The structure tree root in which to create a PDSClassMap. - `classMap` (`OUT PDSClassMap *`): (Filled by the method) The newly created PDSClassMap. **Returns:** `void` **See also:** [`PDSTreeRootGetClassMap`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSTreeRootGetClassMap), [`PDSTreeRootRemoveClassMap`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSTreeRootRemoveClassMap) #### PDSTreeRootCreateRoleMap ```cpp void PDSTreeRootCreateRoleMap(IN PDSTreeRoot treeRoot, OUT PDSRoleMap *roleMap) ``` Header: `PDSWriteProcs.h:140` Creates and sets the PDSRoleMap of the specified StructTreeRoot element. Any previously existing PDSRoleMap is unlinked. This may raise various exceptions. **Parameters** - `treeRoot` (`IN PDSTreeRoot`): The structure tree root in which to create a PDSRoleMap. - `roleMap` (`OUT PDSRoleMap *`): (Filled by the method) The newly created PDSRoleMap. **Returns:** `void` **See also:** [`PDSTreeRootGetRoleMap`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSTreeRootGetRoleMap), [`PDSTreeRootRemoveRoleMap`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSTreeRootRemoveRoleMap) #### PDSTreeRootGetClassMap ```cpp ASBool PDSTreeRootGetClassMap(IN PDSTreeRoot treeRoot, OUT PDSClassMap *classMap) ``` Header: `PDSReadProcs.h:120` Gets the PDSClassMap object for the specified structure tree root. This may throw various exceptions. **Parameters** - `treeRoot` (`IN PDSTreeRoot`): The structure tree root whose PDSClassMap is obtained. - `classMap` (`OUT PDSClassMap *`): (Filled by the method) A pointer to a location in which to return the class map, if one exists. Set it to CosNull if there is no class map. If a `NULL` pointer is passed, no retrieval will take place. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if there is a class map, `false` otherwise. **See also:** [`PDSTreeRootCreateClassMap`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSTreeRootCreateClassMap) #### PDSTreeRootGetElementFromID ```cpp ASBool PDSTreeRootGetElementFromID(IN PDSTreeRoot treeRoot, IN const char *id, IN ASInt32 numChars, OUT PDSElement *element) ``` Header: `PDSReadProcs.h:140` Gets the element associated with the given ID, if any. **Parameters** - `treeRoot` (`IN PDSTreeRoot`): The structure tree root in which to search for `id`. - `id` (`IN const char *`): A pointer to a buffer containing the ID to search for.`id`. - `numChars` (`IN ASInt32`) - `element` (`OUT PDSElement *`): (Filled by the method) The element corresponding to `id`. It is undefined if no element has the specified `id`.`true` if an element for `id` is found, or `false` with element undefined if the tree root contains no IDTree value. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) **Exceptions** - `pdsErrWrongTypeParameter`: is raised if `id` is `NULL` or `numChars` is zero or less. - `pdsErrWrongTypeEntry`: is raised if the `IDTree` value in `treeRoot` is not a dictionary. **See also:** [`PDSElementGetID`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSElementGetID) #### PDSTreeRootGetKid ```cpp void PDSTreeRootGetKid(IN PDSTreeRoot treeRoot, IN ASInt32 index, OUT PDSElement *kid) ``` Header: `PDSReadProcs.h:86` Gets the kid at an array index in the specified structure tree root. **Parameters** - `treeRoot` (`IN PDSTreeRoot`): The structure tree root whose kid is obtained. - `index` (`IN ASInt32`): The index of the kid to obtain. - `kid` (`OUT PDSElement *`): (Filled by the method) A pointer to the kid at `index`. **Returns:** `void` **Exceptions** - `pdsErrBadPDF`: is raised if an error is found in the PDF file. **See also:** [`PDSTreeRootGetNumKids`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSTreeRootGetNumKids) #### PDSTreeRootGetNumKids ```cpp ASInt32 PDSTreeRootGetNumKids(IN PDSTreeRoot treeRoot) ``` Header: `PDSReadProcs.h:71` Gets the number of kids of the structure tree root. This may throw various exceptions. **Parameters** - `treeRoot` (`IN PDSTreeRoot`): IN/OUT The structure tree root whose number of kids is obtained. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The number of kids of the structure tree root. **See also:** [`PDSTreeRootGetKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSTreeRootGetKid) #### PDSTreeRootGetRoleMap ```cpp ASBool PDSTreeRootGetRoleMap(IN PDSTreeRoot treeRoot, OUT PDSRoleMap *roleMap) ``` Header: `PDSReadProcs.h:103` Gets the PDSRoleMap object for the specified structure tree root. This may throw various exceptions. **Parameters** - `treeRoot` (`IN PDSTreeRoot`): The structure tree root whose PDSRoleMap is obtained. - `roleMap` (`OUT PDSRoleMap *`): (Filled by the method) A pointer to a location in which to return the role map, if one exists. Set it to CosNull if there is no role map. If a `NULL` pointer is passed, no retrieval will take place. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if there is a role map, `false` otherwise. **See also:** [`PDSTreeRootCreateRoleMap`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSTreeRootCreateRoleMap) #### PDSTreeRootInsertKid ```cpp void PDSTreeRootInsertKid(IN PDSTreeRoot treeRoot, IN PDSElement kid, IN ASInt32 insertAfter) ``` Header: `PDSWriteProcs.h:95` Inserts the specified kid element after the given position as a kid of the specified structure tree root. This may raise various exceptions. **Parameters** - `treeRoot` (`IN PDSTreeRoot`): IN/OUT The structure tree root in which a kid is inserted. - `kid` (`IN PDSElement`): IN/OUT The kid to insert. - `insertAfter` (`IN ASInt32`): IN/OUT The position after which the kid is inserted. If `element` currently has no kids, `insertAfter` is ignored. **Returns:** `void` **See also:** [`PDSTreeRootRemoveKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSTreeRootRemoveKid), [`PDSTreeRootReplaceKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSTreeRootReplaceKid) #### PDSTreeRootRemoveClassMap ```cpp void PDSTreeRootRemoveClassMap(IN PDSTreeRoot treeRoot) ``` Header: `PDSWriteProcs.h:184` Removes the PDSClassMap of the specified structure tree root element. It does nothing if one does not exist. This may raise various exceptions. **Parameters** - `treeRoot` (`IN PDSTreeRoot`): The structure tree root whose PDSClassMap is removed. **Returns:** `void` **See also:** [`PDSTreeRootCreateClassMap`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSTreeRootCreateClassMap) #### PDSTreeRootRemoveKid ```cpp void PDSTreeRootRemoveKid(IN PDSTreeRoot treeRoot, IN PDSElement kid) ``` Header: `PDSWriteProcs.h:110` Removes the specified kid element from the specified structure tree root. This may raise various exceptions. **Parameters** - `treeRoot` (`IN PDSTreeRoot`): IN/OUT The structure tree root whose kid is removed. - `kid` (`IN PDSElement`): IN/OUT The kid to remove. **Returns:** `void` **See also:** [`PDSTreeRootInsertKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSTreeRootInsertKid), [`PDSTreeRootReplaceKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSTreeRootReplaceKid) #### PDSTreeRootRemoveRoleMap ```cpp void PDSTreeRootRemoveRoleMap(IN PDSTreeRoot treeRoot) ``` Header: `PDSWriteProcs.h:154` Removes the PDSRoleMap of the specified structure tree root element. It does nothing if one does not exist. This may raise various exceptions. **Parameters** - `treeRoot` (`IN PDSTreeRoot`): The structure tree root whose PDSRoleMap is removed. **Returns:** `void` **See also:** [`PDSTreeRootCreateRoleMap`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSTreeRootCreateRoleMap), [`PDSTreeRootGetRoleMap`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSTreeRootGetRoleMap) #### PDSTreeRootReplaceKid ```cpp void PDSTreeRootReplaceKid(IN PDSTreeRoot treeRoot, IN PDSElement oldKid, IN PDSElement newKid) ``` Header: `PDSWriteProcs.h:124` Replaces structural element `oldKid` with `element` `newKid` as a kid of `treeRoot`. This may raise various exceptions. @since **Parameters** - `treeRoot` (`IN PDSTreeRoot`): IN/OUT The structure tree root whose kid is replaced. - `oldKid` (`IN PDSElement`): IN/OUT The kid to replace. - `newKid` (`IN PDSElement`): IN/OUT The kid that is replacing `oldKid`. **Returns:** `void` **See also:** [`PDSTreeRootInsertKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSTreeRootInsertKid), [`PDSTreeRootRemoveKid`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSTreeRootRemoveKid) #### PDSTreeRootReplaceStreamRef ```cpp void PDSTreeRootReplaceStreamRef(PDSTreeRoot treeRoot, CosObj oldStream, CosObj newStream) ``` Header: `PDSWriteProcs.h:842` Updates the stream entries (Stm) in marked content reference dictionaries to reference a new Cos stream object. It replaces references to the old stream with refererences to the new stream. This may raise various exceptions. **Parameters** - `treeRoot` ([`PDSTreeRoot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDSTreeRoot)): The structure tree root in which stream references are updated. - `oldStream` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The stream reference to replace. - `newStream` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): The stream reference that is replacing `oldStream`. **Returns:** `void` ### Typedefs (1) #### PDSTreeRoot ```cpp typedef CosObj PDSTreeRoot ``` Header: `PDSExpT.h:93` The root of the structure tree, which is a central repository for information related to a PDF document's logical structure. There is at most one PDSTreeRoot in each document. **See also:** [`PDDocCreateStructTreeRoot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDDocCreateStructTreeRoot), [`PDDocGetStructTreeRoot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDDocGetStructTreeRoot), [`PDDocRemoveStructTreeRoot`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdslayer.md#PDDocRemoveStructTreeRoot) --- # PDFL Library Layer Source: https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer ## ASFileSys ### Functions (2) #### ASFileSysGetDefaultTempPath ```cpp ASPathName ASFileSysGetDefaultTempPath(ASFileSys fileSys) ``` Header: `PDFLProcs.h:159` Gets the default temporary path that was set by ASFileSysSetDefaultTempPath(). **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): The file system in which the ASPathname is set. **Returns:** [`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName) The ASPathName if the operation was successful, `NULL` otherwise. **See also:** [`ASFileSysSetDefaultTempPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#ASFileSysSetDefaultTempPath) #### ASFileSysSetDefaultTempPath ```cpp ASBool ASFileSysSetDefaultTempPath(ASFileSys fileSys, ASPathName pathName) ``` Header: `PDFLProcs.h:148` Sets the default temporary path for the specified file system to the specified path name. The method copies the passed `pathname` object on success; the client is responsible for releasing the object when it is no longer needed, using ASFileSysReleasePath(). Pass a pathname of `NULL` to reset the default temporary path to the file system default. **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): (May be `NULL`) The file system in which to set the default temporary path. - `pathName` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): The path name for the new default temporary path, or `NULL` to reset to the file system default. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `false` if the path provided is not writable, `true` otherwise. **See also:** [`ASFileSysGetDefaultTempPath`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#ASFileSysGetDefaultTempPath) ## CosDoc ### Definitions (1) #### cosSaveWriteXref Header: `PDFLExpT.h:2503` Value: `0x20` Flags for CosDocSave saveFlags parameter. This is specific to the PDF Library. ## General ### Functions (23) #### ASAtomGetCount ```cpp ASInt32 ASAtomGetCount(void) ``` Header: `PDFLProcs.h:128` Gets the number of ASAtom objects that have been allocated. The maximum number of ASAtom objects is `0xFFFFFFFF`. (This was a 16-bit value in Acrobat 4.x, and changed to a 32-bit value in Acrobat 5.0). ASAtom objects cannot be deleted or freed. Use this method to determine if it is necessary to re-initialize the library before creating more ASAtom objects. **Parameters** - (unnamed) (`void`) **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The number of ASAtom objects currently allocated. **See also:** [`ASAtomExistsForString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtomExistsForString), [`PDFLInit`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFLInit), [`PDFLTerm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFLTerm) #### ASPurgeMemory ```cpp ASSize_t ASPurgeMemory(ASSize_t amount) ``` Header: `PDFLProcs.h:111` Attempts to free memory from the PDF Library caches. The caches in the PDF Library can grow in complex and unexpected ways. A client can manage memory use with the PDFLInit memory callbacks, or by explicitly calling this function after certain functions, such as PDDocClose(). To manage memory use with the memory callbacks, a client can call ASPurgeMemory() during the allocation callback if it is low on memory, or to limit the amount of memory used by the library. Use this approach only with extreme caution and extensive testing. The run-time memory requirements are very document-specific. **Parameters** - `amount` ([`ASSize_t`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASSize_t)): The desired amount of memory to free. **Returns:** [`ASSize_t`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASSize_t) The approximate amount of memory freed. **See also:** [`PDFLInit`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFLInit), [`PDFLTerm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFLTerm) #### AVExtensionMgrRegisterNotification ```cpp void AVExtensionMgrRegisterNotification(NSelector nsel, ASExtension owner, void *proc, void *clientData) ``` Header: `PDFLProcs.h:593` Registers a user-supplied procedure to call when the event of the specified type occurs. This is exactly the same as the AVAppRegisterNotification() method. All of the PD level notifications are available with the Adobe PDF Library. **Parameters** - `nsel` ([`NSelector`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#NSelector)): Notification type. It must be one of the notification selectors. The notification selector is the name of the notification with the characters `NSEL` appended. For example, the selector for PDDocDidPrintPage() is `PDDocDidPrintPageNSEL`. Only the PD-level notifications are available with the Adobe PDF Library. - `owner` ([`ASExtension`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASExtension)): Identifies the owner. For the Adobe PDF Library, if there is only one owner of the PDFEdit subsystem, `owner` should be zero. If there are multiple owners, each should specify a nonzero, non-negative owner. (A negative owner is reserved for the implementation). - `proc` (`void *`): A user-supplied callback to be called when the notification occurs. Its declaration depends on the notification type. - `clientData` (`void *`): A pointer to user-supplied data to pass to `proc` each time it is called. **Returns:** `void` **See also:** [`AVExtensionMgrUnregisterNotification`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#AVExtensionMgrUnregisterNotification), `AVAppRegisterNotification` #### AVExtensionMgrUnregisterNotification ```cpp void AVExtensionMgrUnregisterNotification(NSelector nsel, ASExtension owner, void *proc, void *clientData) ``` Header: `PDFLProcs.h:613` Unregisters a user-supplied procedure to call when the specified event occurs. This is exactly the same as the AVAppUnregisterNotification() method. **Parameters** - `nsel` ([`NSelector`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#NSelector)): Notification type. It must be one of the notification selectors. The notification selector is the name of the notification with the characters `NSEL` appended. For example, the selector for PDDocDidOpen() is `PDDocDidOpenNSEL`. - `owner` ([`ASExtension`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASExtension)): Identifies the owner with which the notification was registered. - `proc` (`void *`): A user-supplied callback with which the notification was registered. - `clientData` (`void *`): A pointer to user-supplied data that was used when the notification was registered. **Returns:** `void` **See also:** [`AVExtensionMgrRegisterNotification`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#AVExtensionMgrRegisterNotification), `AVAppUnregisterNotification` #### CosSetExternalFilePermissionProc ```cpp void CosSetExternalFilePermissionProc(ExternalFilePermissionProc proc) ``` Header: `PDFLProcs.h:820` **Parameters** - `proc` ([`ExternalFilePermissionProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#ExternalFilePermissionProc)) **Returns:** `void` #### PDFLGetCoreHFT ```cpp HFT PDFLGetCoreHFT(void) ``` Header: `PDFInit.h:1006` Gets the Core HFT. **Parameters** - (unnamed) (`void`) **Returns:** [`HFT`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#HFT) The Core HFT object. **See also:** [`PDFLInit`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFLInit) #### PDFLGetFlags ```cpp ASUns32 PDFLGetFlags(void) ``` Header: `PDFLProcs.h:719` Gets the flags set when the PDF Library was initialized. Currently `kPDFLInitIgnoreDefaultDirectories` , `kPDFLInitIgnoreSystemFonts` and `kDontLoadPlugIns` flags are supported. When `kPDFLInitIgnoreDefaultDirectories` flag is set, the initialization process does not search through the default font directories (currently Adobe font directories installed by some Adobe applications), but only searches for fonts in those directories specified in `dirList`. A default directory could appear as follows: C:\Program Files\Common Files\Adobe\PDFL\[*version number*]\Fonts C:\Program Files\Common Files\Adobe\PDFL\[*version number*]\CMaps When `kPDFLInitIgnoreSystemFonts` flag is set, the initialization process does not search through default System fonts also. When the `kDontLoadPlugIns` flag is set, plug-ins are ignored during initialization process. **Parameters** - (unnamed) (`void`) **Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32) The initialization flags value. **See also:** [`PDFLInit`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFLInit) #### PDFLGetInitCount ```cpp ASUns32 PDFLGetInitCount(void) ``` Header: `PDFLProcs.h:697` Gets the number of times the PDF Library has been initialized. **Parameters** - (unnamed) (`void`) **Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32) The number of times the PDF Library has been initialized. **See also:** [`PDFLInit`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFLInit) #### PDFLGetVersion ```cpp ASUns32 PDFLGetVersion(void) ``` Header: `PDFLProcs.h:668` Gets the value of the Adobe PDF Library version (kPDFLVersion). The most significant 16 bits are the major version number; the least significant 16 bits are the minor version number. The major version number indicates whether any incompatible API changes have been made. The minor version number indicates that the API has changed, but in a compatible fashion. **Note:** Obsolete in PDF Library 6.0. Use HFTGetVersion() instead. **Parameters** - (unnamed) (`void`) **Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32) Adobe PDF Library version (kPDFLVersion). **See also:** [`PDFLTerm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFLTerm) #### PDFLInit ```cpp ASInt32 PDFLInit(PDFLData data) ``` Header: `PDFInit.h:974` Initializes the Adobe PDF Library. This method must be called before any other Library calls can be made, printing or otherwise. **Parameters** - `data` (`PDFLData`): Initialization data for Adobe PDF Library. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) `0` if initialization was successful, or an error code if it was not. Use `ASGetErrorString()` to convert any error code to a string. **See also:** [`PDFLGetFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFLGetFlags), [`PDFLGetInitCount`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFLGetInitCount), [`PDFLTerm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFLTerm) #### PDFLInitHFT ```cpp ASInt32 PDFLInitHFT(PDFLData data) ``` Header: `PDFInit.h:981` **Parameters** - `data` (`PDFLData`) **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) #### PDFLInitThreadLocalData ```cpp void * PDFLInitThreadLocalData(ThreadLocalKey *key, ASUns32 size) ``` Header: `PDFInit.h:999` **Parameters** - `key` ([`ThreadLocalKey *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#ThreadLocalKey)) - `size` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)) **Returns:** `void *` #### PDFLReinitHFT ```cpp ASInt32 PDFLReinitHFT(void) ``` Header: `PDFInit.h:993` **Parameters** - (unnamed) (`void`) **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) #### PDFLTerm ```cpp void PDFLTerm(void) ``` Header: `PDFLProcs.h:678` Terminates the Adobe PDF Library. Call this method after you are completely done using the library. Call this once to terminate and release memory used by the library. After the library has been shut down, the process should terminate. **Parameters** - (unnamed) (`void`) **Returns:** `void` **See also:** [`PDFLInit`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFLInit) #### PDFLTermHFT ```cpp void PDFLTermHFT(void) ``` Header: `PDFInit.h:983` **Parameters** - (unnamed) (`void`) **Returns:** `void` #### PDFLibraryRegisterNotification ```cpp void PDFLibraryRegisterNotification(NSelector nsel, ASExtension owner, void *proc, void *clientData) ``` Header: `PDFLProcs.h:62` Registers a user-supplied procedure to call when the specified event occurs. This is exactly the same as the AVAppRegisterNotification method. All of the PD level notifications are available with the Adobe PDF Library. **Parameters** - `nsel` ([`NSelector`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#NSelector)): Notification type. It must be one of the notification selectors. The notification selector is the name of the notification with the characters `NSEL` appended. For example, the selector for PDDocDidPrintPage() is `PDDocDidPrintPageNSEL`. Only the PD-level notifications are available with the Adobe PDF Library. - `owner` ([`ASExtension`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASExtension)): Identifies the owner. For the Adobe PDF Library, if there is only one owner of the PDFEdit subsystem, `owner` should be zero. If there are multiple owners, each should specify a nonzero, non-negative owner. (A negative owner is reserved for the implementation). - `proc` (`void *`): A user-supplied callback to be called when the notification occurs. Its declaration depends on the notification type. - `clientData` (`void *`): A pointer to user-supplied data to pass to `proc` each time it is called. **Returns:** `void` **See also:** [`AVExtensionMgrRegisterNotification`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#AVExtensionMgrRegisterNotification), `AVAppRegisterNotification`, [`PDFLibraryUnregisterNotification`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFLibraryUnregisterNotification) #### PDFLibraryRegisterNotificationEx ```cpp void PDFLibraryRegisterNotificationEx(NSelector nsel, ASExtension owner, void *proc, void *clientData, ASInt32 priority) ``` Header: `PDFLProcs.h:818` Registers a user-supplied procedure to call when the specified event occurs. Many notifications appear in Will/Did pairs (for example, AVDocWillPerformAction() and AVDocDidPerformAction()). It is possible that an operation may fail after the Will notification and before the Did notification. When this occurs, the Did notification is still broadcast, but the `err` parameter in the Did notification is nonzero, and represents the error that occurred. When `err` is nonzero, the other parameters are not necessarily valid. Always check `err` in a Did notification before using the other parameters. When calling AVAppUnregisterNotification() to un-register for a notification, you must pass the `proc`, `clientData`, and `owner` that were used when the notification was registered using AVAppRegisterNotification(). You must use the same callback that was used to register; you cannot use a newly created callback. To accomplish this, call ASCallbackCreateNotification() once before registering, and use the value returned from this call both to register and un-register; do not call ASCallbackCreateNotification() a second time when un-registering. You will then need to destroy the pointer to the callback using the ASCallbackDestroy() method. **Parameters** - `nsel` ([`NSelector`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#NSelector)): The notification type. It must be one of the notification selectors . The notification selector is the name of the notification with the characters `NSEL` appended. For example, the selector for AVDocDidOpen() is `AVDocDidOpenNSEL`. - `owner` ([`ASExtension`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASExtension)): The gExtensionID of the client registering the notification. - `proc` (`void *`): A user-supplied callback to call when the notification occurs. Its declaration depends on the notification type. Remember to use ASCallbackCreateNotification() to convert `proc` to a callback before passing it to AVAppRegisterNotification(). - `clientData` (`void *`): A pointer to user-supplied data to pass to `proc` each time it is called. - `priority` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The callbacks are enumerated in priority order, starting with the highest priority. **Returns:** `void` #### PDFLibraryRegisterRNG ```cpp void PDFLibraryRegisterRNG(PDFLClientRNGProc clientRNG) ``` Header: `PDFLProcs.h:833` Registers a user-supplied random number generator. By default, the PDF Library obtains high-quality random values from the operating system (`CryptGenRandom()` on Windows, and `/dev/random` on Mac OS and many UNIX operating systems). This method allows an alternate handler to be used. The random numbers returned should be of high quality, and it is the responsibility of the developer to ensure this. A `NULL` parameter will reset to default behavior. **Parameters** - `clientRNG` ([`PDFLClientRNGProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFLClientRNGProc)): A client-supplied function that supplies the strong random values. **Returns:** `void` **See also:** [`PDFLClientRNGProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFLClientRNGProc) #### PDFLibraryUnregisterNotification ```cpp void PDFLibraryUnregisterNotification(NSelector nsel, ASExtension owner, void *proc, void *clientData) ``` Header: `PDFLProcs.h:87` Unregisters a user-supplied procedure to call when the specified event occurs. This is exactly the same as the AVAppUnregisterNotification() method. **Parameters** - `nsel` ([`NSelector`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#NSelector)): Notification type. It must be one of the notification selectors. The notification selector is the name of the notification with the characters `NSEL` appended. For example, the selector for PDDocDidOpen() is `PDDocDidOpenNSEL`. - `owner` ([`ASExtension`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASExtension)): Identifies the owner. For the PDF Library, if there is only one owner of the PDFEdit subsystem, `owner` should be zero. If there are multiple owners, each should specify a nonzero, non-negative owner. (A negative owner is reserved for the implementation). - `proc` (`void *`): A user-supplied callback to be called when the notification occurs. Its declaration depends on the notification type. You must use the same callback that you called AVExtensionMgrRegisterNotification() with. - `clientData` (`void *`): A pointer to user-supplied data to pass to `proc` each time it is called. **Returns:** `void` **See also:** [`PDFLibraryRegisterNotification`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFLibraryRegisterNotification), `AVAppUnregisterNotification` #### PDOCRegisterFindOutAutoStatePrefProc ```cpp void PDOCRegisterFindOutAutoStatePrefProc(PDOCFindOutAutoStatePrefProc proc) ``` Header: `PDFLProcs.h:853` Registers a callback to the client user interface that can tell the core what the current AutoState preference is. **Parameters** - `proc` ([`PDOCFindOutAutoStatePrefProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDOCFindOutAutoStatePrefProc)) **Returns:** `void` #### PDOCRegisterFindOutLanguageProc ```cpp void PDOCRegisterFindOutLanguageProc(PDOCFindOutLanguageProc proc) ``` Header: `PDFLProcs.h:843` Registers a callback to the client user interface that can tell the core what the current language is. **Parameters** - `proc` ([`PDOCFindOutLanguageProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDOCFindOutLanguageProc)) **Returns:** `void` #### PDOCRegisterFindOutUserProc ```cpp void PDOCRegisterFindOutUserProc(PDOCFindOutUserProc proc) ``` Header: `PDFLProcs.h:848` Registers a callback to the client user interface that can tell the core what the current user is. **Parameters** - `proc` ([`PDOCFindOutUserProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDOCFindOutUserProc)) **Returns:** `void` #### PDOCRegisterFindOutZoomProc ```cpp void PDOCRegisterFindOutZoomProc(PDOCFindOutZoomProc proc) ``` Header: `PDFLProcs.h:838` Registers a callback to the client user interface that can tell the core what the current zoom level is. **Parameters** - `proc` ([`PDOCFindOutZoomProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDOCFindOutZoomProc)) **Returns:** `void` ### Typedefs (17) #### NSelector ```cpp typedef Int32 NSelector ``` Header: `PDFLExpT.h:73` #### PDDuplexEnum ```cpp typedef ASEnum8 PDDuplexEnum ``` Header: `PDFLExpT.h:406` #### PDEncodingType ```cpp typedef ASInt32 PDEncodingType ``` Header: `PDFLExpT.h:1563` #### PDFarEastFont ```cpp typedef ASEnum8 PDFarEastFont ``` Header: `PDFLExpT.h:163` CJK font related option for PostScript printing. #### PDInclusion ```cpp typedef ASEnum8 PDInclusion ``` Header: `PDFLExpT.h:120` Specifies how to include a resource in a file. #### PlatformBitmapPtr ```cpp typedef void* PlatformBitmapPtr ``` Header: `PDFLExpT.h:52` #### PlatformWindowPtr ```cpp typedef void* PlatformWindowPtr ``` Header: `PDFLExpT.h:51` #### ThreadLocalKey ```cpp typedef pthread_key_t ThreadLocalKey ``` Header: `PDFInit.h:421` PDFLData structure for PDFLInit. #### ExternalFilePermissionProc ```cpp typedef ASBool(*) ExternalFilePermissionProc(CosDoc dP, ASFileSys *fileSys, ASPathName *path)(CosDoc dP, ASFileSys *fileSys, ASPathName *path) ``` Header: `PDFLExpT.h:87` #### PDDoExtGStateProc ```cpp typedef ASBool(*) PDDoExtGStateProc(ASAtom egsKey, CosObj egsValue, PDPrintClient printClient)(ASAtom egsKey, CosObj egsValue, PDPrintClient printClient) ``` Header: `PDFLExpT.h:1812` A callback method that is called when an ExtGState object is encountered. This method is called for each key/value pair in the ExtGState object. If this method returns `true`, then the key/value will be emitted into the print job. If this method returns `false`, then nothing will be emitted for this key/value. If `emitHalftones` is `false`, then this method will not be called for the HT key. **See also:** [`PDDocPrintPages`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDDocPrintPages) #### PDFLClientRNGProc ```cpp typedef ASSize_t(*) PDFLClientRNGProc(ASSize_t len, ASUns8P buffer)(ASSize_t len, ASUns8P buffer) ``` Header: `PDFLExpT.h:106` A callback for PDFLibraryRegisterRNG(). It is called once to provide random data for encryption. Normally an operating system supplied source of highly random numbers is used (`/dev/urandom` on Mac OS and Unix, `CryptGenRandom()` on Windows). For some supported Unix environments, the `/dev/urandom` device does not exist. While it is preferable to install this device, the PDFLibraryRegisterRNG() function is provided for the client to register an alternate source for strong random data. **See also:** [`PDFLibraryRegisterRNG`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFLibraryRegisterRNG) #### PDOCFindOutAutoStatePrefProc ```cpp typedef ASBool(*) PDOCFindOutAutoStatePrefProc()() ``` Header: `PDFLExpT.h:2500` Declare the type PDOCFindOutAutoStatePrefProc, which is a callback that lets the client set the AutoState preference. #### PDOCFindOutLanguageProc ```cpp typedef char *(*) PDOCFindOutLanguageProc()() ``` Header: `PDFLExpT.h:2494` Declare the type PDOCFindOutLanguageProc, which is a callback that lets the client set the current user interface language level. #### PDOCFindOutUserProc ```cpp typedef ASText(*) PDOCFindOutUserProc(ASAtom indTtlOrOrg)(ASAtom indTtlOrOrg) ``` Header: `PDFLExpT.h:2497` Declare the type PDOCFindOutUserProc, which is a callback that lets the client set the current user interface user level. #### PDOCFindOutZoomProc ```cpp typedef float(*) PDOCFindOutZoomProc(PDDoc pdDoc)(PDDoc pdDoc) ``` Header: `PDFLExpT.h:2491` Declare the type PDOCFindOutZoomProc, which is a callback that lets the client set the current user interface zoom level. #### TKResourceAcquireProc ```cpp typedef void *(*) TKResourceAcquireProc(char *resourceName, ASInt32 resType, void *registry, ASInt32 *size, void *clientData, ASStm *rdStm)(char *resourceName, ASInt32 resType, void *registry, ASInt32 *size, void *clientData, ASStm *rdStm) ``` Header: `PDFInit.h:286` A callback in the `TKResourceProcs` structure in the Adobe PDF Library. It acquires the specified resource and uses it to fill in the `rdStm` parameter. **See also:** [`TKResourceReleaseProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#TKResourceReleaseProc), [`PDFLInit`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFLInit) #### TKResourceReleaseProc ```cpp typedef void(*) TKResourceReleaseProc(ASStm rdStm, void *data, void *clientData)(ASStm rdStm, void *data, void *clientData) ``` Header: `PDFInit.h:303` A callback in the `TKResourceProcs` structure in the Adobe PDF Library. It releases the resources previously acquired and closes the ASStm passed in as `rdStm`. **See also:** [`PMSetTextProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#PMSetTextProc), [`PDFLInit`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFLInit) ### Structures (1) #### TextServer ```cpp typedef struct _t_TextServer* TextServer ``` Header: `PDFLExpT.h:1509` Text server. ### Definitions (7) #### AVPS_MAC_ROMAN_ENC Header: `PDFLExpT.h:1774` Value: `101` Encoding identifiers (for TE). #### AVPS_WIN_ANSI_ENC Header: `PDFLExpT.h:1776` Value: `102` #### BAD_NSELECTOR Header: `PDFLExpT.h:74` Value: `(-1)` #### DLADD_disableFlattening Header: `PDFLExpT.h:1032` Value: `1` #### _T_NSELECTOR Header: `PDFLExpT.h:72` #### __defedPlatformTypes Header: `PDFLExpT.h:54` #### kPDFLVersion Header: `PDFInit.h:49` Value: `0x00120003` ## PDDoc ### Functions (1) #### PDDocPrintPages ```cpp void PDDocPrintPages(PDPrintClient client) ``` Header: `PDFLProcs.h:186` Prints a range of pages from a document, controlled by a structure of data and callbacks. **Note:** This low-level method should be avoided; use the higher-level PDFLPrintDoc() instead. **Parameters** - `client` ([`PDPrintClient`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPrintClient)): Control structure for the operation, containing data and callback procedures. **Returns:** `void` **Exceptions** - `genErrBadParm`: @notify PSPrintAfterBeginPageSetup @notify PSPrintAfterBeginProlog @notify PSPrintAfterBeginSetup @notify PSPrintAfterEmitExtGState @notify PSPrintAfterPageTrailer @notify PSPrintAfterTrailer @notify PSPrintBeforeEndComments @notify PSPrintBeforeEndSetup **See also:** [`PDFLInit`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFLInit), [`PDFLPrintDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFLPrintDoc) ## PDFLPrint ### Functions (3) #### PDFLPrintDoc ```cpp void PDFLPrintDoc(PDDoc doc, PDFLPrintUserParams userParams) ``` Header: `PDFLProcs.h:743` Prints a PDF document or pages from a PDF document allowing the caller to specify options such as page size, rotation, and shrink-to-fit. **Note:** Users of the PDFLPrintDoc() method do not have to create the PDPrintClient() callbacks. That detail is handled by the library. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The PDDoc for the document to print. - `userParams` ([`PDFLPrintUserParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFLPrintUserParams)): Parameters to control printing. **Returns:** `void` **Exceptions** - `cosErrWriteError` - `pdErrOpNotPermitted` - `genErrBadParm`: @notify PSPrintAfterBeginPageSetup @notify PSPrintAfterBeginProlog @notify PSPrintAfterBeginSetup @notify PSPrintAfterEmitExtGState @notify PSPrintAfterPageTrailer @notify PSPrintAfterTrailer @notify PSPrintBeforeEndComments @notify PSPrintBeforeEndSetup #### PDFLPrintDocEx ```cpp void PDFLPrintDocEx(PDDoc doc, PDFLPrintUserParamsEx userParams) ``` Header: `PDFLProcs.h:774` Prints a PDF document or pages from a PDF document allowing the caller to specify options such as page size, rotation, and shrink-to-fit. **Note:** Users of the PDFLPrintDoc() method do not have to create the PDPrintClient() callbacks. That detail is handled by the library. **Note:** Platform: (WIN_ENV) **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The PDDoc for the document to print. - `userParams` ([`PDFLPrintUserParamsEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFLPrintUserParamsEx)): Parameters to control printing. **Returns:** `void` **Exceptions** - `cosErrWriteError` - `pdErrOpNotPermitted` - `genErrBadParm`: @notify PSPrintAfterBeginPageSetup @notify PSPrintAfterBeginProlog @notify PSPrintAfterBeginSetup @notify PSPrintAfterEmitExtGState @notify PSPrintAfterPageTrailer @notify PSPrintAfterTrailer @notify PSPrintBeforeEndComments @notify PSPrintBeforeEndSetup #### PDFLPrintPDF ```cpp void PDFLPrintPDF(PDDoc pdDoc, ASPathName pathName, PDPrintParams psParams) ``` Header: `PDFLProcs.h:749` Deprecated: use PDFLPrintDoc() instead. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)) - `pathName` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)) - `psParams` ([`PDPrintParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPrintParams)) **Returns:** `void` ### Typedefs (10) #### PDOutputType ```cpp typedef ASEnum8 PDOutputType ``` Header: `PDFLExpT.h:142` Specifies what kind of file to emit. #### PDPrintMarkStyles ```cpp typedef ASInt32 PDPrintMarkStyles ``` Header: `PDFLExpT.h:1531` #### PDPrintTrapType ```cpp typedef ASEnum8 PDPrintTrapType ``` Header: `PDFLExpT.h:492` #### PDPrintWhatAnnot ```cpp typedef ASEnum8 PDPrintWhatAnnot ``` Header: `PDFLExpT.h:480` #### PDPrintWhatFlip ```cpp typedef ASEnum8 PDPrintWhatFlip ``` Header: `PDFLExpT.h:489` #### PDFLPrintCancelProc ```cpp typedef ASBool(*) PDFLPrintCancelProc(PDDoc pdDoc, void *clientData)(PDDoc pdDoc, void *clientData) ``` Header: `PDFLPrint.h:69` This is called once per page of a document being printed. In addition to giving the ability to cancel the print job, a developer can use this callback to return control briefly to an application to handle events, update UI elements, and so on. The library pauses printing until the return from this procedure, because it is single-threaded. **See also:** [`ASCancelProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCancelProc), [`CancelProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#CancelProc), `PDFLPrintUserParamsRec` #### PDFLPrintProgressProc ```cpp typedef ASBool(*) PDFLPrintProgressProc(ASInt32 pageNum, ASInt32 totalPages, float current, const char *name, ASInt32 stage, void *progMonClientData)(ASInt32 pageNum, ASInt32 totalPages, float current, const char *name, ASInt32 stage, void *progMonClientData) ``` Header: `PDFLPrint.h:112` A print progress callback. **See also:** [`PDFLFlattenProgressMarker`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#PDFLFlattenProgressMarker) #### PDPrintCanEmitFontProc ```cpp typedef ASBool(*) PDPrintCanEmitFontProc(PDFont fontP, PDPrintClient printClient)(PDFont fontP, PDPrintClient printClient) ``` Header: `PDFLExpT.h:1867` (Optional) A callback for PDPrintClient. It is called to determine whether a font can be emitted into the print job. This is used to determine whether a font is a document-included resource. Only used for PostScript printing. If it is `NULL`, the default is to assume that any font can be emitted. **See also:** [`PDDocPrintPages`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDDocPrintPages) #### PDPrintEmitFontProc ```cpp typedef ASBool(*) PDPrintEmitFontProc(ASStm stm, PDFont fontP, PDPrintClient printClient, ASUns32 flags)(ASStm stm, PDFont fontP, PDPrintClient printClient, ASUns32 flags) ``` Header: `PDFLExpT.h:1849` (Required) A callback for PDPrintClient. It emits a font. For Type0 fonts that require font substition, this routine may emit multiple font definitions. The caller can get the list of fonts used by calling GetFontComponentList(). **See also:** [`PDDocPrintPages`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDDocPrintPages) #### PDPrintGetFontEncodingMethodProc ```cpp typedef ASInt32(*) PDPrintGetFontEncodingMethodProc(PDFont fontP, PDPrintClient printClient)(PDFont fontP, PDPrintClient printClient) ``` Header: `PDFLExpT.h:1833` (Required for PostScript printing) A callback for PDPrintClient. It asks the client which encoding method should be used for the font. Method Description kPDDoReencode Use for Type 1 fonts and substituted fonts. kPDDoNothing Use for TrueType Windows font or built-in encoding font. kPDDoXlate Use for a TrueType custom font or font with Mac OS encoding. **See also:** [`PDDocPrintPages`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDDocPrintPages) ### Structures (9) #### PDFLPrintUserCallbacks ```cpp typedef struct _t_PDFLPrintUserCallbacks* PDFLPrintUserCallbacks ``` Header: `PDFLExpT.h:2480` #### PDFLPrintUserParams ```cpp typedef struct _t_PDFLPrintUserParams* PDFLPrintUserParams ``` Header: `PDFLExpT.h:2486` Declare the type PDFLPrintUserParams, which is a pointer to a structure and is passed into PDFLPrintDoc. This structure is defined in `PDFLPrint.h`, but it is complex and platform-specific. This declaration avoids the need to include the platform specific details into files that just need a decaration of this pointer. #### PDFLPrintUserParamsEx ```cpp typedef struct _t_PDFLPrintUserParamsEx* PDFLPrintUserParamsEx ``` Header: `PDFLExpT.h:2488` #### PDPrintClient ```cpp typedef struct _t_PDPrintClient* PDPrintClient ``` Header: `PDFLExpT.h:1548` A data structure used by PDDocPrintPages(). It contains methods to be implemented by the client. Unless otherwise indicated, methods may be `NULL`, indicating that they do nothing. The methods are called in the order listed in this structure. #### PDPrintController ```cpp typedef struct _t_PDPrintController* PDPrintController ``` Header: `PDFLExpT.h:1549` #### PDPrintFontArrayP ```cpp typedef struct PDPrintFontArray * PDPrintFontArrayP ``` Header: `PDFLExpT.h:274` #### PDPrintFontP ```cpp typedef struct PDPrintFontRec * PDPrintFontP ``` Header: `PDFLExpT.h:257` #### PDPrintParams ```cpp typedef struct PDPrintParamsRec * PDPrintParams ``` Header: `PDFLExpT.h:1024` #### PDTileEx ```cpp typedef struct PDTileRecEx * PDTileEx ``` Header: `PDFLExpT.h:443` ### Enums (8) #### ALDImageColorType Header: `PDFLExpT.h:1581` OPI 1.3 color type information. **Values** - `ALDImageColorType_Spot = 0`: Spot color type. - `ALDImageColorType_Process = 1`: Process color type. - `ALDImageColorType_Separation = 2`: Separation color type. - `ALDImageColorType_Intrinsic = 3`: Intrinsic color type. #### ImageInk Header: `PDFLExpT.h:1663` OPI 2.0 image ink information. **Values** - `ImageInk_Registration = 0`: Image colorant registration value. - `ImageInk_FullColor = 1`: Image colorant full color value. - `ImageInk_Monochrome = 2`: Image colorant monochrome value #### OPIversion Header: `PDFLExpT.h:1571` OPI Types for PostScript printing. **Values** - `OPIv13 = 0`: OPI version 1.3. - `OPIv20 = 1`: OPI version 2.0. #### PDFLPrintProgressMarker Header: `PDFLPrint.h:74` An enumeration of the various stages that might be involved in printing a PDF. For use with PDFLPrintProgressProc. **Values** - `kPDFLPrintProg_PopLastProgress = 0` - `kPDFLPrintProg_PushCompilingDocumentResources = 1` - `kPDFLPrintProg_PushCompilingPageResources = 2` - `kPDFLPrintProg_PushStreamingDocumentFont = 3` - `kPDFLPrintProg_PushStreamingDocumentResource = 4` - `kPDFLPrintProg_PushStreamingPageFont = 5` - `kPDFLPrintProg_PushStreamingPageResource = 6` - `kPDFLPrintProg_PushStreamingPageContent = 7` - `kPDFLPrintProg_PushStreamingPageEpilogue = 8` - `kPDFLPrintProg_PushStreamingDocumentEpilogue = 9` - `kPDFLPrintProg_PushStreamingDocumentProcset = 10` - `kPDFLPrintProg_PushStreamingPageSeparation = 11` - `kPDFLPrintProg_PushStreamingPageImage = 12` - `kPDFLPrintProg_PushStreamingPageImageOPI = 13` - `kPDFLPrintProg_PushStreamingPageCSA = 14` - `kPDFLPrintProg_PushStreamingPageCRD = 15` - `kPDFLPrintProg_PushStreamingPageGradient = 16` - `kPDFLPrintProg_PushOnHostTrapBeginPage = 17` - `kPDFLPrintProg_SetOnHostTrapProgressPercent = 18` - `kPDFLPrintProg_StreamingPageImageProgressPercent = 19` - `kPDFLPrintProg_PushBeginStreamingTraps = 20` - `kPDFLPrintProg_SetStreamingTrapPercent = 21` #### PDPrintFontArrayFlags Header: `PDFLExpT.h:221` Font array. **Values** - `kPDSingleByteFont = 0x0001`: A fLag to indicate that the font uses a single byte encoding. **See also:** `PDPrintFontArray` #### PDPrintSuppressEnum Header: `PDFLExpT.h:1027` **Values** - `kPRPrintSuppressXMP = 1` #### PDPrintTrapTypes Header: `PDFLExpT.h:491` **Values** - `kPDPrintTrapNone = 0x01` - `kPDPrintTrapInRIP = 0x04` #### PDPrintWhatFlipOptions Header: `PDFLExpT.h:483` **Values** - `kPDPrintFlipNone = 0x01` - `kPDPrintFlipX = 0x02` - `kPDPrintFlipY = 0x04` - `kPDPrintFlipXY = 0x08` ### Definitions (2) #### kPDPrintUseCropBox Header: `PDFLPrint.h:1120` Value: `((ASUns16)~0 - 1)` #### kPDPrintUseMediaBox Header: `PDFLPrint.h:1113` Value: `((ASUns16)~0)` ## PDFont ### Functions (6) #### PDFontPSEmitGlyphsIncr ```cpp ASBool PDFontPSEmitGlyphsIncr(ASStm stm, PDFont fontP, PDPrintStrP srcStr, PDPrintStrP dstStr, ASUns32 *srcBytesUsedP, ASUns32 *dstBytesUsedP, ASUns32 *glyphCount, ASUns16 *fontIndexP, PDPrintClient printClient) ``` Header: `PDFLProcs.h:407` Emit glyphs incrementally. This is the default `EmitGlyphsIncr` callback procedure for the PDPrintClient structure. **Parameters** - `stm` ([`ASStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStm)): The stream. - `fontP` ([`PDFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFont)): The font. - `srcStr` ([`PDPrintStrP`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPrintStrP)): The source string. - `dstStr` ([`PDPrintStrP`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPrintStrP)): The destination string. - `srcBytesUsedP` ([`ASUns32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The source bytes used. - `dstBytesUsedP` ([`ASUns32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The destination bytes used. - `glyphCount` ([`ASUns32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The number of glyphs. - `fontIndexP` ([`ASUns16 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASUns16)): The font index. - `printClient` ([`PDPrintClient`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPrintClient)): The control structure. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if successful, `false` otherwise. **See also:** [`PDDocPrintPages`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDDocPrintPages), [`PDFontPSFlushIncrGlyphList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFontPSFlushIncrGlyphList), [`PDFontPSGetComponentFontList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFontPSGetComponentFontList) #### PDFontPSFlushIncrGlyphList ```cpp void PDFontPSFlushIncrGlyphList(ASStm stm, PDPrintClient printClient) ``` Header: `PDFLProcs.h:430` Flush the incremental glyphs list from a stream. This is the default `FlushIncrGlyphList` callback procedure for the PDPrintClient structure. **Parameters** - `stm` ([`ASStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStm)): The stream. - `printClient` ([`PDPrintClient`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPrintClient)): The control structure. **Returns:** `void` **See also:** [`PDFontPSEmitGlyphsIncr`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFontPSEmitGlyphsIncr), [`PDFontPSGetComponentFontList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFontPSGetComponentFontList) #### PDFontPSGetComponentFontList ```cpp void PDFontPSGetComponentFontList(PDFont fontP, PDPrintFontArrayP pdFontArr, PDPrintClient printClient) ``` Header: `PDFLProcs.h:419` Get the component font list. This is the default `GetComponentFontList` callback procedure for the PDPrintClient structure. **Parameters** - `fontP` ([`PDFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFont)): The font. - `pdFontArr` ([`PDPrintFontArrayP`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPrintFontArrayP)): The font array. - `printClient` ([`PDPrintClient`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPrintClient)): The control structure. **Returns:** `void` **See also:** [`PDFontPSEmitGlyphsIncr`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFontPSEmitGlyphsIncr), [`PDFontPSFlushIncrGlyphList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFontPSFlushIncrGlyphList) #### PDFontStreamPS ```cpp ASBool PDFontStreamPS(PDFont fontP, ASStm stm, PDFontDownloadContext context) ``` Header: `PDFLProcs.h:250` Emits a font into a specified stream. The font is in a format suitable for downloading to a PostScript VM. For example, a TrueType font is converted into a Type 1 or Type 42 font. It is meant for use in the `EmitFont` callback for PDDocPrintPages(). **Parameters** - `fontP` ([`PDFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFont)): The font to emit. - `stm` ([`ASStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStm)): The ASStm into which the font is emitted. - `context` ([`PDFontDownloadContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFontDownloadContext)): A context created by PDFontDownloadContextCreate. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if successful, `false` otherwise. **See also:** [`PDDocPrintPages`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDDocPrintPages), [`PDFontDownloadContextCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFontDownloadContextCreate) #### PDFontWasExtracted ```cpp ASBool PDFontWasExtracted(PDFont fontP) ``` Header: `PDFLProcs.h:296` Tests whether the specified font is embedded in the PDF file and has already been extracted to display or print the file. **Parameters** - `fontP` ([`PDFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFont)): The font to test. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the font is embedded in the PDF file and has been extracted, `false` otherwise. **See also:** [`PDFontDownloadContextCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFontDownloadContextCreate), [`PDFontWasFauxed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFontWasFauxed) #### PDFontWasFauxed ```cpp ASBool PDFontWasFauxed(PDFont font) ``` Header: `PDFLProcs.h:312` Tests whether the specified font is embedded in the PDF file or is installed in the user's system. If this is the case, the correct font can be used for display and printing. If the font is not embedded or installed, the Acrobat viewer has used a Multiple Master font to create a substitute font, called a *faux* font. **Parameters** - `font` ([`PDFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFont)): The font to test. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the font has been substituted, `false` otherwise. **See also:** [`PDFontWasExtracted`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFontWasExtracted) ### Typedefs (1) #### PDFontStyle ```cpp typedef ASUns8 PDFontStyle ``` Header: `PDFLExpT.h:214` ### Structures (1) #### PDPrintStrP ```cpp typedef struct PDPrintStr * PDPrintStrP ``` Header: `PDFLExpT.h:195` ## PDFontDownloadContext ### Functions (2) #### PDFontDownloadContextCreate ```cpp PDFontDownloadContext PDFontDownloadContextCreate(PDPrintClient client) ``` Header: `PDFLProcs.h:265` Creates a font download context object. This object keeps track of the fonts downloaded during a print job and whether substitution fonts have already been downloaded. It also tracks the font download parameters, such as `binaryOK` and `'emit TrueType as Type 42'`. It is meant for use in the PDFontStreamPS() method. **Parameters** - `client` ([`PDPrintClient`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPrintClient)): The client record to pass to PDDocPrintPages(). **Returns:** [`PDFontDownloadContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFontDownloadContext) The newly-created context. **See also:** [`PDDocPrintPages`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDDocPrintPages), [`PDFontDownloadContextDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFontDownloadContextDestroy), [`PDFontStreamPS`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFontStreamPS) #### PDFontDownloadContextDestroy ```cpp void PDFontDownloadContextDestroy(PDFontDownloadContext context) ``` Header: `PDFLProcs.h:274` Destroys a font download context object. Call this method after PDDocPrintPages() returns. **Parameters** - `context` ([`PDFontDownloadContext`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFontDownloadContext)): IN/OUT The context to destroy. **Returns:** `void` **See also:** [`PDDocPrintPages`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDDocPrintPages), [`PDFontDownloadContextCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFontDownloadContextCreate) ### Structures (1) #### PDFontDownloadContext ```cpp typedef struct _t_PDFontDownloadContext* PDFontDownloadContext ``` Header: `PDFLExpT.h:1794` A resource tree for a PDPage or other PDModel object. Maintains information about the current print job and what fonts have been downloaded. **See also:** [`PDFontDownloadContextCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFontDownloadContextCreate), [`PDFontDownloadContextDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFontDownloadContextDestroy) ## PDPage ### Functions (6) #### PDPageDrawContentsPlacedToWindow ```cpp void PDPageDrawContentsPlacedToWindow(PDPage page, void *window, void *displayContext, ASBool isDPS, ASFixedMatrix *matrix, ASFixedRect *updateRect, CancelProc cancelProc, void *cancelProcClientData) ``` Header: `PDFLProcs.h:230` Draws the page to the window or display context. The window and display context are implementation-dependent. This method is the same as PDPageDrawContentsToWindow(), except that it raises an exception if the `pdPermCopy` (see PDPerms) permission is not set in the document. **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page to draw into window. - `window` (`void *`): The platform window to which to render. On Windows, the window is an `HWND`. - `displayContext` (`void *`): The platform display context to which to render. On Windows, `displayContext` is an `HDC`.`false`. - `isDPS` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)) - `matrix` (`ASFixedMatrix *`): A pointer to the matrix to concatenate onto the default page matrix. It is useful for converting from page to window coordinates and for scaling. - `updateRect` (`ASFixedRect *`): A pointer to the rectangle to draw, defined in user space coordinates. Any objects outside of `updateRect` will not be drawn. All objects are drawn if `updateRect` is `NULL`. - `cancelProc` ([`CancelProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#CancelProc)): A method called to check whether drawing should be cancelled. If the method returns `true`, drawing is stopped, nothing is erased, and the window contains whatever was drawn up to the current state. - `cancelProcClientData` (`void *`): A pointer to user-supplied data to pass to `cancelProc` each time it is called. It should be `NULL` if `cancelProc` is `NULL`. **Note:** Platform: ((!MAC_PLATFORM || !AS_ARCH_64BIT)) && ((!MAC_PLATFORM)) **Returns:** `void` **Exceptions** - `pdErrOpNotPermitted`: is raised if the `pdPermCopy` permission in PDPermReqObj for the document is not set. **See also:** [`PDPageDrawContentsToWindow`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageDrawContentsToWindow) #### PDPageDrawContentsPlacedWithParams ```cpp void PDPageDrawContentsPlacedWithParams(PDPage page, PDDrawParams params) ``` Header: `PDFLProcs.h:522` Draws the page to the window or display context. The window and display context are implementation-dependent. This method is the same as PDPageDrawContentsToWindow(), except that it raises an exception if the `pdPermCopy` (see PDPerms) permission is not set in the document. This method is also like PDPageDrawContentsPlacedToWindow(), only passing in a PDDrawParams structure which lets the clients specify their own PDOCContext. **Note:** Platform: ((!MAC_PLATFORM || !AS_ARCH_64BIT)) && ((!MAC_PLATFORM)) **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page to render. - `params` (`PDDrawParams`): Allows clients to specify their own PDOCContext. **Returns:** `void` **Exceptions** - `pdErrOpNotPermitted`: is raised if the `pdPermCopy` permission in PDPermReqObj is not set. **See also:** [`PDPageDrawContentsToWindow`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageDrawContentsToWindow) #### PDPageDrawContentsToMemory ```cpp ASInt32 PDPageDrawContentsToMemory(PDPage page, ASUns32 flags, ASFixedMatrix *matrix, ASFixedRect *updateRect, ASUns32 smoothFlags, ASAtom csAtom, ASInt32 bpc, ASFixedRect *destRect, char *buffer, ASInt32 bufferSize, CancelProc cancelProc, void *cancelProcData) ``` Header: `PDFLProcs.h:499` Superseded by PDPageDrawContentsToMemoryEx() in Acrobat 10.0. Renders a page to memory. The width of the image is calculated as follows: `width = abs(ASFixedRoundToInt16(destRect.right) - ASFixedRoundToInt16(destRect.left)); width = ((((width * bpc * nComps)+31) / 32) * 4) * 8 / (bpc * nComps); nComps = 1 for DeviceGray, 3 for DeviceRGB, 4 for DeviceCMYK bpc = bits per component` **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page to render. - `flags` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): A bit field of PDPageDrawFlags. It must be an `OR` of the following flags: FlagDescription kPDPageDoLazyEraseIf set, it erases the bitmap if the first object drawn does not cover the page's entire crop box. kPDPageUseAnnotFacesIf set, it draws annotations that have a default face, such as the visible fields in an Acrobat form. Text and link annotations are not drawn. kPDPageIsPrinting — If set, then form annotations are rendered as if they are being printed. This means that form fields marked as 'Hidden but printable' are rendered, but fields marked as 'Visible but doesn't print' will not be rendered. If it is not set, then form annotations are rendered as if they are being viewed. This means that form fields marked as 'Hidden but printable' are not rendered, but fields marked as 'Visible but doesn't print' will be. - `matrix` (`ASFixedMatrix *`): A pointer to the matrix to be concatenated onto the default page matrix. It must not be `NULL`. - `updateRect` (`ASFixedRect *`): A pointer to the rectangle to draw, defined in user space coordinates. Any objects outside of `updateRect` will not be drawn. All objects are drawn if `updateRect` is `NULL`. - `smoothFlags` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): A bit field of PDPageDrawSmoothFlags(). It must be an `OR` of the following flags: • kPDPageDrawSmoothText • kPDPageDrawSmoothLineArt • kPDPageDrawSmoothImage • kPDPageDrawSmoothBicubicImage • kPDPageImageResampleBicubic • kPDPageImageResampleLinear • kPDPageImageAntiAlias • kPDPageDrawSmoothAATextDDR • kPDPageDrawSmoothAATextPreview - `csAtom` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The color space in which the bitmap data is represented. It must be one of DeviceGray, DeviceRGB, or DeviceCMYK. - `bpc` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The number of bits per color component in the bitmap data. `8` is the only valid value for DeviceCMYK and DeviceRGB color spaces. `1` and `8` are valid for DeviceGray. - `destRect` (`ASFixedRect *`): A pointer to the rectangle of the bitmap. It is defined in device space coordinates. It must not be `NULL`. - `buffer` (`char *`): A pointer to the bitmap data. If it is `NULL`, this function returns the size of the buffer needed for the bitmap. - `bufferSize` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The size of the buffer. - `cancelProc` ([`CancelProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#CancelProc)): A method to call to check whether drawing should be cancelled. If the method returns `true`, drawing is stopped, nothing is erased, and the buffer contains whatever was drawn up to the current state. - `cancelProcData` (`void *`): User-supplied data to pass to `cancelProc` each time it is called. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The size of the bitmap in bytes. **See also:** [`PDPageDrawContentsPlacedWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawContentsPlacedWithParams), [`PDPageDrawContentsToMemoryEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawContentsToMemoryEx) #### PDPageDrawContentsToMemoryEx ```cpp ASUns32 PDPageDrawContentsToMemoryEx(PDPage page, ASCab flags, ASDoubleMatrix *matrix, ASDoubleRect *updateRect, ASAtom csAtom, ASInt32 bpc, ASDoubleRect *destRect, char *buffer, ASUns32 bufferSize, CancelProc cancelProc, void *cancelProcData) ``` Header: `PDFLProcs.h:931` Supersedes PDPageDrawContentsToMemory() in Acrobat 10.0. Renders a page to memory. It uses double precision input parameters. The width of the image is calculated as follows: `width = abs(ROUND(destRect.right) - ROUND(destRect.left));` `width = ((((width * bpc * nComps)+31) / 32) * 4) * 8 / (bpc * nComps);` `nComps = 1 for DeviceGray, 3 for DeviceRGB, 4 for DeviceCMYK` `bpc = bits per component` where, ROUND() rounds off double precision values to nearest Int32 value. **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page to render. - `flags` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)): ASCab used for passing PDPageDrawFlagsStr and PDPageDrawSmoothFlagsStr. - `matrix` (`ASDoubleMatrix *`): A pointer to double matrix to be concatenated onto the default page matrix. It must not be `NULL`. - `updateRect` (`ASDoubleRect *`): A pointer to the double rectangle to draw, defined in user space coordinates. - `csAtom` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The color space in which the bitmap data is represented. - `bpc` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The number of bits per color component in the bitmap data. - `destRect` (`ASDoubleRect *`): A pointer to double rectangle of the bitmap. It is defined in device space coordinates. It must not be `NULL`. - `buffer` (`char *`): A pointer to the bitmap data. If it is `NULL`, this function returns the size of the buffer needed for the bitmap. - `bufferSize` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The size of the buffer. - `cancelProc` ([`CancelProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#CancelProc)): A method to call to check whether drawing should be cancelled. - `cancelProcData` (`void *`): User-supplied data to pass to `cancelProc` each time it is called. **Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32) The size of the bitmap in bytes. **See also:** [`PDPageDrawContentsToMemory`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawContentsToMemory), [`PDPageDrawContentsPlacedWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawContentsPlacedWithParams) #### PDPageEmitPSOrient ```cpp void PDPageEmitPSOrient(PDPage pdPage, ASInt16 paperHeight, ASInt16 paperWidth, ASStm stm, PDPrintParams params) ``` Header: `PDFLProcs.h:193` **Note:** Obsolete in PDF Library 6.0. Do not use. **Parameters** - `pdPage` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)) - `paperHeight` ([`ASInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16)) - `paperWidth` ([`ASInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16)) - `stm` ([`ASStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStm)) - `params` ([`PDPrintParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPrintParams)) **Returns:** `void` **See also:** [`PDFLPrintDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFLPrintDoc), [`PDDocPrintPages`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDDocPrintPages) #### PDPageGetSize ```cpp void PDPageGetSize(PDPage page, ASFixed *width, ASFixed *height) ``` Header: `PDFLProcs.h:284` Returns the width and height of the page, which could be rotated or defaulted. **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page whose size is being obtained. - `width` ([`ASFixed *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixed)): (Filled by the method) The width of the page. - `height` ([`ASFixed *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixed)): (Filled by the method) The height of the page. **Returns:** `void` ### Typedefs (4) #### PDPageDrawFlags ```cpp typedef ASUns32 PDPageDrawFlags ``` Header: `PDFLExpT.h:1155` #### PDPageDrawSmoothFlags ```cpp typedef ASUns32 PDPageDrawSmoothFlags ``` Header: `PDFLExpT.h:1442` #### PDPageMarkFlags ```cpp typedef ASUns32 PDPageMarkFlags ``` Header: `PDFLExpT.h:472` #### PDPageTilingMode ```cpp typedef ASInt16 PDPageTilingMode ``` Header: `PDFLExpT.h:302` ### Definitions (37) #### kPDPageBlendingProfileValueStr Header: `PDFLExpT.h:1344` Value: `"BlendingProfileDesc"` Takes ASext as input. If set we use this profile as blending profile. kPDPageDisplayOverPrintPreviewStr must be set for this to get honored. **See also:** [`PDPageDrawContentsToMemoryEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawContentsToMemoryEx), [`PDPageDrawFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawFlags), [`PDPageDrawContentsToWindowEx2`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageDrawContentsToWindowEx2) #### kPDPageDirectlyImposedStr Header: `PDFLExpT.h:1227` Value: `"DirectlyImposed"` Directly imposed page. **See also:** [`PDPageDrawContentsToMemoryEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawContentsToMemoryEx), [`PDPageDrawFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawFlags), [`PDPageDrawContentsToWindowEx2`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageDrawContentsToWindowEx2) #### kPDPageDisplayOverPrintPreviewStr Header: `PDFLExpT.h:1209` Value: `"DisplayOverPrintPreview"` Display overprint preview. **See also:** [`PDPageDrawContentsToMemoryEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawContentsToMemoryEx), [`PDPageDrawFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawFlags), [`PDPageDrawContentsToWindowEx2`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageDrawContentsToWindowEx2) #### kPDPageDoLazyEraseStr Header: `PDFLExpT.h:1172` Value: `"DoLazyErase"` Const strings used as ASCab keys when passing PDPageDrawFlags. These are valid only for calls to PDPageDrawContentsToMemoryEx and PDPageDrawContentsToWindowEx2. **See also:** [`PDPageDrawSmoothFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawSmoothFlags), [`PDPageDrawContentsToMemoryEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawContentsToMemoryEx), `PDPageDrawContentsToWindowEx2 Erase the page while rendering only as needed.`, [`PDPageDrawFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawFlags), [`PDPageDrawContentsToWindowEx2`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageDrawContentsToWindowEx2) #### kPDPageDoNotDownloadFontsStr Header: `PDFLExpT.h:1349` Value: `"DL_DoNotDownloadFonts"` #### kPDPageDoNotSubstituteWorkingSpacesStr Header: `PDFLExpT.h:1290` Value: `"DoNotSubstituteWorkingSpaces"` Do not substitute working spaces. **See also:** [`PDPageDrawContentsToMemoryEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawContentsToMemoryEx), [`PDPageDrawFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawFlags), [`PDPageDrawContentsToWindowEx2`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageDrawContentsToWindowEx2) #### kPDPageDrawSmoothAATextDDRStr Header: `PDFLExpT.h:1467` Value: `"SmoothAATextDDR"` #### kPDPageDrawSmoothAATextPreviewStr Header: `PDFLExpT.h:1468` Value: `"SmoothAATextPreview"` #### kPDPageDrawSmoothBicubicImageStr Header: `PDFLExpT.h:1484` Value: `"SmoothImageUsingBicubicResampling"` Draw smooth image using bicubic resampling. This option can have performance overhead. **See also:** [`PDPageDrawContentsToMemoryEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawContentsToMemoryEx), [`PDPageDrawSmoothFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawSmoothFlags) #### kPDPageDrawSmoothImageStr Header: `PDFLExpT.h:1476` Value: `"SmoothImage"` Draw smooth image. **See also:** [`PDPageDrawContentsToMemoryEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawContentsToMemoryEx), [`PDPageDrawSmoothFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawSmoothFlags) #### kPDPageDrawSmoothLineArtStr Header: `PDFLExpT.h:1464` Value: `"SmoothLineArt"` Draw smooth line art. **See also:** [`PDPageDrawContentsToMemoryEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawContentsToMemoryEx), [`PDPageDrawSmoothFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawSmoothFlags) #### kPDPageDrawSmoothTextStr Header: `PDFLExpT.h:1450` Value: `"SmoothText"` Draw smooth text. **See also:** [`PDPageDrawContentsToMemoryEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawContentsToMemoryEx), [`PDPageDrawSmoothFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawSmoothFlags) #### kPDPageEmitPageGroupStr Header: `PDFLExpT.h:1245` Value: `"EmitPageGroup"` Emit a page group. **See also:** [`PDPageDrawContentsToMemoryEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawContentsToMemoryEx), [`PDPageDrawFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawFlags), [`PDPageDrawContentsToWindowEx2`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageDrawContentsToWindowEx2) #### kPDPageForceGDIPortStr Header: `PDFLExpT.h:1346` Value: `"DL_ForceGDIPort"` #### kPDPageIgnoreIsolatedAndKnockoutTransparencyGroupStr Header: `PDFLExpT.h:1181` Value: `"IgnoreIsolatedAndKnockoutTransparencyGroup"` Ignore Isolated and Knockout transparency at page boundary. **See also:** [`PDPageDrawContentsToMemoryEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawContentsToMemoryEx), [`PDPageDrawFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawFlags), [`PDPageDrawContentsToWindowEx2`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageDrawContentsToWindowEx2) #### kPDPageImageAntiAliasStr Header: `PDFLExpT.h:1456` Value: `"ImageAntiAlias"` #### kPDPageImageResampleBicubicStr Header: `PDFLExpT.h:1452` Value: `"ImageResampleBicubic"` #### kPDPageImageResampleLinearStr Header: `PDFLExpT.h:1454` Value: `"ImageResampleLinear"` #### kPDPageInvertedGrayscaleStr Header: `PDFLExpT.h:1307` Value: `"InvertedGrayscale"` #### kPDPageIsPSPrintingStr Header: `PDFLExpT.h:1236` Value: `"IsPSPrinting"` PostScript printing. **See also:** [`PDPageDrawContentsToMemoryEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawContentsToMemoryEx), [`PDPageDrawFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawFlags), [`PDPageDrawContentsToWindowEx2`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageDrawContentsToWindowEx2) #### kPDPageIsPrintPreviewingStr Header: `PDFLExpT.h:1351` Value: `"DL_IsPrintPreviewing"` #### kPDPageIsPrintingStr Header: `PDFLExpT.h:1200` Value: `"IsPrinting"` The page is being printed. **See also:** [`PDPageDrawContentsToMemoryEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawContentsToMemoryEx), [`PDPageDrawFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawFlags), [`PDPageDrawContentsToWindowEx2`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageDrawContentsToWindowEx2) #### kPDPageNoDitherStr Header: `PDFLExpT.h:1355` Value: `"NoDither"` #### kPDPagePassMetadatatoAGMPortStr Header: `PDFLExpT.h:1272` Value: `"PassMetadatatoAGMPort"` Pass metadata to AGM port. **See also:** [`PDPageDrawContentsToMemoryEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawContentsToMemoryEx), [`PDPageDrawFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawFlags), [`PDPageDrawContentsToWindowEx2`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageDrawContentsToWindowEx2) #### kPDPagePassOCtoAGMPortStr Header: `PDFLExpT.h:1281` Value: `"PassOCtoAGMPort"` Pass optional content to AGM port. **See also:** [`PDPageDrawContentsToMemoryEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawContentsToMemoryEx), [`PDPageDrawFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawFlags), [`PDPageDrawContentsToWindowEx2`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageDrawContentsToWindowEx2) #### kPDPagePassOPItoAGMPortStr Header: `PDFLExpT.h:1263` Value: `"PassOPItoAGMPort"` Pass open prepress interface (OPI) to AGM port. **See also:** [`PDPageDrawContentsToMemoryEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawContentsToMemoryEx), [`PDPageDrawFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawFlags), [`PDPageDrawContentsToWindowEx2`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageDrawContentsToWindowEx2) #### kPDPageSuppressRasterAlphaStr Header: `PDFLExpT.h:1315` Value: `"SuppressRasterAlpha"` Suppress raster alpha. **See also:** [`PDPageDrawContentsToMemoryEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawContentsToMemoryEx), [`PDPageDrawFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawFlags) #### kPDPageSwapComponentsStr Header: `PDFLExpT.h:1301` Value: `"SwapComponents"` Render colors in Swapped color vs the normal case, which is helpful for specialized scenarios where the output is expected to be in such an order. For DeviceRGB, this means BGR rather than RGB. For DeviceCMYK, this means KYMC rather than CMYK. **See also:** [`PDPageDrawContentsToMemoryEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawContentsToMemoryEx), [`PDPageDrawFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawFlags), [`PDPageDrawContentsToWindowEx2`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageDrawContentsToWindowEx2) #### kPDPageThreadIPParseStr Header: `PDFLExpT.h:1358` Value: `"ThreadParse"` #### kPDPageUseAnnotFacesStr Header: `PDFLExpT.h:1191` Value: `"UseAnnotFaces"` Draw annotation appearances. **See also:** [`PDPageDrawContentsToMemoryEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawContentsToMemoryEx), [`PDPageDrawFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawFlags), [`PDPageDrawContentsToWindowEx2`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageDrawContentsToWindowEx2) #### kPDPageUsePreciseColorConvStr Header: `PDFLExpT.h:1347` Value: `"DL_UsePreciseColorConv"` #### kPDPageUsePrinterMarkAnnotsStr Header: `PDFLExpT.h:1254` Value: `"UsePrinterMarkAnnots"` User printer's mark annotations. **See also:** [`PDPageDrawContentsToMemoryEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawContentsToMemoryEx), [`PDPageDrawFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawFlags), [`PDPageDrawContentsToWindowEx2`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageDrawContentsToWindowEx2) #### kPDPageUseSignatureAnnotsOnlyStr Header: `PDFLExpT.h:1348` Value: `"DL_UseSignatureAnnotsOnly"` #### kPDPageUseStampAnnotsOnlyStr Header: `PDFLExpT.h:1334` Value: `"UseStampAnnotsOnly"` If set, only consider Stamp annotations. This overrides kPDPageUseAnnotFaces. **See also:** [`PDPageDrawContentsToMemoryEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawContentsToMemoryEx), [`PDPageDrawFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawFlags), [`PDPageDrawContentsToWindowEx2`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageDrawContentsToWindowEx2) #### kPDPageUseTrapAnnotsStr Header: `PDFLExpT.h:1218` Value: `"UseTrapAnnots"` Use trap network annotations. **See also:** [`PDPageDrawContentsToMemoryEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawContentsToMemoryEx), [`PDPageDrawFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawFlags), [`PDPageDrawContentsToWindowEx2`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageDrawContentsToWindowEx2) #### kPDPageWorkingSpacesOnlyForChangeStr Header: `PDFLExpT.h:1325` Value: `"WorkingSpacesOnlyForChange"` If this is set, only use a working space instead of a device space if the process color model of the target device is different than that of the source. **See also:** [`PDPageDrawContentsToMemoryEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawContentsToMemoryEx), [`PDPageDrawFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawFlags), [`PDPageDrawContentsToWindowEx2`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPageDrawContentsToWindowEx2) #### kPDPageWritingToEMFStr Header: `PDFLExpT.h:1350` Value: `"DL_WritingToEMF"` ## PDPref ### Functions (18) #### PDPrefGetAntialiasLevel ```cpp ASUns32 PDPrefGetAntialiasLevel(void) ``` Header: `PDFLProcs.h:357` Returns the antialias level, in pixels. **Parameters** - (unnamed) (`void`) **Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32) The antialias level set by PDPrefSetAntialiasLevel(). **See also:** [`PDPrefSetAntialiasLevel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPrefSetAntialiasLevel) #### PDPrefGetBlackPointCompensation ```cpp ASBool PDPrefGetBlackPointCompensation(void) ``` Header: `PDFLProcs.h:379` Returns the black-point compensation flag. **Parameters** - (unnamed) (`void`) **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if black-point compensation is done. **See also:** [`PDPrefSetBlackPointCompensation`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPrefSetBlackPointCompensation) #### PDPrefGetEnableThinLineHeuristics ```cpp ASBool PDPrefGetEnableThinLineHeuristics(void) ``` Header: `PDFLProcs.h:891` Determines whether thin lines will be fattened non-linearly or the stroke adjust will be applied to thin rectangles. **Parameters** - (unnamed) (`void`) **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if thin line heuristics are applied, `false` otherwise. #### PDPrefGetGreekLevel ```cpp ASInt16 PDPrefGetGreekLevel(void) ``` Header: `PDFLProcs.h:349` Returns the greek level. **Parameters** - (unnamed) (`void`) **Returns:** [`ASInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16) The greek level set by PDPrefSetGreekLevel(). **See also:** [`PDPrefSetGreekLevel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPrefSetGreekLevel) #### PDPrefGetRefXObj ```cpp PDRefXObjMode PDPrefGetRefXObj(ASFileSys *fileSys, ASPathName *pathName) ``` Header: `PDFLProcs.h:879` Gets reference XObject parameters. **Parameters** - `fileSys` ([`ASFileSys *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): Used with `pathname` to specify where the target files should be found. - `pathName` ([`ASPathName *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)) **Returns:** [`PDRefXObjMode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDRefXObjMode) #### PDPrefGetSuppressICCSpaces ```cpp ASBool PDPrefGetSuppressICCSpaces(ASUns32 nComponents) ``` Header: `PDFLProcs.h:566` Returns the value of the `suppress` flag for ICC-based spaces with the specified number of components. **Parameters** - `nComponents` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The number of ICC-based space components that are suppressed or not, according to the flag value. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) The `suppress` flag value. **See also:** [`PDPrefSetSuppressICCSpaces`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPrefSetSuppressICCSpaces) #### PDPrefGetUseOutputIntents ```cpp ASBool PDPrefGetUseOutputIntents(void) ``` Header: `PDFLProcs.h:544` Returns the value of the Output Intent flag. When this flag is `true`, the system overrides the working space with the Output Intent, if it is present. **Parameters** - (unnamed) (`void`) **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) The Output Intent flag value. **See also:** [`PDPrefSetUseOutputIntents`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPrefSetUseOutputIntents) #### PDPrefSetAntialiasLevel ```cpp void PDPrefSetAntialiasLevel(ASUns32 antialiasPixelLevel) ``` Header: `PDFLProcs.h:342` Sets the default smooth text and smooth images global flags for subsequent rendering methods. If the function PDPageDrawContentsToMemory() is used for drawing, the `smoothFlags` value passed to that function supersedes the preference value for the duration of the call. **Parameters** - `antialiasPixelLevel` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The antialias level, in pixels. It is an `OR` of the following flags: • kPDPrefAASmoothText • kPDPrefAASmoothLineArt • kPDPrefAASmoothImage **Returns:** `void` **See also:** [`PDPrefGetAntialiasLevel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPrefGetAntialiasLevel) #### PDPrefSetBlackPointCompensation ```cpp void PDPrefSetBlackPointCompensation(ASBool kbpc) ``` Header: `PDFLProcs.h:372` Sets the black-point compensation flag, which controls whether to adjust for differences in black points when converting colors between color spaces. When enabled, the full dynamic range of the source space is mapped into the full dynamic range of the destination space. When disabled, the dynamic range of the source space is simulated in the destination space (which can result in blocked or gray shadows). **Parameters** - `kbpc` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): `true` to enable black-point compensation, `false` otherwise. **Returns:** `void` None. **See also:** [`PDPrefGetBlackPointCompensation`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPrefGetBlackPointCompensation) #### PDPrefSetEnableThinLineHeuristics ```cpp void PDPrefSetEnableThinLineHeuristics(ASBool doThinLineTricks) ``` Header: `PDFLProcs.h:885` Sets whether thin lines will be fattened non-linearly or the stroke adjust will be applied to thin rectangles. **Parameters** - `doThinLineTricks` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): `true` if thin line heuristics are applied, `false` otherwise. **Returns:** `void` #### PDPrefSetGreekLevel ```cpp void PDPrefSetGreekLevel(ASInt16 greekPixelLevel) ``` Header: `PDFLProcs.h:322` Sets the *greek level*. The greek level is a text height below which text characters are not rendered. Instead, text-like glyphs that have no meaning but look good at very small size are used. This is known as *greeking*. **Parameters** - `greekPixelLevel` ([`ASInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16)): The greek level, in pixels. **Returns:** `void` **See also:** [`PDPrefGetGreekLevel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPrefGetGreekLevel) #### PDPrefSetRefXObj ```cpp void PDPrefSetRefXObj(PDRefXObjMode refXObjMode, ASFileSys fileSys, ASPathName pathName) ``` Header: `PDFLProcs.h:872` Sets reference XObject parameters. **Parameters** - `refXObjMode` ([`PDRefXObjMode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDRefXObjMode)): The mode to view or print reference XObjects. Its value can be one of the following: Reference XObject modeDescription `kRefXObjNever`Does nothing. The function returns `false`. `kRefXObjAlways`Find a substitution with minimal checking. `kRefXObjPDFX5`Restrict substitutions to PDF/X-5 conforming ones. `kRefXObjAlwaysAssured`Fail the parser if the target is not found. Do not display the proxy. `kRefXObjPDFX5Assured`Fail the parser if the target PDF/X-5 document not found. Do not display the proxy. - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): Used with `pathname` to specify where the target files should be found. - `pathName` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)) **Returns:** `void` #### PDPrefSetSuppressICCSpaces ```cpp void PDPrefSetSuppressICCSpaces(ASUns32 nComponents, ASBool value) ``` Header: `PDFLProcs.h:556` Specifies use of a default color space rather than an ICC-based color space. **Parameters** - `nComponents` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The number of ICC color space components. - `value` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): When `true`, use a DefaultCMYK, DefaultRGB, or DefaultGray color space instead of an ICC-based color space with the same number of components. **Returns:** `void` **See also:** [`PDPrefGetSuppressICCSpaces`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPrefGetSuppressICCSpaces) #### PDPrefSetUseLocalFonts ```cpp void PDPrefSetUseLocalFonts(ASBool useLocalFonts) ``` Header: `PDFLProcs.h:386` Enables or disables use of local fonts. **Parameters** - `useLocalFonts` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): When `true`, use local fonts. When `false`, use global fonts. **Returns:** `void` #### PDPrefSetUseOutputIntents ```cpp void PDPrefSetUseOutputIntents(ASBool flag) ``` Header: `PDFLProcs.h:535` Sets the Output Intent flag. **Parameters** - `flag` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): When `true`, use Output Intent to override a working space if it is present. **Returns:** `void` **See also:** [`PDPrefGetUseOutputIntents`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPrefGetUseOutputIntents) #### PDPrefSetWorkingCMYK ```cpp void PDPrefSetWorkingCMYK(void *profile, ASUns32 profileLength) ``` Header: `PDFLProcs.h:637` Sets the current CMYK working space to a given ICC profile. A CMYK working space in PDF is defined as a profile to substitute for a corresponding /DeviceCMYK space. **Parameters** - `profile` (`void *`): A pointer to a buffer containing the ICC color profile. - `profileLength` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The length in bytes of the profile. **Returns:** `void` **See also:** [`PDPrefSetWorkingGray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPrefSetWorkingGray), [`PDPrefSetWorkingRGB`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPrefSetWorkingRGB) #### PDPrefSetWorkingGray ```cpp void PDPrefSetWorkingGray(void *profile, ASUns32 profileLength) ``` Header: `PDFLProcs.h:651` Sets the current gray working space to a given ICC profile. A gray working space in PDF is defined as a profile to substitute for a corresponding /DeviceGray space. When rendering with overprint preview, the gray substitution is suppressed, to avoid converting grayscale to "rich black." **Parameters** - `profile` (`void *`): A pointer to a buffer containing the ICC color profile. - `profileLength` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The length in bytes of the profile. **Returns:** `void` **See also:** [`PDPrefSetWorkingCMYK`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPrefSetWorkingCMYK), [`PDPrefSetWorkingRGB`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPrefSetWorkingRGB) #### PDPrefSetWorkingRGB ```cpp void PDPrefSetWorkingRGB(void *profile, ASUns32 profileLength) ``` Header: `PDFLProcs.h:625` Set the current RGB working space to a given ICC profile. An RGB working space in PDF is defined as a profile to substitute for a corresponding /DeviceRGB space. **Parameters** - `profile` (`void *`): A pointer to a buffer containing the ICC color profile. - `profileLength` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The length in bytes of the profile. **Returns:** `void` **See also:** [`PDPrefSetWorkingCMYK`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPrefSetWorkingCMYK), [`PDPrefSetWorkingGray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPrefSetWorkingGray) ### Typedefs (1) #### PDRefXObjMode ```cpp typedef ASInt32 PDRefXObjMode ``` Header: `PDFLExpT.h:1390` ## PDTextSelect ### Structures (1) #### PDResTree ```cpp typedef struct _t_PDResTree* PDResTree ``` Header: `PDBasicExpT.h:155` A selection of text on a single page that may contain more than one disjoint group of words. A text selection is specified by one or more ranges of text, with each range containing the word numbers of the selected words. Each range specifies a start and end word, where *"start"* is the first of a series of selected words and *"end"* is the first word not in the series. **See also:** `AVDocGetSelection`, `AVPageViewTrackText`, [`PDDocCreateTextSelect`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocCreateTextSelect), [`PDTextSelectCreatePageHilite`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreatePageHilite), [`PDTextSelectCreatePageHiliteEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreatePageHiliteEx), [`PDTextSelectCreateWordHilite`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreateWordHilite), [`PDTextSelectCreateWordHiliteEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreateWordHiliteEx), [`PDTextSelectCreateRanges`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreateRanges), [`PDTextSelectCreateRangesEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectCreateRangesEx), [`PDTextSelectDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectDestroy), [`PDTextSelectEnumQuads`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectEnumQuads), [`PDTextSelectEnumText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDTextSelectEnumText) ## pdflattener ### Typedefs (1) #### PDFlattenTilingMode ```cpp typedef ASInt32 PDFlattenTilingMode ``` Header: `PDFLExpT.h:288` ### Structures (1) #### PDFlatten ```cpp typedef struct PDFlattenRec * PDFlatten ``` Header: `PDFLExpT.h:373` --- # Acro Color Layer Source: https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor ## acrocolor ### Functions (67) #### ACApplyTransform ```cpp AC_Error ACApplyTransform(AC_Transform transform, const void *srcData, void *dstData, ASUns32 count, AC_PackingCode srcPacking, AC_PackingCode dstPacking) ``` Header: `AcroColorProcs.h:741` Applies a color conversion or gamut test transformation. It processes the number of colors specified by `count`, using the memory formats for the source and destination data specified in `srcPacking` and `dstPacking`. The source data and destination data can point to the same block of memory if the source and destination packing formats use the same number of bits per color. **Parameters** - `transform` ([`AC_Transform`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Transform)): The color conversion or tranformation to apply. - `srcData` (`const void *`): The source data to tranform. - `dstData` (`void *`): The destination for the transformed data. - `count` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The number of colors to transform. - `srcPacking` ([`AC_PackingCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_PackingCode)): The packing type used in the source data. - `dstPacking` ([`AC_PackingCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_PackingCode)): The packing type to use in the destination data. **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACMakeColorTransform`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeColorTransform) #### ACEngineCount ```cpp AC_Error ACEngineCount(ASUns32 *count) ``` Header: `AcroColorProcs.h:41` Gets the number of Color Management System/Color Management Module (CMS/CMM) choices available for the AcroColor engine (ACE). **Parameters** - `count` ([`ASUns32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): (Filled by the method) A pointer to the count value. **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACEngineInfo`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACEngineInfo), [`ACSetEngine`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACSetEngine) #### ACEngineInfo ```cpp AC_Error ACEngineInfo(ASUns32 index, AC_String *name, ASUns32 *cmsID, ASUns32 *cmmID) ``` Header: `AcroColorProcs.h:62` Gets information for a CMS/CMM in the AcroColor engine (ACE) by index. The CMS and CMM identifiers specify an engine to the ACE. Engine names should only be used as the text for popup menus. It is better to store the identifiers in settings files (rather than names), because they are independent of localization. **Parameters** - `index` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The zero-based index of the CMS/CMM. The highest legal value is `AC_EngineCount - 1`. - `name` ([`AC_String *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_String)): (Filled by the method) Optional. If it is not `NULL`, the parameter returns the name of the CMS/CMM. - `cmsID` ([`ASUns32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): (Filled by the method) Returns the CMS identifier. - `cmmID` ([`ASUns32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): (Filled by the method) Returns the CMM identifier. **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACEngineCount`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACEngineCount), [`ACSetEngine`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACSetEngine) #### ACGetBlackPointCompensation ```cpp AC_Error ACGetBlackPointCompensation(ASUns32 *bpc) ``` Header: `AcroColorProcs.h:1137` Get the black-point compensation flag. **Parameters** - `bpc` ([`ASUns32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): It will receive the flag value, flag value equal to 1 implies black-point compensation is on , value 0 otherwise. **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACGetBlackPointCompensation`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACGetBlackPointCompensation) #### ACGetSettingsProfile ```cpp AC_Error ACGetSettingsProfile(AC_Settings settings, AC_SettingsKey key, AC_Profile *profile) ``` Header: `AcroColorProcs.h:313` Gets the current color profile for a given key from the AcroColor engine (ACE) `settings` object. • If the settings file contains a profile entry with the specified key, that profile is returned. • If the settings file contains a special `NULL` entry with the key, a `NULL` profile is returned. • If the settings file contains a string with this key rather than an embedded profile, this method returns an installed profile whose description matches the string, if found. • In all other cases, AC_Error_MissingKey is returned. The method does not check for known keys or legal key values. It is up to the client to write only legal key values, and to verify key values when reading. **Parameters** - `settings` ([`AC_Settings`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Settings)): The `settings` object from which the profile is obtained. - `key` ([`AC_SettingsKey`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_SettingsKey)): The value key constant. - `profile` ([`AC_Profile *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Profile)): (Filled by the method) A pointer to the current color profile value of the given key. **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACGetSettingsString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACGetSettingsString), [`ACGetSettingsUnsigned32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACGetSettingsUnsigned32), [`ACLoadSettings`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACLoadSettings), [`ACMakeSettings`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeSettings), [`ACUnReferenceProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACUnReferenceProfile), [`ACUnReferenceSettings`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACUnReferenceSettings) #### ACGetSettingsString ```cpp AC_Error ACGetSettingsString(AC_Settings settings, AC_SettingsKey key, AC_String *string) ``` Header: `AcroColorProcs.h:394` Gets the current string value for a given key from the AcroColor engine (ACE) `settings` object. • If the settings file contains a string entry with the specified key, the method returns the entry. • If the settings file contains a special `NULL` entry with the key, the method returns a `NULL` string. • In all other cases, the method returns AC_Error_MissingKey. **Parameters** - `settings` ([`AC_Settings`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Settings)): The `settings` object from which the string is obtained. - `key` ([`AC_SettingsKey`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_SettingsKey)): The value key constant. - `string` ([`AC_String *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_String)): (Filled by the method) A pointer to the current string value of the given key. **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACGetSettingsProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACGetSettingsProfile), [`ACGetSettingsUnsigned32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACGetSettingsUnsigned32), [`ACLoadSettings`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACLoadSettings), [`ACMakeSettings`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeSettings), [`ACUnReferenceSettings`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACUnReferenceSettings), [`ACUnReferenceString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACUnReferenceString) #### ACGetSettingsUnsigned32 ```cpp AC_Error ACGetSettingsUnsigned32(AC_Settings settings, AC_SettingsKey key, ASUns32 *value) ``` Header: `AcroColorProcs.h:416` Gets the current numeric value for a given key from the AcroColor engine (ACE) `settings` object. • If the settings file contains an unsigned 32-bit numeric entry with the specified key, the method returns the entry. • In all other cases, the method returns AC_Error_MissingKey. **Parameters** - `settings` ([`AC_Settings`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Settings)): The `settings` object from which the value is obtained. - `key` ([`AC_SettingsKey`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_SettingsKey)): The value key constant. - `value` ([`ASUns32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): (Filled by the method) A pointer to the current numeric value of the given key. **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACGetSettingsProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACGetSettingsProfile), [`ACGetSettingsString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACGetSettingsString), [`ACLoadSettings`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACLoadSettings), [`ACMakeSettings`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeSettings), [`ACUnReferenceSettings`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACUnReferenceSettings) #### ACGetWorkingSpaceProfile ```cpp AC_Error ACGetWorkingSpaceProfile(ACWorkingSpace space, AC_Profile *workingProfile) ``` Header: `AcroColorProcs.h:901` Gets a working color profile in a specified color space. **Parameters** - `space` ([`ACWorkingSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACWorkingSpace)): The type of color space of the profile to obtain. - `workingProfile` ([`AC_Profile *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Profile)): (Filled by the method) A pointer to the working profile. When done with this object, dereference it using ACUnReferenceProfile(). **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACProfilesMatch`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfilesMatch), [`ACUnReferenceProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACUnReferenceProfile) #### ACLoadSettings ```cpp AC_Error ACLoadSettings(AC_Settings settings, AC_FileSpec *file) ``` Header: `AcroColorProcs.h:360` [DEPRECATED] Loads the AcroColor engine (ACE) settings from a file. This method reads the settings entries from the specified file and stores them in the `settings` object, including entries with unknown keys or data formats. As a general rule, the client should keep the `settings` object around so these unknown keys are preserved when the settings are saved out. The only time the client should start with a fresh `settings` object is when performing another settings load. **Note:** Platform: ((!MAC_PLATFORM || !AS_ARCH_64BIT)) && ((!MAC_PLATFORM)) **Parameters** - `settings` ([`AC_Settings`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Settings)): (Filled by the method) The `settings` object. - `file` (`AC_FileSpec *`): A pointer to the file specification for the file containing the settings. **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACGetSettingsProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACGetSettingsProfile), [`ACGetSettingsString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACGetSettingsString), [`ACGetSettingsUnsigned32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACGetSettingsUnsigned32), [`ACMakeSettings`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeSettings), [`ACPresetListItemFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACPresetListItemFile), [`ACUnReferenceSettings`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACUnReferenceSettings), `replacment ACLoadSettingsU` #### ACLoadSettingsU ```cpp AC_Error ACLoadSettingsU(AC_Settings settings, AC_String file) ``` Header: `AcroColorProcs.h:1114` Reads the settings entries from the specified file. All entries are stored in the settings object, even entries with unknown keys or data formats. As a general rule, the client should keep the settings object around so these unknown keys are preserved when the settings are saved out. The only time the client should start with a fresh settings object is when performing another settings load. **Parameters** - `settings` ([`AC_Settings`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Settings)) - `file` ([`AC_String`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_String)) **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) **See also:** [`ACLoadSettings`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACLoadSettings) #### ACMakeBufferProfile ```cpp AC_Error ACMakeBufferProfile(AC_Profile *profile, void *data, ASUns32 dataSize) ``` Header: `AcroColorProcs.h:557` Creates a device color profile object from a data buffer containing the raw ICC profile data. The method copies the data, so the client can dispose of the source data. The client should call ACUnReferenceProfile() when done with the profile. **Parameters** - `profile` ([`AC_Profile *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Profile)): (Filled by the method) The device profile. - `data` (`void *`): The buffer containing the device profile data. - `dataSize` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The size in bytes of the data buffer. **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACGetSettingsProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACGetSettingsProfile), [`ACGetWorkingSpaceProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACGetWorkingSpaceProfile), [`ACMakeCalGray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeCalGray), [`ACMakeCalLab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeCalLab), [`ACMakeCalRGB`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeCalRGB), [`ACMonitorProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMonitorProfile), [`ACProfileFromCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileFromCode), [`ACProfileFromDescription`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileFromDescription), [`ACUnReferenceProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACUnReferenceProfile) #### ACMakeCalGray ```cpp AC_Error ACMakeCalGray(AC_Profile *profile, ACCalGray *spec, AC_RenderIntent intent, AC_String description) ``` Header: `AcroColorProcs.h:610` Creates a device color profile object from a calibrated grayscale color space with the specified rendering intent and description string. The client should call ACUnReferenceProfile() when done with the profile. **Parameters** - `profile` ([`AC_Profile *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Profile)): (Filled by the method) A pointer to the new device color profile. - `spec` (`ACCalGray *`): A pointer to the calibrated grayscale color space specification. - `intent` ([`AC_RenderIntent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_RenderIntent)): The rendering intent. - `description` ([`AC_String`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_String)): The description of the new profile. If it is non-`NULL`, it must contain ASCII data, and may contain Unicode data also. If `NULL`, a hard-coded default description is used. **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACGetSettingsProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACGetSettingsProfile), [`ACGetWorkingSpaceProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACGetWorkingSpaceProfile), [`ACMakeBufferProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeBufferProfile), [`ACMakeCalLab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeCalLab), [`ACMakeCalRGB`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeCalRGB), [`ACMonitorProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMonitorProfile), [`ACProfileFromCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileFromCode), [`ACProfileFromDescription`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileFromDescription), [`ACUnReferenceProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACUnReferenceProfile) #### ACMakeCalLab ```cpp AC_Error ACMakeCalLab(AC_Profile *profile, ACCalLab *spec, AC_RenderIntent intent, AC_String description) ``` Header: `AcroColorProcs.h:638` Creates a device color profile object from a calibrated Lab color space with the specified rendering intent and description string. The client should call ACUnReferenceProfile() when done with the profile. **Parameters** - `profile` ([`AC_Profile *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Profile)): (Filled by the method) A pointer to the new device color profile. - `spec` (`ACCalLab *`): The calibrated Lab color space specification. - `intent` ([`AC_RenderIntent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_RenderIntent)): The rendering intent. - `description` ([`AC_String`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_String)): The description of the new profile. If it is non-`NULL`, it must contain ASCII data, and may contain Unicode data also. If it is `NULL`, a hard-coded default description is used. **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACGetSettingsProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACGetSettingsProfile), [`ACGetWorkingSpaceProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACGetWorkingSpaceProfile), [`ACMakeBufferProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeBufferProfile), [`ACMakeCalGray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeCalGray), [`ACMakeCalRGB`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeCalRGB), [`ACMonitorProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMonitorProfile), [`ACProfileFromCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileFromCode), [`ACProfileFromDescription`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileFromDescription), [`ACUnReferenceProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACUnReferenceProfile) #### ACMakeCalRGB ```cpp AC_Error ACMakeCalRGB(AC_Profile *profile, ACCalRGB *spec, AC_RenderIntent intent, AC_String description) ``` Header: `AcroColorProcs.h:583` Creates a device color profile object from a calibrated RGB color space, with the specified rendering intent and descriptive string. The client should call ACUnReferenceProfile() when done with the profile. **Parameters** - `profile` ([`AC_Profile *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Profile)): (Filled by the method) A pointer to the new device color profile. - `spec` (`ACCalRGB *`): The calibrated RGB color space specification. - `intent` ([`AC_RenderIntent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_RenderIntent)): The rendering intent. - `description` ([`AC_String`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_String)): The description of the new profile. If it is non-`NULL`, the description must contain ASCII data, and may contain Unicode data also. If it is `NULL`, a hard-coded default description is used. **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACGetSettingsProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACGetSettingsProfile), [`ACGetWorkingSpaceProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACGetWorkingSpaceProfile), [`ACMakeBufferProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeBufferProfile), [`ACMakeCalGray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeCalGray), [`ACMakeCalLab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeCalLab), [`ACMonitorProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMonitorProfile), [`ACProfileFromCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileFromCode), [`ACProfileFromDescription`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileFromDescription), [`ACUnReferenceProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACUnReferenceProfile) #### ACMakeColorTransform ```cpp AC_Error ACMakeColorTransform(AC_Transform *transform, AC_Profile srcProfile, AC_Profile dstProfile, AC_RenderIntent intent) ``` Header: `AcroColorProcs.h:717` Creates a color transformation object. The client can dispose of the source and destination profiles as soon as the transform is created. If the source profile is a device link or abstract profile, then the destination profile must be `NULL`; otherwise it must be non-`NULL`. **Parameters** - `transform` ([`AC_Transform *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Transform)): (Filled by the method) A pointer to the new color transformation object. - `srcProfile` ([`AC_Profile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Profile)): The source profile from which to transform color data. - `dstProfile` ([`AC_Profile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Profile)): The destination profile to which to transform color data. - `intent` ([`AC_RenderIntent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_RenderIntent)): The rendering intent for colors outside the gamut of the destination profile. **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACApplyTransform`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACApplyTransform), [`ACUnReferenceTransform`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACUnReferenceTransform) #### ACMakePresetList ```cpp AC_Error ACMakePresetList(AC_PresetList *list, AC_SettingsType type) ``` Header: `AcroColorProcs.h:193` Creates a list of preset AcroColor engine (ACE) settings of the specified type. Clients should call ACUnReferencePresetList() when done with the preset list. A preset list is a list of predefined color settings that specifies the source and destination working color profiles to be used for color conversion. **Parameters** - `list` ([`AC_PresetList *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_PresetList)): (Filled by the method) A pointer to the new preset list object. - `type` ([`AC_SettingsType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_SettingsType)): The settings type (AC_SettingsType_Color or AC_SettingsType_Proof). **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACPresetListCount`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACPresetListCount), [`ACPresetListItemFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACPresetListItemFile), [`ACUnReferencePresetList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACUnReferencePresetList) #### ACMakeProfileList ```cpp AC_Error ACMakeProfileList(AC_ProfileList *list, AC_SelectorCode selector) ``` Header: `AcroColorProcs.h:109` Creates a list of device color profiles of a given type. Builds a list of those profiles from the database that meet the criterion of the specified selector. If the profile database has never been built, it will be automatically built without a progress callback. Clients should call ACUnReferenceProfileList() when done with the profile list. **Parameters** - `list` ([`AC_ProfileList *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_ProfileList)): (Filled by the method) A pointer to the new profile list object. - `selector` ([`AC_SelectorCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_SelectorCode)): The code for the type of device profile to include in the list. **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACProfileListCount`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileListCount), [`ACProfileListItemCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileListItemCode), [`ACProfileListItemDescription`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileListItemDescription), [`ACUnReferenceProfileList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACUnReferenceProfileList) #### ACMakeSettings ```cpp AC_Error ACMakeSettings(AC_Settings *settings, AC_SettingsType type) ``` Header: `AcroColorProcs.h:329` Creates an AcroColor engine (ACE) `settings` object of a given type, with no entries. When done with all operations, call ACUnReferenceSettings() to free the `settings` object. **Parameters** - `settings` ([`AC_Settings *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Settings)): (Filled by the method) A pointer to the new `settings` object. - `type` ([`AC_SettingsType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_SettingsType)): The settings type (AC_SettingsType_Color or AC_SettingsType_Proof). **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACGetSettingsProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACGetSettingsProfile), [`ACGetSettingsString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACGetSettingsString), [`ACGetSettingsUnsigned32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACGetSettingsUnsigned32), [`ACLoadSettings`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACLoadSettings), [`ACUnReferenceSettings`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACUnReferenceSettings) #### ACMakeString ```cpp AC_Error ACMakeString(AC_String *string, const char *ascii, const ASUTF16Val *unicode) ``` Header: `AcroColorProcs.h:786` Creates an AcroColor string from a `NULL`-terminated ASCII string or a `NULL`-terminated Unicode string, or both. If both ASCII and Unicode data are specified, the AC_String object keeps track of both in parallel, returning the ASCII data when asked for ASCII, and the Unicode data when asked for Unicode. These dual-encoded strings are useful as description strings for ICC profiles, which can store both ASCII and Unicode data in their description tags. The ICC profile standard requires that the ASCII version of the description string be limited to 7-bit ASCII characters. The AcroColor engine requires only the Unicode descriptions to be unique among profile descriptions. **Parameters** - `string` ([`AC_String *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_String)): (Filled by the method) A pointer to the new string object. - `ascii` (`const char *`): The ASCII data. It should be limited to 7-bit ASCII characters for use in profile descriptions. - `unicode` ([`const ASUTF16Val *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUTF16Val)): The Unicode data. All Unicode characters are two byte characters, in native byte order, including the trailing `NULL`. **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACProfileFromDescription`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileFromDescription), [`ACProfileListItemDescription`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileListItemDescription), [`ACStringASCII`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACStringASCII), [`ACStringLocalized`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACStringLocalized), [`ACStringUnicode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACStringUnicode), [`ACUnReferenceString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACUnReferenceString) #### ACMonitorProfile ```cpp AC_Error ACMonitorProfile(AC_Profile *profile, void *monitorID) ``` Header: `AcroColorProcs.h:525` Gets a device color profile for a specific monitor device. The returned profile may be either RGB or grayscale. If no profile is specified by the system, the method returns a default platform profile (sRGB on Windows). The client should call ACUnReferenceProfile() when done with the returned profile. **Note:** Platform: ((!MAC_PLATFORM || !AS_ARCH_64BIT)) && ((!MAC_PLATFORM)) **Parameters** - `profile` ([`AC_Profile *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Profile)): (Filled by the method) A pointer to the profile object. - `monitorID` (`void *`): A pointer to the platform-specific monitor device identifier. On Windows, this is a `NULL`-terminated ASCII string containing the monitor's device name (for example, `"Display"`) **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACGetSettingsProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACGetSettingsProfile), [`ACGetWorkingSpaceProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACGetWorkingSpaceProfile), [`ACMakeBufferProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeBufferProfile), [`ACMakeCalGray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeCalGray), [`ACMakeCalLab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeCalLab), [`ACMakeCalRGB`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeCalRGB), [`ACProfileFromCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileFromCode), [`ACProfileFromDescription`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileFromDescription), [`ACUnReferenceProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACUnReferenceProfile) #### ACMonitorProfileN ```cpp AC_Error ACMonitorProfileN(AC_Profile *profile, void *monitorID) ``` Header: `AcroColorProcs.h:1115` **Parameters** - `profile` ([`AC_Profile *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Profile)) - `monitorID` (`void *`) **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) #### ACPresetFileToName ```cpp AC_Error ACPresetFileToName(const AC_FileSpec *file, AC_String *name) ``` Header: `AcroColorProcs.h:264` [DEPRECATED] Translates a preset settings file specification to a name ready to be displayed in menus (with directory paths and file extensions removed). The client should call ACUnReferenceString() when done with the name. - If the file contains an internal name tag, the returned string is created from the internal name. - If the file does not contain an internal name tag, the returned string is built from the file name. In this case, the method assumes that the file name and the ASCII data of the returned string are in the local script code. **Note:** Platform: ((!MAC_PLATFORM || !AS_ARCH_64BIT)) && ((!MAC_PLATFORM)) **Parameters** - `file` (`const AC_FileSpec *`): A pointer to the preset file specification. - `name` ([`AC_String *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_String)): (Filled by the method) A pointer to the display name string. **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACPresetListItemFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACPresetListItemFile), [`ACUnReferenceString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACUnReferenceString), `replacement ACPresetListItemFileAndNameU` #### ACPresetListCount ```cpp AC_Error ACPresetListCount(AC_PresetList list, ASUns32 *count) ``` Header: `AcroColorProcs.h:207` Gets the number of predefined color settings, as listed in the color management settings in the Acrobat user interface. **Parameters** - `list` ([`AC_PresetList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_PresetList)): The preset list object. - `count` ([`ASUns32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): (Filled by the method) A pointer to the number of settings in the list. **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACMakePresetList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakePresetList), [`ACPresetListItemFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACPresetListItemFile), [`ACUnReferencePresetList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACUnReferencePresetList) #### ACPresetListItemFile ```cpp AC_Error ACPresetListItemFile(AC_PresetList list, ASUns32 index, AC_FileSpec *file) ``` Header: `AcroColorProcs.h:230` [DEPRECATED] Gets the file specification for a preset settings item in a preset list. **Note:** Platform: ((!MAC_PLATFORM || !AS_ARCH_64BIT)) && ((!MAC_PLATFORM)) **Parameters** - `list` ([`AC_PresetList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_PresetList)): The preset list object. - `index` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The item index in the list. - `file` (`AC_FileSpec *`): (Filled by the method) A pointer to the file specification for the item. **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACLoadSettings`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACLoadSettings), [`ACMakePresetList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakePresetList), [`ACPresetFileToName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACPresetFileToName), [`ACPresetListCount`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACPresetListCount), [`ACUnReferencePresetList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACUnReferencePresetList), `replacement ACPresetListItemFileAndNameU` #### ACPresetListItemFileAndNameU ```cpp AC_Error ACPresetListItemFileAndNameU(AC_PresetList list, ASUns32 index, AC_String *file, AC_String *name) ``` Header: `AcroColorProcs.h:1102` Returns the file specification and a display name of a specified preset in a list. The client should call ACE_UnReferenceString when done with the file and name. Either the file or name parameter can be NULL if the client does not need that value returned. It is an error if both parameters are NULL. Note: If the preset file contains an internal name tag, the returned string is created from the internal name. If the preset file does not contain an internal name tag, the returned string is built from the file name. Any leading path or trailing extension will be removed from the string. **Parameters** - `list` ([`AC_PresetList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_PresetList)) - `index` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)) - `file` ([`AC_String *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_String)) - `name` ([`AC_String *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_String)) **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) #### ACProfileColorSpace ```cpp AC_Error ACProfileColorSpace(AC_Profile profile, AC_ColorSpace *space) ``` Header: `AcroColorProcs.h:649` Gets the color space for a device profile. **Parameters** - `profile` ([`AC_Profile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Profile)): The device color profile. - `space` ([`AC_ColorSpace *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_ColorSpace)): (Filled by the method) A pointer to the color space. **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACProfileData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileData), [`ACProfileDescription`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileDescription) #### ACProfileData ```cpp AC_Error ACProfileData(AC_Profile profile, void *data) ``` Header: `AcroColorProcs.h:674` Gets the data for a device profile. Copies the raw ICC profile data into a supplied buffer. **Parameters** - `profile` ([`AC_Profile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Profile)): The device color profile. - `data` (`void *`): (Filled by the method) A pointer to the color profile data. **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACProfileColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileColorSpace), [`ACProfileDescription`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileDescription), [`ACProfileSize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileSize) #### ACProfileDescription ```cpp AC_Error ACProfileDescription(AC_Profile profile, AC_String *description) ``` Header: `AcroColorProcs.h:443` Gets the description of a device profile. The returned description string contains both ASCII and Unicode data, even if the profile itself only contains ASCII data. **Parameters** - `profile` ([`AC_Profile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Profile)): The device color profile. - `description` ([`AC_String *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_String)): (Filled by the method) A pointer to the description string. **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACMakeString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeString), [`ACProfileColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileColorSpace), [`ACProfileData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileData), [`ACProfileListItemDescription`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileListItemDescription), [`ACProfileFromDescription`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileFromDescription) #### ACProfileFromCode ```cpp AC_Error ACProfileFromCode(AC_Profile *profile, AC_ProfileCode code) ``` Header: `AcroColorProcs.h:496` Creates a device profile from a device profile type code. The client should call ACUnReferenceProfile() when done with the profile. **Parameters** - `profile` ([`AC_Profile *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Profile)): (Filled by the method) A pointer to the device color profile object. - `code` ([`AC_ProfileCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_ProfileCode)): The profile type code. **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACGetSettingsProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACGetSettingsProfile), [`ACGetWorkingSpaceProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACGetWorkingSpaceProfile), [`ACMakeBufferProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeBufferProfile), [`ACMakeCalGray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeCalGray), [`ACMakeCalLab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeCalLab), [`ACMakeCalRGB`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeCalRGB), [`ACMonitorProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMonitorProfile), [`ACProfileFromDescription`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileFromDescription), [`ACUnReferenceProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACUnReferenceProfile) #### ACProfileFromDescription ```cpp AC_Error ACProfileFromDescription(AC_Profile *profile, AC_String description) ``` Header: `AcroColorProcs.h:475` Finds a profile matching the description string in the database. The client should call ACUnReferenceProfile() when done with the profile. • If the description string contains Unicode text, the Unicode text is used to find the profile. • If the description string contains only ASCII text, the method tries to find a match. However, the AcroColor engine requires only Unicode descriptions to be unique, so this might return the wrong profile is in some rare cases. Use ASCII-only description strings only when Unicode description string are unavailable. **Parameters** - `profile` ([`AC_Profile *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Profile)): (Filled by the method) A pointer to the device color profile object. - `description` ([`AC_String`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_String)): The description string. **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACGetSettingsProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACGetSettingsProfile), [`ACGetWorkingSpaceProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACGetWorkingSpaceProfile), [`ACMakeBufferProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeBufferProfile), [`ACMakeCalGray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeCalGray), [`ACMakeCalLab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeCalLab), [`ACMakeCalRGB`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeCalRGB), [`ACMakeString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeString), [`ACMonitorProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMonitorProfile), [`ACProfileFromCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileFromCode), [`ACProfileListItemDescription`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileListItemDescription), [`ACUnReferenceProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACUnReferenceProfile) #### ACProfileListCount ```cpp AC_Error ACProfileListCount(AC_ProfileList list, ASUns32 *count) ``` Header: `AcroColorProcs.h:123` Gets the number of profiles in a device color profile list. **Parameters** - `list` ([`AC_ProfileList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_ProfileList)): The profile list. - `count` ([`ASUns32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): (Filled by the method) A pointer to the number of profiles in the list. **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACMakeProfileList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeProfileList), [`ACProfileListItemCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileListItemCode), [`ACProfileListItemDescription`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileListItemDescription) #### ACProfileListItemCode ```cpp AC_Error ACProfileListItemCode(AC_ProfileList list, ASUns32 index, AC_ProfileCode *code) ``` Header: `AcroColorProcs.h:164` Gets the profile code of a specified profile in a profile list. While this routine is not absolutely required, since the description string is always a unique reference, profile codes have the advantage that they are localization-independent. **Parameters** - `list` ([`AC_ProfileList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_ProfileList)): The profile list. - `index` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The index for the profile in the list. - `code` ([`AC_ProfileCode *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_ProfileCode)): (Filled by the method) A pointer to the profile code. If the specified profile does not have a code, this method returns AC_Profile_Null. **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACMakeProfileList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeProfileList), [`ACProfileListCount`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileListCount), [`ACProfileListItemDescription`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileListItemDescription) #### ACProfileListItemDescription ```cpp AC_Error ACProfileListItemDescription(AC_ProfileList list, ASUns32 index, AC_String *description) ``` Header: `AcroColorProcs.h:145` Returns the description string of a specified profile in a list. The returned description string always contains both ASCII and Unicode data, even if the profile itself only contains an ASCII version. You can store only the Unicode data in settings files if you wish; the ACProfileFromDescription() method finds the correct profile when passed the Unicode-only string. **Parameters** - `list` ([`AC_ProfileList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_ProfileList)): The profile list. - `index` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The index for the profile in the list. - `description` ([`AC_String *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_String)): (Filled by the method) A pointer to the profile description string. **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACMakeProfileList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeProfileList), [`ACMakeString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeString), [`ACProfileFromDescription`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileFromDescription), [`ACProfileListCount`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileListCount), [`ACProfileListItemCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileListItemCode) #### ACProfileSize ```cpp AC_Error ACProfileSize(AC_Profile profile, ASUns32 *size) ``` Header: `AcroColorProcs.h:660` Gets the size in bytes of the raw ICC profile data in a device profile. **Parameters** - `profile` ([`AC_Profile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Profile)): The device color profile object. - `size` ([`ASUns32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): (Filled by the method) A pointer to the profile data size. **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACProfileData`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileData) #### ACProfilesMatch ```cpp AC_Error ACProfilesMatch(AC_Profile workingProfile, AC_Profile documentProfile, ASBool *match) ``` Header: `AcroColorProcs.h:922` Compares the working device profile with the document device profile to determine if they are the same. This comparison ignores rendering intents, and is *fuzzy*, allowing very close, but not exactly the same, profiles to match. Equivalent profiles always match, but some non-equivalent profiles may also match. **Parameters** - `workingProfile` ([`AC_Profile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Profile)): The working device color profile. - `documentProfile` ([`AC_Profile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Profile)): The document's device color profile. - `match` ([`ASBool *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): (Filled by the method) A pointer to the result: `true` if the profiles match, `false` otherwise. **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACGetSettingsProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACGetSettingsProfile), [`ACGetWorkingSpaceProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACGetWorkingSpaceProfile), [`ACUnReferenceProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACUnReferenceProfile) #### ACSetBlackPointCompensation ```cpp AC_Error ACSetBlackPointCompensation(ASUns32 bpc) ``` Header: `AcroColorProcs.h:1149` Sets the black-point compensation flag, which controls whether to adjust for differences in black points when converting colors between color spaces. When enabled, the full dynamic range of the source space is mapped into the full dynamic range of the destination space. When disabled, the dynamic range of the source space is simulated in the destination space (which can result in blocked or gray shadows). **Parameters** - `bpc` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): `1` to enable black-point compensation, `0` otherwise. **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACSetBlackPointCompensation`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACSetBlackPointCompensation) #### ACSetEngine ```cpp AC_Error ACSetEngine(ASUns32 cmsID, ASUns32 cmmID) ``` Header: `AcroColorProcs.h:87` Sets the AcroColor engine (ACE) for the system, changing the global default CMS/CMM choice. This method rebuilds all existing transforms using the new engine. If the user aborts the process, or if the ACE runs out of resources during the rebuilding process, an error code is returned and some existing transforms may still use the previous engine choice. Everything will still work, since multiple engines can be used at once. Call the method again to restart the transform rebuilding process. **Parameters** - `cmsID` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The Color Management System identifier for the new engine default, as returned by ACEngineInfo(). - `cmmID` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The Color Management Module identifier for the new engine default, as returned by ACEngineInfo(). **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACEngineCount`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACEngineCount), [`ACEngineInfo`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACEngineInfo) #### ACStringASCII ```cpp AC_Error ACStringASCII(AC_String string, char *buffer, ASUns32 *count, ASUns32 maxCount) ``` Header: `AcroColorProcs.h:820` Copies the ASCII version of a string into a supplied buffer. Either the `buffer` or the `count` can be `NULL`. The ICC profile standard requires that ASCII version of the profile description string be limited to 7-bit ASCII characters. Depending on the API, operating system, file contents, and so on, the method can return strings in the local script code (8 bit single byte or 8 bit encoded multi-byte). Clients should always assume that the ASCII data is in the local script code (of which the 7-bit ASCII characters are a subset). **Parameters** - `string` ([`AC_String`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_String)): The AcroColor string containing ASCII data. If the string does not contain an ASCII version, the method returns AC_Error_NoASCII. - `buffer` (`char *`): (Filled by the method) A buffer to contain a copy of the ASCII data. - `count` ([`ASUns32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): (Filled by the method) A pointer to the size of `buffer` in bytes, including the trailing `NULL` character. - `maxCount` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The maximum size of `buffer` in bytes. If the length of the string is longer than this value, the method copies a truncated string to the `buffer` and returns AC_Error_StringOverflow. **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACMakeString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeString), [`ACStringLocalized`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACStringLocalized), [`ACStringUnicode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACStringUnicode), [`ACUnReferenceString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACUnReferenceString) #### ACStringLocalized ```cpp AC_Error ACStringLocalized(AC_String string, ASUTF16Val *buffer, ASUns32 *count, ASUns32 maxCount) ``` Header: `AcroColorProcs.h:854` Copies the localized Unicode version of a string into a supplied buffer. Either the `buffer` or the `count` can be `NULL`. The settings file format and ICC profiles later than version 2 can contain text in multiple languages or countries. When the AcroColor engine (ACE) create strings from these files or profiles, it uses the current language and country codes to create strings with a third fork: a localized Unicode version. These localized versions are intended for user display only and should not be stored in preferences files or action scripts, since they vary from country to country and are not portable. **Parameters** - `string` ([`AC_String`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_String)): The AcroColor string containing localized Unicode data. If the string does not contain a localized Unicode version, the method returns AC_Error_NoLocalized. - `buffer` ([`ASUTF16Val *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUTF16Val)): (Filled by the method) A buffer to contain a copy of the localized Unicode data. - `count` ([`ASUns32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): (Filled by the method) A pointer to the size (in bytes) of the `buffer`, including the trailing `NULL` character. - `maxCount` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The maximum size of the `buffer` in bytes. If the length of the string is longer than this value, the method copies a truncated string to the `buffer` and returns AC_Error_StringOverflow. **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACMakeString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeString), [`ACStringASCII`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACStringASCII), [`ACStringUnicode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACStringUnicode), [`ACUnReferenceString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACUnReferenceString) #### ACStringUnicode ```cpp AC_Error ACStringUnicode(AC_String string, ASUTF16Val *buffer, ASUns32 *count, ASUns32 maxCount) ``` Header: `AcroColorProcs.h:877` Copies the Unicode version of a string into a supplied buffer. Either the `buffer` or the `count` can be `NULL`. **Parameters** - `string` ([`AC_String`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_String)): The AcroColor string containing localized Unicode data. If the string does not contain a Unicode version, the method returns AC_Error_NoUnicode. - `buffer` ([`ASUTF16Val *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUTF16Val)): (Filled by the method) A buffer to contain a copy of the Unicode data. - `count` ([`ASUns32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): (Filled by the method) A pointer to the size of `buffer` in bytes, including the trailing `NULL` character. - `maxCount` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The maximum size of `buffer` in bytes. If the length of the string is longer than this value, the method copies a truncated string to the `buffer` and returns AC_Error_StringOverflow. **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACMakeString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeString), [`ACStringASCII`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACStringASCII), [`ACStringLocalized`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACStringLocalized), [`ACUnReferenceString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACUnReferenceString) #### ACSwatchBookColorSpace ```cpp AC_ColorSpace ACSwatchBookColorSpace(ACSwatchBook bp) ``` Header: `AcroColorProcs.h:1064` Retrieves the color space of the swatches in the swatchbook. **Parameters** - `bp` ([`ACSwatchBook`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACSwatchBook)) **Returns:** [`AC_ColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_ColorSpace) The color space of the swatchbook object (for example, all swatches are in this space). #### ACSwatchBookCount ```cpp ASUns32 ACSwatchBookCount(ACSwatchBookDB dbp) ``` Header: `AcroColorProcs.h:1005` Retrieves the number of swatchbooks available in the swatchbook database that was returned by `ACSwatchBookFind()`. **Parameters** - `dbp` ([`ACSwatchBookDB`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACSwatchBookDB)): A pointer to the swatchbook database object. **Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32) The number of swatchbooks in the database. #### ACSwatchBookDBDestroy ```cpp void ACSwatchBookDBDestroy(ACSwatchBookDB dbp) ``` Header: `AcroColorProcs.h:1027` Destroys the swatchbook database and frees any memory associated with it. **Parameters** - `dbp` ([`ACSwatchBookDB`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACSwatchBookDB)): A pointer to the swatchbook database object to be destroyed. **Returns:** `void` #### ACSwatchBookDescription ```cpp ASText ACSwatchBookDescription(ACSwatchBookDB dbp, ASUns32 ix) ``` Header: `AcroColorProcs.h:1021` Retrieves the description string for a swatchbook. **Parameters** - `dbp` ([`ACSwatchBookDB`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACSwatchBookDB)): A pointer to the swatchbook database object. - `ix` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The index of the swatchbook item. Its value is in the range `[0, swatchBookCount-1]`. **Returns:** [`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText) The description string for the swatchbook. #### ACSwatchBookDestroy ```cpp void ACSwatchBookDestroy(ACSwatchBook bp) ``` Header: `AcroColorProcs.h:1050` Destroys the swatchbook and frees any memory associated with it. **Parameters** - `bp` ([`ACSwatchBook`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACSwatchBook)) **Returns:** `void` #### ACSwatchBookGetSwatchName ```cpp ASText ACSwatchBookGetSwatchName(ACSwatchBook bp, ASUns32 ix) ``` Header: `AcroColorProcs.h:1079` Retrieves the name of a color swatch. **Parameters** - `bp` ([`ACSwatchBook`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACSwatchBook)) - `ix` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The index of the swatch. Its value is in the range `[0, swatchCount-1]`. **Returns:** [`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText) The name of the color swatch. #### ACSwatchBookGetSwatchValues ```cpp void ACSwatchBookGetSwatchValues(ACSwatchBook bp, ASUns32 ix, float *values) ``` Header: `AcroColorProcs.h:1087` Retrieves the color values associated with a color swatch. **Parameters** - `bp` ([`ACSwatchBook`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACSwatchBook)) - `ix` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The index of the swatch. Its value is in the range `[0, swatchCount-1]`. - `values` (`float *`): Values that are filled in by this call. **Returns:** `void` #### ACSwatchBookIsProcess ```cpp ASBool ACSwatchBookIsProcess(ACSwatchBook bp) ``` Header: `AcroColorProcs.h:1071` Determines whether the swatchbook is for a process color mode. **Parameters** - `bp` ([`ACSwatchBook`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACSwatchBook)) **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the swatchbook is for a process color mode, `false` if it is for spot. #### ACSwatchBookLoad ```cpp ACSwatchBook ACSwatchBookLoad(ACSwatchBookDB dbp, ASUns32 ix) ``` Header: `AcroColorProcs.h:1036` Retrieves an opaque `ACSwatchBook` object for the nth swatchbook. This loads the swatchbook into memory. Zero will be returned if there was an error. **Parameters** - `dbp` ([`ACSwatchBookDB`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACSwatchBookDB)): The swatchbook database. - `ix` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)) **Returns:** [`ACSwatchBook`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACSwatchBook) The swatchbook object. Call `ACSwatchBookDestroy()` when it is no longer needed. #### ACSwatchBookLoadFromPath ```cpp ACSwatchBook ACSwatchBookLoadFromPath(ACSwatchBookDB dbp, ASPathName path) ``` Header: `AcroColorProcs.h:1044` Retrieves an opaque `ACSwatchBook` object using the specified path. This loads the swatchbook into memory. Zero will be returned if there was an error. **Parameters** - `dbp` ([`ACSwatchBookDB`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACSwatchBookDB)): The swatchbook database. - `path` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): The path to the swatchbook file. **Returns:** [`ACSwatchBook`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACSwatchBook) The swatchbook object. Call `ACSwatchBookDestroy()` when it is no longer needed. #### ACSwatchBookNumberOfColors ```cpp ASUns32 ACSwatchBookNumberOfColors(ACSwatchBook bp) ``` Header: `AcroColorProcs.h:1057` Retrieves the number of color swatches in the swatchbook. **Parameters** - `bp` ([`ACSwatchBook`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACSwatchBook)) **Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32) The number of swatches in the swatchbook. #### ACSwatchBookTitle ```cpp ASText ACSwatchBookTitle(ACSwatchBookDB dbp, ASUns32 ix) ``` Header: `AcroColorProcs.h:1013` Retrieves the title of a swatchbook. **Parameters** - `dbp` ([`ACSwatchBookDB`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACSwatchBookDB)): A pointer to the swatchbook database object. - `ix` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The index of the swatchbook item. Its value is in the range `[0, swatchBookCount-1]`. **Returns:** [`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText) The title of the swatchbook. #### ACSwatchBooksFind ```cpp ACSwatchBookDB ACSwatchBooksFind(ASUns32 count, ASFileSys fs, ASPathName *folders) ``` Header: `AcroColorProcs.h:998` Retrieves an `ACSwatchBookDB` database object, containing the swatchbooks found by searching the folders given. The folders are usually determined by using the `AVAcquireSpecialFolderPathName`. This always scans the swatchbook directories, so this should be called every time one is going to make a list of the swatchbooks, in case a user installed a swatchbook in the user directory while the application was open. PDF library clients must pass in whatever folder location is appropriate. **Parameters** - `count` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The number of folders in the folders array. - `fs` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)) - `folders` ([`ASPathName *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): A pointer to an array of path names for the folders to search. **Returns:** [`ACSwatchBookDB`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACSwatchBookDB) A swatchbook database object. Call `ACSwatchBookDBDestroy()` when this is no longer needed. #### ACUnReferencePresetList ```cpp AC_Error ACUnReferencePresetList(AC_PresetList list) ``` Header: `AcroColorProcs.h:282` Decrements the reference count of a preset list object. If this causes the object's reference count to reach zero, the method deletes it. **Parameters** - `list` ([`AC_PresetList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_PresetList)): The preset list object. **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACMakePresetList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakePresetList) #### ACUnReferenceProfile ```cpp AC_Error ACUnReferenceProfile(AC_Profile profile) ``` Header: `AcroColorProcs.h:694` Decrements the reference count of a device color profile object. If this causes the object's reference count to reach zero, the method deletes it. **Parameters** - `profile` ([`AC_Profile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Profile)): The profile object. **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACGetSettingsProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACGetSettingsProfile), [`ACGetWorkingSpaceProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACGetWorkingSpaceProfile), [`ACMakeBufferProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeBufferProfile), [`ACMakeCalGray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeCalGray), [`ACMakeCalLab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeCalLab), [`ACMakeCalRGB`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeCalRGB), [`ACMonitorProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMonitorProfile), [`ACProfileFromCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileFromCode), [`ACProfileFromDescription`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileFromDescription) #### ACUnReferenceProfileList ```cpp AC_Error ACUnReferenceProfileList(AC_ProfileList list) ``` Header: `AcroColorProcs.h:174` Decrements the reference count of a device color profile list object. If this causes the object's reference count to reach zero, the method deletes it. **Parameters** - `list` ([`AC_ProfileList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_ProfileList)): The profile list object. **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACMakeProfileList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeProfileList) #### ACUnReferenceSettings ```cpp AC_Error ACUnReferenceSettings(AC_Settings settings) ``` Header: `AcroColorProcs.h:427` Decrements the reference count of an AcroColor engine `settings` object. If this causes the object's reference count to reach zero, the method deletes it. **Parameters** - `settings` ([`AC_Settings`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Settings)): The `settings` object. **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACMakeSettings`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeSettings) #### ACUnReferenceString ```cpp AC_Error ACUnReferenceString(AC_String string) ``` Header: `AcroColorProcs.h:887` Decrements the reference count of a string object. If this causes the object's reference count to reach zero, the method deletes it. **Parameters** - `string` ([`AC_String`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_String)): The string object. **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACMakeString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeString) #### ACUnReferenceTransform ```cpp AC_Error ACUnReferenceTransform(AC_Transform transform) ``` Header: `AcroColorProcs.h:752` Decrements the reference count of a color transformation object. If this causes the object's reference count to reach zero, the method deletes it. **Parameters** - `transform` ([`AC_Transform`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Transform)): The tranform object. **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) `0` if successful, a non-zero error code otherwise. **See also:** [`ACMakeColorTransform`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeColorTransform) #### PDColorConvertPDEElement ```cpp PDEElement PDColorConvertPDEElement(PDDoc doc, PDEElement elem, AC_Profile targetProfile, AC_RenderIntent intent, ASBool embed) ``` Header: `AcroColorProcs.h:984` Converts a PDEElement to the supplied color space. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document in which the element is located. - `elem` ([`PDEElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElement)): The element to convert. - `targetProfile` ([`AC_Profile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Profile)): The ICC profile to which the color should be converted. - `intent` ([`AC_RenderIntent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_RenderIntent)): The rendering intent to use for the conversion. AC_UseProfileIntent can be passed in order to use the default intent. (Note that it is not actually using the profile intent, but is using the current intent in the PDF graphics state). - `embed` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): If `true`, embed the color space and make the object calibrated. If it is `false` and the target profile is CMYK, RGB, or Gray, the colors space of the resulting object, after conversion, will be DeviceCMYK, DeviceRGB, or DeviceGray, respectively. **Returns:** [`PDEElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElement) A PDEElement containing the converted data. Note that the source element is copied and its reference count is not decremented, so the caller should decrement the source element's reference count if it is no longer needed. @see PDColorConvertPDEElementEx #### PDColorConvertPDEElementEx ```cpp PDEElement PDColorConvertPDEElementEx(PDDoc doc, PDEElement elem, PDColorConvertParamsEx params) ``` Header: `AcroColorProcs.h:1129` Converts a PDEElement to the supplied color space. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document in which the element is located. - `elem` ([`PDEElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElement)): The element to convert. - `params` ([`PDColorConvertParamsEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#PDColorConvertParamsEx)): The parameters block that describes how color conversions are to be performed. **Returns:** [`PDEElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElement) A PDEElement containing the converted data. Note that the source element is copied and its reference count is not decremented, so the caller should decrement the source element's reference count if it is no longer needed. @see PDColorConvertPDEElement #### PDColorConvertPDEElementEx2 ```cpp PDEElement PDColorConvertPDEElementEx2(PDDoc doc, PDEElement elem, PDColorConvertParamsEx params, ASInt32 pageNum) ``` Header: `AcroColorProcs.h:1187` Converts a PDEElement to the supplied color space. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document in which the element is located. - `elem` ([`PDEElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElement)): The element to convert. - `params` ([`PDColorConvertParamsEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#PDColorConvertParamsEx)): The parameters block that describes how color conversions are to be performed. - `pageNum` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The page on which the element is present. **Returns:** [`PDEElement`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEElement) A PDEElement containing the converted data. Note that the source element is copied and its reference count is not decremented, so the caller should decrement the source element's reference count if it is no longer needed. @see PDColorConvertPDEElement #### PDDocColorConvertEmbedOutputIntent ```cpp void PDDocColorConvertEmbedOutputIntent(PDDoc doc, AC_Profile OIProfile) ``` Header: `AcroColorProcs.h:964` Embeds an output intent into a document. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document in which to embed the output intent. - `OIProfile` ([`AC_Profile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Profile)) **Returns:** `void` #### PDDocColorConvertEmbedOutputIntentEx ```cpp void PDDocColorConvertEmbedOutputIntentEx(PDDoc doc, AC_Profile OIProfile, ASAtom subtype) ``` Header: `AcroColorProcs.h:1160` Embeds an output intent into a document. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document in which to embed the output intent. - `OIProfile` ([`AC_Profile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Profile)): The parameter from which to get the output intent, described as the target space. - `subtype` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The ASAtom for the name of output intent subtype created. The subtype must be one of the following: GTS_PDFX, GTS_PDFA1, or ISO_PDFE1. **Returns:** `void` #### PDDocColorConvertPage ```cpp ASBool PDDocColorConvertPage(PDDoc doc, PDColorConvertParams params, ASInt32 pageNum, ASProgressMonitor progMon, void *progMonData, PDColorConvertReportProc reportProc, void *reportProcData, ASBool *changed) ``` Header: `AcroColorProcs.h:937` Converts the colors (in place) on a page, as specified by the `params` block. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document in which to convert a page. - `params` ([`PDColorConvertParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#PDColorConvertParams)): The parameter block that describes how color conversions are to be performed. - `pageNum` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The page number of the page to convert. - `progMon` (`ASProgressMonitor`): The progress monitor callback. This call will set the duration of the monitor to the number of elements in the top-level content stream, and will update the value as the elements are converted. If this parameter is zero, no progress monitor callback is called. - `progMonData` (`void *`): The data element to be passed into progress monitor calls. - `reportProc` ([`PDColorConvertReportProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#PDColorConvertReportProc)): The reporting callback; it reports the attributes and action of each object converted to the callback. Passing in a zero reporting callback means that no reporting will be done. - `reportProcData` (`void *`): The data element to be passed into `reportProc`. - `changed` ([`ASBool *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)) **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the conversion was aborted or failed. **Exceptions** - `asGenErrBadParm`: The `params` block is malformed (for example, a reference or alias to a non-existent ink, or a circular alias). #### PDDocColorConvertPageEx ```cpp ASBool PDDocColorConvertPageEx(PDDoc doc, PDColorConvertParamsEx paramsEx, ASInt32 pageNum, ASProgressMonitor progMon, void *progMonData, PDColorConvertReportProc reportProc, void *reportProcData, ASBool *changed) ``` Header: `AcroColorProcs.h:954` Convert the colors (in place) in a page as specified by the `params` block. Takes an extended parameters block. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document in which to convert a page. - `paramsEx` ([`PDColorConvertParamsEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#PDColorConvertParamsEx)) - `pageNum` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The page number of the page to convert. - `progMon` (`ASProgressMonitor`): The progress monitor callback. This call will set the duration of the monitor to the number of elements in the top-level content stream, and will update the value as the elements are converted. If this parameter is zero, no progress monitor callback is called. - `progMonData` (`void *`): The data element to be passed into progress monitor calls. - `reportProc` ([`PDColorConvertReportProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#PDColorConvertReportProc)): The reporting callback; it reports the attributes and action of each object converted to the callback. Passing in a zero reporting callback means that no reporting will be done. - `reportProcData` (`void *`): The data element to be passed into `reportProc`. - `changed` ([`ASBool *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)) **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if the conversion was aborted or failed. **Exceptions** - `asGenErrBadParm`: The `params` block is ill-formed (for example, a reference or alias to a non-existent ink, or a circular alias). #### PDPageColorConvertEmbedOutputIntent ```cpp void PDPageColorConvertEmbedOutputIntent(PDPage page, AC_Profile OIProfile, ASAtom subtype) ``` Header: `AcroColorProcs.h:1172` Embeds an output intent into specified page. **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page in which to embed the output intent. - `OIProfile` ([`AC_Profile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Profile)): The parameter from which to get the output intent, described as the target space. - `subtype` ([`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): The ASAtom for the name of output intent subtype created. The subtype must be one of the following: GTS_PDFX, GTS_PDFA1, or ISO_PDFE1. **Returns:** `void` ### Typedefs (5) #### ACSwatchBook ```cpp typedef void* ACSwatchBook ``` Header: `AcroColorExpT.h:1648` Swatchbook object. #### ACSwatchBookDB ```cpp typedef void* ACSwatchBookDB ``` Header: `AcroColorExpT.h:1645` Swatchbook database object. #### PDColorConvertObjectAttributes ```cpp typedef ASUns32 PDColorConvertObjectAttributes ``` Header: `AcroColorExpT.h:1307` #### PDColorConvertSpaceType ```cpp typedef ASUns32 PDColorConvertSpaceType ``` Header: `AcroColorExpT.h:1361` #### PDColorConvertReportProc ```cpp typedef void(*) PDColorConvertReportProc(PDColorConvertObjectAttributes objectType, PDColorConvertSpaceType colorSpaceType, PDColorConvertActionType action, PDCompletionCode completionCode, PDReasonCode reasonCode, void *userData)(PDColorConvertObjectAttributes objectType, PDColorConvertSpaceType colorSpaceType, PDColorConvertActionType action, PDCompletionCode completionCode, PDReasonCode reasonCode, void *userData) ``` Header: `AcroColorExpT.h:1637` ### Structures (10) #### AC_PresetList ```cpp typedef struct ACPresetList* AC_PresetList ``` Header: `AcroColorExpT.h:193` #### AC_Profile ```cpp typedef struct ACProfile* AC_Profile ``` Header: `AcroColorExpT.h:173` #### AC_ProfileList ```cpp typedef struct ACProfileList* AC_ProfileList ``` Header: `AcroColorExpT.h:104` #### AC_Settings ```cpp typedef struct ACSettings* AC_Settings ``` Header: `AcroColorExpT.h:142` #### AC_String ```cpp typedef struct ACString* AC_String ``` Header: `AcroColorExpT.h:85` #### AC_Transform ```cpp typedef struct ACTransform* AC_Transform ``` Header: `AcroColorExpT.h:121` #### PDColorConvertAction ```cpp typedef struct PDColorConvertActionRec * PDColorConvertAction ``` Header: `AcroColorExpT.h:1441` #### PDColorConvertActionEx ```cpp typedef struct PDColorConvertActionRecEx * PDColorConvertActionEx ``` Header: `AcroColorExpT.h:1545` #### PDColorConvertParams ```cpp typedef struct PDColorConvertParamsRec * PDColorConvertParams ``` Header: `AcroColorExpT.h:1470` #### PDColorConvertParamsEx ```cpp typedef struct PDColorConvertParamsRecEx * PDColorConvertParamsEx ``` Header: `AcroColorExpT.h:1611` ### Enums (14) #### ACWorkingSpace Header: `AcroColorExpT.h:1237` Constants that specify the color space of working profiles. This enumeration is added for the purpose of ACGetWorkingSpaceProfile(). The profile returned by this function must be unreferenced by the caller. **Values** - `kACWorkingGray = 0`: Grayscale profile. - `kACWorkingRGB = 1`: RGB profile. - `kACWorkingCMYK = 2`: CMYK profile. - `kACWorkingSpaces = 3`: Working spaces. **See also:** [`ACGetWorkingSpaceProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACGetWorkingSpaceProfile) #### AC_ColorSpace Header: `AcroColorExpT.h:1118` Constant values for ICC color space signatures. **Values** - `AC_Space_XYZ = FOUR_CHAR_CODE('XYZ ')` - `AC_Space_Lab = FOUR_CHAR_CODE('Lab ')` - `AC_Space_RGB = FOUR_CHAR_CODE('RGB ')` - `AC_Space_Gray = FOUR_CHAR_CODE('GRAY')` - `AC_Space_CMYK = FOUR_CHAR_CODE('CMYK')` - `AC_Space_Luv = FOUR_CHAR_CODE('Luv ')` - `AC_Space_YCbCr = FOUR_CHAR_CODE('YCbr')` - `AC_Space_HSV = FOUR_CHAR_CODE('HSV ')` - `AC_Space_HLS = FOUR_CHAR_CODE('HLS ')` - `AC_Space_CMY = FOUR_CHAR_CODE('CMY ')` - `AC_Space_2Component = FOUR_CHAR_CODE('2CLR')` - `AC_Space_3Component = FOUR_CHAR_CODE('3CLR')` - `AC_Space_4Component = FOUR_CHAR_CODE('4CLR')` - `AC_Space_5Component = FOUR_CHAR_CODE('5CLR')` - `AC_Space_6Component = FOUR_CHAR_CODE('6CLR')` - `AC_Space_7Component = FOUR_CHAR_CODE('7CLR')` - `AC_Space_8Component = FOUR_CHAR_CODE('8CLR')` - `AC_Space_9Component = FOUR_CHAR_CODE('9CLR')` - `AC_Space_10Component = FOUR_CHAR_CODE('ACLR')` - `AC_Space_11Component = FOUR_CHAR_CODE('BCLR')` - `AC_Space_12Component = FOUR_CHAR_CODE('CCLR')` - `AC_Space_13Component = FOUR_CHAR_CODE('DCLR')` - `AC_Space_14Component = FOUR_CHAR_CODE('ECLR')` - `AC_Space_15Component = FOUR_CHAR_CODE('FCLR')` - `AC_Space_PhotoYCC = AC_Space_3Component`: Kodak's PhotoYCC space is stored as a generic 3-component space. - `AC_Space_Null = 0`: A null color space. Used to represent spot-only color spaces. - `AC_Space_MaxEnum = 0x7FFFFFFF`: This constant forces the enum to be 32 bits wide. **See also:** [`ACProfileColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileColorSpace) #### AC_Error Header: `AcroColorExpT.h:268` Error codes returned by AcroColor functions. **Values** - `AC_Error_None = 0`: No error. - `AC_Error_General = FOUR_CHAR_CODE('gen ')`: Other error. - `AC_Error_Param = FOUR_CHAR_CODE('parm')`: Bad parameters to an API call. - `AC_Error_Version = FOUR_CHAR_CODE('ver ')`: Application and ACE library mismatch. - `AC_Error_UserAbort = FOUR_CHAR_CODE('abrt')`: The user aborted the operation. Returned by ACE when the client progress callback returns `false`. - `AC_Error_Memory = FOUR_CHAR_CODE('memF')`: Out of memory. - `AC_Error_StackFull = FOUR_CHAR_CODE('stkF')`: Out of stack space. - `AC_Error_ScratchFull = FOUR_CHAR_CODE('scrF')`: Client callback ran out of scratch space. - `AC_Error_StringOverflow = FOUR_CHAR_CODE('strO')`: String does not fit in supplied buffer. - `AC_Error_NoASCII = FOUR_CHAR_CODE('noA ')`: String does not contain ASCII data. - `AC_Error_NoUnicode = FOUR_CHAR_CODE('noU ')`: String does not contain Unicode data. - `AC_Error_NoLocalized = FOUR_CHAR_CODE('noL ')`: String does not contain localized data. - `AC_Error_BadAlignment = FOUR_CHAR_CODE('alig')`: Data is not correctly byte aligned. - `AC_Error_BadDescription = FOUR_CHAR_CODE('bDes')`: Invalid profile description. - `AC_Error_BadConcat = FOUR_CHAR_CODE('bCat')`: Unable to concatenate transforms. - `AC_Error_BadMerge = FOUR_CHAR_CODE('bMrg')`: Unable to merge transforms. - `AC_Error_BadProfile = FOUR_CHAR_CODE('bPro')`: Invalid profile. - `AC_Error_UnsupCMS = FOUR_CHAR_CODE('uCMS')`: Unsupported CMS. - `AC_Error_UnsupOption = FOUR_CHAR_CODE('uOpt')`: Unsupported ACE option. - `AC_Error_UnsupPacking = FOUR_CHAR_CODE('uPac')`: Unsupported packing code. - `AC_Error_UnsupProfile = FOUR_CHAR_CODE('uPro')`: Unsupported profile version. - `AC_Error_UnsupProfileCode = FOUR_CHAR_CODE('uPrC')`: Unsupported profile code. - `AC_Error_UnsupSpace = FOUR_CHAR_CODE('uSpc')`: Unsupported color space. - `AC_Error_UnsupQuery = FOUR_CHAR_CODE('uQry')`: Unsupported query code. - `AC_Error_MissingProfile = FOUR_CHAR_CODE('misP')`: A profile was missing from the disk. - `AC_Error_ModifiedProfile = FOUR_CHAR_CODE('modP')`: The profile on disk has been modified. - `AC_Error_FileNotFound = FOUR_CHAR_CODE('fnf ')`: File is missing from disk. - `AC_Error_EOF = FOUR_CHAR_CODE('eof ')`: End of file error. - `AC_Error_FileLocked = FOUR_CHAR_CODE('flck')`: File locked error. - `AC_Error_DiskIO = FOUR_CHAR_CODE('io ')`: Disk I/O error. - `AC_Error_ColorSync = FOUR_CHAR_CODE('csE ')`: A problem using ColorSync. - `AC_Error_ICM = FOUR_CHAR_CODE('icmE')`: A problem using ICM. - `AC_Error_MissingKey = FOUR_CHAR_CODE('mKey')`: The color settings does not contain this key. - `AC_Error_InvalidSettings = FOUR_CHAR_CODE('iSet')`: The color settings file is invalid. - `AC_Error_SettingsVersion = FOUR_CHAR_CODE('vSet')`: The color settings file is an incompatible version. - `AC_Error_NotImplemented = FOUR_CHAR_CODE('nImp')`: The function is not implemented (subsetted library). - `AC_Error_MaxEnum = 0x7FFFFFFF`: This constant forces the `enum` to be 32 bits wide. #### AC_PackingCode Header: `AcroColorExpT.h:492` Constants that specify the packing used in a color transformation. **Values** - `AC_Packing_pRGB8 = FOUR_CHAR_CODE('prgb')`: 8-bit RGB (or grayscale destination), with a leading pad byte. When grayscale is output in this format, the gray value is replicated into to the R, G, and B values. `R, G, B = 0` is black. `R, G, B = 255` is white. Data must be 32-bit aligned. - `AC_Packing_RGB8 = FOUR_CHAR_CODE('rgb ')`: Same as AC_Packing_pRGB8, without the leading pad byte. Data need only be 8-bit aligned. - `AC_Packing_pRGB15 = FOUR_CHAR_CODE('PRGB')`: 15+ bit RGB (or grayscale destination), with a leading pad word. When grayscale is output in this format, the gray value is replicated into to the R, G, and B values. `R, G, B = 0` is black. `R, G, B = 32768` is white. Values greater than `32768` are invalid. Data must be 64-bit aligned. - `AC_Packing_CMYK8_Black0 = FOUR_CHAR_CODE('cmyk')`: 8-bit CMYK. `C, M, Y, K = 0` is 100% ink. `C, M, Y, K = 255` is 0% ink. Data must be 32-bit aligned. - `AC_Packing_CMYK8_White0 = FOUR_CHAR_CODE('cmyw')`: Same as AC_Packing_CMYK8_Black0 with inverse encoding. - `AC_Packing_CMYK15_Black0 = FOUR_CHAR_CODE('CMYK')`: 15+ bit CMYK. `C, M, Y, K = 0` is 100% ink. `C, M, Y, K = 32768` is 0% ink. Values greater than `32768` are invalid. Data must be 64-bit aligned. - `AC_Packing_pLab8 = FOUR_CHAR_CODE('plab')`: 8-bit LAB, with a leading pad byte. `L = 0` means `L* = 0.0` `L = 255` means `L* = 100.0` `a, b = 0` means `a*, b* = -128.0` `a, b = 128` means `a*, b* = 0.0` `a, b = 255` means `a*, b* = +127.0` Data must be 32-bit aligned. - `AC_Packing_Lab8 = FOUR_CHAR_CODE('lab ')`: Same as AC_Packing_pLab8, without the leading pad byte. Data need only be 8-bit aligned. - `AC_Packing_pLab15 = FOUR_CHAR_CODE('PLAB')`: 15+ bit LAB, with a leading pad word. `L = 0` means `L* = 0.0` `L = 32768` means `L* = 100.0` `a, b = 0` means `a*, b* = -128.0` `a, b = 16384` means `a*, b* = 0.0` `a, b = 32768` means `a*, b* = +128.0` Values greater than `32768` are invalid. Data must be 64-bit aligned. - `AC_Packing_Gray8_Black0 = FOUR_CHAR_CODE('g8k0')`: 8-bit grayscale or gamut test results, no padding. `G = 0` is 100% ink or black or fully out of gamut. `G = 255` is 0% ink or white or fully in gamut. When used for gamut test results, any value greater than or equal to `128` should be considered to be in gamut. - `AC_Packing_Gray8_White0 = FOUR_CHAR_CODE('g8w0')`: Same as AC_Packing_Gray8_Black0 with inverse encoding. - `AC_Packing_Gray15_Black0 = FOUR_CHAR_CODE('G15K')`: 15+ bit grayscale or gamut test results, no padding. `G = 0` is 100% ink or black or fully out of gamut. `G = 32768` is 0% ink or white or fully in gamut. Values greater than `32768` are invalid. Data must be 16-bit aligned. - `AC_Packing_pXYZ16 = FOUR_CHAR_CODE('PXYZ')`: 16-bit XYZ, with a leading pad word. `X, Y, Z = 0` means `X, Y, Z = 0.0` `X, Y, Z = 32768` means `X, Y, Z = 1.0` `X, Y, Z = 65535` means `X, Y, Z = 1.9999694824`. Data must be 64-bit aligned. - `AC_Packing_pABC8 = FOUR_CHAR_CODE('pabc')`: Generic padded 3-component 8-bit packing. Data must be 32-bit aligned. - `AC_Packing_ABC8 = FOUR_CHAR_CODE('abc ')`: Same as AC_Packing_pABC8, without the leading pad byte. Data need only be 8-bit aligned. - `AC_Packing_pABC15 = FOUR_CHAR_CODE('pABC')`: Generic padded 3-component 15+ bit packing. Data must be 64-bit aligned. - `AC_Packing_ABCD8 = FOUR_CHAR_CODE('abcd')`: Generic 4-component 8-bit packing. Data must be 32-bit aligned. - `AC_Packing_ABCD15 = FOUR_CHAR_CODE('ABCD')`: Generic 4-component 15+ bit packing. Data must be 64-bit aligned. - `AC_Packing_CS64_Gray = FOUR_CHAR_CODE('CS01')`: Packing codes for native 64-bit (gray) ColorSync formats (type "CMColor"). ICM2 also uses these packings formats (type "COLOR"). See the Apple ColorSync documentation for the details of these formats. These are mostly intended for internal use by ACE, and are not intended for use by most ACE clients. Data must be 16-bit aligned. - `AC_Packing_CS64_RGB = FOUR_CHAR_CODE('CS02')`: Packing codes for native 64-bit (RGB) ColorSync formats (type "CMColor"). ICM2 also uses these packings formats (type "COLOR"). See the Apple ColorSync documentation for the details of these formats. These are mostly intended for internal use by ACE, and are not intended for use by most ACE clients. Data must be 16-bit aligned. - `AC_Packing_CS64_CMYK = FOUR_CHAR_CODE('CS03')`: Packing codes for native 64-bit (CMYK) ColorSync formats (type "CMColor"). ICM2 also uses these packings formats (type "COLOR"). See the Apple ColorSync documentation for the details of these formats. These are mostly intended for internal use by ACE, and are not intended for use by most ACE clients. Data must be 16-bit aligned. - `AC_Packing_CS64_Lab = FOUR_CHAR_CODE('CS04')`: Packing codes for native 64-bit (Lab) ColorSync formats (type "CMColor"). ICM2 also uses these packings formats (type "COLOR"). See the Apple ColorSync documentation for the details of these formats. These are mostly intended for internal use by ACE, and are not intended for use by most ACE clients. Data must be 16-bit aligned. - `AC_Packing_CS64_XYZ = FOUR_CHAR_CODE('CS05')`: Packing codes for native 64-bit (xyz) ColorSync formats (type "CMColor"). ICM2 also uses these packings formats (type "COLOR"). See the Apple ColorSync documentation for the details of these formats. These are mostly intended for internal use by ACE, and are not intended for use by most ACE clients. Data must be 16-bit aligned. - `AC_Packing_CS64_ABC = FOUR_CHAR_CODE('CS06')`: Packing codes for native 64-bit (abc) ColorSync formats (type "CMColor"). ICM2 also uses these packings formats (type "COLOR"). See the Apple ColorSync documentation for the details of these formats. These are mostly intended for internal use by ACE, and are not intended for use by most ACE clients. Data must be 16-bit aligned. - `AC_Packing_CS64_ABCD = FOUR_CHAR_CODE('CS07')`: Packing codes for native 64-bit (abcd)ColorSync formats (type "CMColor"). ICM2 also uses these packings formats (type "COLOR"). See the Apple ColorSync documentation for the details of these formats. These are mostly intended for internal use by ACE, and are not intended for use by most ACE clients. Data must be 16-bit aligned. - `AC_Packing_Null = FOUR_CHAR_CODE('null')`: `NULL` data, for use with data in AC_Space_Null. - `AC_Packing_General = 0`: None of the above; use the general packing specification. - `AC_Packing_MaxEnum = 0x7FFFFFFF`: This constant forces the `enum` to be 32 bits wide. #### AC_ProfileCode Header: `AcroColorExpT.h:389` Constants that describe the type of a device color profile. **Values** - `AC_Profile_Null = 0`: A `NULL` result, indication that a profile is not a built-in profile. - `AC_Profile_Lab_D50 = FOUR_CHAR_CODE('LD50')`: Adobe's standard Lab profile. It has a white point of D50, and exactly matches the ICC's Lab PCS space. - `AC_Profile_PCS_XYZ = FOUR_CHAR_CODE('pXYZ')`: An XYZ profile that exactly matches the ICC's XYZ PCS space. - `AC_Profile_Flat_XYZ = FOUR_CHAR_CODE('fXYZ')`: An XYZ profile with a flat white point encoding (`X = Y = Z = 1.0`). Photoshop uses this as an intermediate space in its display loop. - `AC_Profile_sRGB = FOUR_CHAR_CODE('sRGB')`: HP's sRGB profile. The default Windows monitor profile. - `AC_Profile_AppleRGB = FOUR_CHAR_CODE('aRGB')`: Default RGB space using by Photoshop 4.0 and earlier. The default Mac OS monitor profile. - `AC_Profile_AdobeRGB1998 = FOUR_CHAR_CODE('AS98')`: A wider gamut RGB space recommended by Adobe. - `AC_Profile_ColorMatchRGB = FOUR_CHAR_CODE('cmat')`: A simplified version of Radius' ColorMatch RGB space, without Radius' non-zero black point. - `AC_Profile_Gamma18 = FOUR_CHAR_CODE('GG18')`: Grayscale display profile with a gamma of 18. - `AC_Profile_Gamma22 = FOUR_CHAR_CODE('GG22')`: Grayscale display profile with a gamma of 22. - `AC_Profile_DotGain10 = FOUR_CHAR_CODE('DG10')`: Grayscale printer profile with a dot gain of 10. - `AC_Profile_DotGain15 = FOUR_CHAR_CODE('DG15')`: Grayscale printer profile with a dot gain of 15. - `AC_Profile_DotGain20 = FOUR_CHAR_CODE('DG20')`: Grayscale printer profile with a dot gain of 20. - `AC_Profile_DotGain25 = FOUR_CHAR_CODE('DG25')`: Grayscale printer profile with a dot gain of 25. - `AC_Profile_DotGain30 = FOUR_CHAR_CODE('DG30')`: Grayscale printer profile with a dot gain of 30. - `AC_Profile_MonitorRGB = FOUR_CHAR_CODE('mRGB')`: The system "Monitor RGB" profile, which is the same profile as that returned by AC_MainMonitorProfile. - `AC_Profile_SystemRGB = FOUR_CHAR_CODE('sysR')`: The system default profiles for RGB color space. (Currently a ColorSync 3.0 only feature.) - `AC_Profile_SystemCMYK = FOUR_CHAR_CODE('sysC')`: The system default profiles for CMYK color space. (Currently a ColorSync 3.0 only feature.) - `AC_Profile_SystemGray = FOUR_CHAR_CODE('sysG')`: The system default profiles for Gray color space. (Currently a ColorSync 3.0 only feature.) - `AC_Profile_SystemInput = FOUR_CHAR_CODE('sysI')`: The system default profiles for input device type. (Currently a ColorSync 3.0 only feature.) - `AC_Profile_SystemOutput = FOUR_CHAR_CODE('sysO')`: The system default profiles for output device type. (Currently a ColorSync 3.0 only feature.) - `AC_Profile_SystemProofer = FOUR_CHAR_CODE('sysP')`: The system default profiles for proofer device type. (Currently a ColorSync 3.0 only feature.) - `AC_Profile_WorkingRGB = FOUR_CHAR_CODE('wRGB')`: The application working (RGB) color space profiles. (For use as abstact values only, since ACE does not keep track of these profiles, and thus cannot make profiles from these codes.) - `AC_Profile_WorkingCMYK = FOUR_CHAR_CODE('wCMY')`: The application working (CMYK) color space profiles. (For use as abstact values only, since ACE does not keep track of these profiles, and thus cannot make profiles from these codes.) - `AC_Profile_WorkingGray = FOUR_CHAR_CODE('wGry')`: The application working (gray) color space profiles. (For use as abstact values only, since ACE does not keep track of these profiles, and thus cannot make profiles from these codes.) - `AC_Profile_Acrobat5_CMYK = FOUR_CHAR_CODE('acr5')` - `AC_Profile_Acrobat9_CMYK = FOUR_CHAR_CODE('acr9')` - `AC_Profile_MaxEnum = 0x7FFFFFFF`: This constant forces the enum to be 32 bits wide. **See also:** [`ACProfileFromCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileFromCode), [`ACProfileListItemCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACProfileListItemCode) #### AC_RenderIntent Header: `AcroColorExpT.h:673` Constants that specify a standard ICC rendering intent for a device color profile. The rendering intent specifies the color translation method for colors that are outside the gamut of the color profile. **Values** - `AC_Perceptual = 0`: Tries to preserve the visual relationship between colors in a way that is perceived as natural to the human eye, although the color values themselves may change. This is the same as the Image intent in Adobe PageMaker and Illustrator. This option is suitable for photographic, continuous tone images. - `AC_RelColorimetric = 1`: The same as absolute colorimetric, except that it compares the white point of the source color space to that of the destination color space and shifts all other colors accordingly, rather than comparing individual colors. - `AC_Saturation = 2`: Tries to create vivid color at the expense of accurate color. It scales the source gamut to the destination gamut, but preserves relative saturation instead of hue, so that when scaling to a smaller gamut, hues may shift. This is the same as the Graphics intent in Adobe PageMaker and Illustrator. This option is suitable for business graphics and charts, where the exact relationship between colors is not as important as having bright saturated colors. - `AC_AbsColorimetric = 3`: Tries to maintain color accuracy at the expense of preserving relationships between colors. It leaves colors that fall inside the destination gamut unchanged. When translating to a smaller gamut, two colors that are distinct in the source space may be mapped to the same color in the destination space. This type of rendering can be more accurate than AC_RelColorimetric if the color profile of the image contains correct white point (extreme highlight) information. - `AC_UseProfileIntent = 4`: Use the source profile's rendering intent. - `AC_UseGStateIntent = 5`: This intent can be used ONLY in PDPageDrawContentsToMemoryWithParams. When it is used, the destination intent will be set to the same as the source intent - `AC_RenderIntentSize = 0x7FFFFFFF` **See also:** [`ACMakeCalGray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeCalGray), [`ACMakeCalLab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeCalLab), [`ACMakeCalRGB`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeCalRGB) #### AC_SelectorCode Header: `AcroColorExpT.h:200` Constants that specify the types of device profiles to include in a profile list. **Values** - `AC_Selector_RGB_Standard = FOUR_CHAR_CODE('rStd')`: Standard (recommended) RGB profiles. These profiles are always bidirectional. - `AC_Selector_RGB_OtherInputCapable = FOUR_CHAR_CODE('rInp')`: RGB profiles that can be used as a source. These profiles may or may not be usable as a destination. This constant does not include profiles selected by AC_Selector_RGB_Standard. - `AC_Selector_RGB_OtherOutputCapable = FOUR_CHAR_CODE('rOut')`: RGB profiles that can be used as a destination. These profiles are also usable as a source. This constant does not include profiles selected by AC_Selector_RGB_Standard. - `AC_Selector_CMYK_StandardInput = FOUR_CHAR_CODE('cSIn')`: Standard (recommended) CMYK profiles that can be used as a source. These profiles may or may not be usable as a destination. - `AC_Selector_CMYK_StandardOutput = FOUR_CHAR_CODE('cStd')`: Standard (recommended) CMYK profiles that can be used as a destination. These profiles are also usable as a source. - `AC_Selector_CMYK_OtherInputCapable = FOUR_CHAR_CODE('cInp')`: CMYK profiles that can be used as a source. These profiles may or may not be usable as a destination. This constant does not include profiles selected by AC_Selector_CMYK_StandardInput or AC_Selector_CMYK_StandardOutput. - `AC_Selector_CMYK_OtherOutputCapable = FOUR_CHAR_CODE('cOut')`: CMYK profiles that can be used as a destination. These profiles are also usable as a source. This constant does not include profiles selected by AC_Selector_CMYK_StandardOutput. - `AC_Selector_Gray_Standard = FOUR_CHAR_CODE('gStd')`: Standard (recommended) grayscale profiles. These profiles are always bidirectional. - `AC_Selector_Gray_OtherInputCapable = FOUR_CHAR_CODE('gInp')`: Grayscale profiles that can be used as a source. These profiles may or may not be usable as a destination. This constant does not include profiles selected by AC_Selector_Gray_Standard. - `AC_Selector_Gray_OtherOutputCapable = FOUR_CHAR_CODE('gOut')`: Grayscale profiles that can be used as a destination. These profiles are also usable as a source. This constant does not include profiles selected by AC_Selector_Gray_Standard. - `AC_Selector_DotGain_Standard = FOUR_CHAR_CODE('dStd')`: Standard dot gain profiles. This constant is used by Photoshop to represent a single ink's dot gain curve, and is stored as an ICC gray output profile. - `AC_Selector_DotGain_Other = FOUR_CHAR_CODE('dOth')`: Other grayscale printer profiles. This constant does not include profiles selected by AC_Selector_DotGain_Standard, and does not include grayscale display profiles. - `AC_Selector_PhotoYCC_InputCapable = FOUR_CHAR_CODE('iYCC')`: PhotoYCC profiles that can be used as a source. - `AC_Selector_MaxEnum = 0x7FFFFFFF`: This constant forces the enum to be 32 bits wide. **See also:** [`ACMakeProfileList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeProfileList) #### AC_SettingsKey Header: `AcroColorExpT.h:1015` Constant key values for an `AC_Settings` object. **Values** - `AC_Key_Name = FOUR_CHAR_CODE('name')`: Settings file name string (if different than the file name). - `AC_Key_Description = FOUR_CHAR_CODE('desc')`: Settings file description string. - `AC_Key_WriterName = FOUR_CHAR_CODE('wNam')`: Name of application to write this settings file. - `AC_Key_WorkingRGB = FOUR_CHAR_CODE('wRGB')`: Working RGB profile. - `AC_Key_WorkingCMYK = FOUR_CHAR_CODE('wCMY')`: Working CMYK profile. - `AC_Key_WorkingGray = FOUR_CHAR_CODE('wGry')`: Working gray profile. - `AC_Key_WorkingSpot = FOUR_CHAR_CODE('wSpt')`: Working spot profile. - `AC_Key_PolicyRGB = FOUR_CHAR_CODE('pRGB')`: RGB color management policy (AC_Policy `enum`). - `AC_Key_PolicyCMYK = FOUR_CHAR_CODE('pCMY')`: CMYK color management policy (AC_Policy `enum`). - `AC_Key_PolicyGray = FOUR_CHAR_CODE('pGry')`: Gray color management policy (AC_Policy `enum`). - `AC_Key_MismatchAskOpening = FOUR_CHAR_CODE('mAsk')`: Ask about profile mismatches when opening (`0` = no, `1` = yes). - `AC_Key_MismatchAskPasting = FOUR_CHAR_CODE('pAsk')`: Ask about profile mismatches when pasting (`0` = no, `1` = yes). - `AC_Key_MissingAskOpening = FOUR_CHAR_CODE('misA')`: Ask about missing profile when opening (`0` = no, `1` = yes). - `AC_Key_EngineCMS = FOUR_CHAR_CODE('eCMS')`: Conversion engine CMS code (4-char code, stored as `unsigned32`). - `AC_Key_EngineCMM = FOUR_CHAR_CODE('eCMM')`: Conversion engine CMM code (4-char code, stored as `unsigned32`). - `AC_Key_Intent = FOUR_CHAR_CODE('cInt')`: Conversion intent (standard ICC integer encoding). - `AC_Key_KPC = FOUR_CHAR_CODE('kpc ')`: Conversion black point compensation (`0` = no, `1` = yes). - `AC_Key_Dither = FOUR_CHAR_CODE('dith')`: Dither conversions between 8-bit color spaces (`0` = no, `1` = yes). - `AC_Key_CompressionEnabled = FOUR_CHAR_CODE('mce ')`: Enable or disable monitor compression (`0` = off, `1` = on). - `AC_Key_CompressionPercent = FOUR_CHAR_CODE('mcp ')`: Monitor compression percent (in percent). - `AC_Key_BlendGammaEnabled = FOUR_CHAR_CODE('bge ')`: Enable or disable RGB blending gamma (`0` = off, `1` = on). - `AC_Key_BlendGammaValue = FOUR_CHAR_CODE('bgv ')`: RGB blending gamma value (`100` = gamma 1.00). - `AC_Key_ProofType = FOUR_CHAR_CODE('pTyp')`: Proof type (AC_ProofType `enum`). - `AC_Key_ProofProfile = FOUR_CHAR_CODE('pPrf')`: Proof profile. - `AC_Key_Simulate = FOUR_CHAR_CODE('dSim')`: Display simulation (AC_Simulate `enum`). - `AC_Key_MaxEnum = 0x7FFFFFFF`: This constant forces the `enum` to be 32 bits wide. **See also:** [`ACGetSettingsProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACGetSettingsProfile), [`ACGetSettingsString`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACGetSettingsString), [`ACGetSettingsUnsigned32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACGetSettingsUnsigned32) #### AC_SettingsType Header: `AcroColorExpT.h:1101` Constant values that determine the type of an AC_Settings object. **Values** - `AC_SettingsType_Color = FOUR_CHAR_CODE('AsCs')`: Used to hold global color settings, such as working spaces. - `AC_SettingsType_Proof = FOUR_CHAR_CODE('AsPs')`: Used to specify the parameters for proofing a document. The Proof Setup Files generally control a per-window setting. - `AC_SettingsType_MaxEnum = 0x7FFFFFFF`: This constant forces the `enum` to be 32 bits wide. **See also:** [`ACMakePresetList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakePresetList), [`ACMakeSettings`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#ACMakeSettings) #### PDColorConvertActionType Header: `AcroColorExpT.h:1364` Action types: these specify what to do when an object is matched. **Values** - `kColorConvPreserve = 0`: Do nothing but handle ink aliases. - `kColorConvConvert = 1`: Convert to target space. - `kColorConvDecalibrate = 2`: Convert calibrated space to device space. - `kColorConvDownConvert = 3`: Convert NChannel space to DeviceN space. - `kColorConvToAltSpace = 4`: Convert spot to Alternate Space - `kColorConvMaxEnum = 0x7FFFFFFF`: Maximum enum value. #### PDColorConvertObjectAttributeFlags Header: `AcroColorExpT.h:1263` Object attributes: these are arranged as a bitmap. **Values** - `kColorConvObj_Image = _FLG(0)`: Object is an image. - `kColorConvObj_JPEG = _FLG(1)`: Object is a JPEG image. - `kColorConvObj_JPEG2000 = _FLG(2)`: Object is a JPEG2000 image. - `kColorConvObj_Lossy = _FLG(3)`: Image is in a lossy space. - `kColorConvObj_Lossless = _FLG(4)`: Image is in a non-lossy space. - `kColorConvObj_Text = _FLG(5)`: Object is text. - `kColorConvObj_LineArt = _FLG(6)`: Object is line-art (fill, stroke). - `kColorConvObj_Shade = _FLG(7)`: Object is a smooth shade. - `kColorConvObj_Transparent = _FLG(8)`: Object is not opaque. - `kColorConvObj_Overprinting = _FLG(9)`: Object overprints. - `kColorConvObj_OverprintMode = _FLG(10)`: Overprint mode (OPM) is set to `1`. - `kColorConvObj_AnyObject = (_FLG(0) | _FLG(5) | _FLG(6) | _FLG(7))`: Any object. - `kColorConvObj_MaxEnum = ASMAXInt32`: Maximum enum value. #### PDColorConvertSpaceTypeFlags Header: `AcroColorExpT.h:1310` Color Space attributes: these are arranged as a bitmap. **Values** - `kColorConvDeviceSpace = _FLG(0)`: Device color space. - `kColorConvCalibratedSpace = _FLG(1)`: Calibrated color space. - `kColorConvAlternateSpace = _FLG(3)`: Alternate color space. - `kColorConvBaseSpace = _FLG(4)`: Base of an indexed space. - `kColorConvIndexedSpace = _FLG(5)`: Indexed color space. - `kColorConvSeparationSpace = _FLG(6)`: Separation color space. - `kColorConvDeviceNSpace = _FLG(7)`: DeviceN color space. - `kColorConvNChannelSpace = _FLG(8)`: NChannel color space. - `kColorConvRGBSpace = _FLG(9)`: RGB color space. This should only be set if either Device space (unless Lab) or Calibrated space is set. - `kColorConvCMYKSpace = _FLG(10)`: CMYK color space. This should only be set if either Device space (unless Lab) or Calibrated space is set. - `kColorConvGraySpace = _FLG(11)`: Gray color space. This should only be set if either Device space (unless Lab) or Calibrated space is set. - `kColorConvLabSpace = _FLG(12)`: Lab color space. - `kColorConvertMatchProfile = _FLG(13)`: Match Specified Profile. This action should only be take if it is a decalibration, and the specified profile matches the color profile of the current color - `kColorConvAnySpace = (_FLG(0) | _FLG(1) | _FLG(2) | _FLG(3) | _FLG(4) | _FLG(5) | _FLG(6) | _FLG(7) | _FLG(8) | _FLG(9) | _FLG(10) | _FLG(11) | _FLG(12))`: Any color space. - `kColorConvSpace_MaxEnum = ASMAXInt32`: Maximum enum value. #### PDCompletionCode Header: `AcroColorExpT.h:1616` Callback completion code. **Values** - `PDCompletionSuccess = 0`: Success. - `PDCompletionContinue = 1`: Continue. - `PDCompletionAbort = 2`: Abort. #### PDReasonCode Header: `AcroColorExpT.h:1628` Callback reason code. **Values** - `PDReasonNone = 0`: None. - `PDReasonNotImplemented = 1`: None implemented. ### Definitions (6) #### FOUR_CHAR_CODE Header: `AcroColorExpT.h:50` Value: `(x)` #### _FLG Header: `AcroColorExpT.h:1260` Value: `(1 << n)` #### kACEMaxPathLength Header: `AcroColorExpT.h:1249` Value: `260` #### kACEMaxPathLength Header: `AcroColorExpT.h:1251` Value: `256` #### kACMaxPathLength Header: `AcroColorExpT.h:733` Value: `260` #### kACMaxPathLength Header: `AcroColorExpT.h:735` Value: `256` --- # APDFL Plugins Source: https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins ## ocrengine ### Functions (27) #### OCREngineInitialize ```cpp ASBool OCREngineInitialize(void) ``` Header: `OCREngineProcs.h:8` Initializes the OCREngine Plug-in. **Parameters** - (unnamed) (`void`) **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) An ASBool value. #### OCREngineTerminate ```cpp void OCREngineTerminate(void) ``` Header: `OCREngineProcs.h:14` Terminates the OCREngine Plug-in. **Parameters** - (unnamed) (`void`) **Returns:** `void` void. #### PDOCRCreateEngine ```cpp OCREngine PDOCRCreateEngine(OCRParams params) ``` Header: `OCREngineProcs.h:33` Create an opaque OCREngine from the supplied parameters. **Parameters** - `params` ([`OCRParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#OCRParams)): IN OCRParams object used to configure the engine. **Returns:** [`OCREngine`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#OCREngine) An OCREngine that must be released with PDOCRReleaseEngine. #### PDOCRCreateForm ```cpp PDEForm PDOCRCreateForm(OCREngine engine, PDDoc doc, PDEImage image, ASInt32 resolution, OCRMissingFontStrategy strategy) ``` Header: `OCREngineProcs.h:59` Recognizes Text in a PDEImage, at a specified resolution, creating a PDEForm with the Image and Text underneath it. Knowing the image's resolution can enhance recognition. NOTE: Determining the resolution of the image is the caller's responsibility. Creates a PDEForm element containing the image, and additional text underneath. The PDEForm element has a transformation matrix which makes it directly substitutable for the image in a Content stream. The PDEForm will be created in the specified document, sharing fonts with the results of recognizing text in other images. If a font that will represent all the characters in a word can't be found, the missingFontStrategy will determine the behavior to employ. **Parameters** - `engine` ([`OCREngine`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#OCREngine)): IN OCREngine object - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN PDDoc object - `image` ([`PDEImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage)) - `resolution` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN image resolution for PDEImage object, in DPI - `strategy` ([`OCRMissingFontStrategy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#OCRMissingFontStrategy)): IN specifies the behavior to take if a Font isn't available to represent the Text **Returns:** [`PDEForm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEForm) a PDEForm composing the supplied image with the recognized text underneath #### PDOCRDefaultParams ```cpp OCRParams PDOCRDefaultParams(void) ``` Header: `OCREngineProcs.h:20` Return a reference to a set of OCRParams, already configured with defaults. **Parameters** - (unnamed) (`void`) **Returns:** [`OCRParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#OCRParams) A fresh copy of the OCRParams. #### PDOCRGetLanguagesInstalled ```cpp OCRLanguage * PDOCRGetLanguagesInstalled(void) ``` Header: `OCREngineProcs.h:73` Get the Languages installed as an array of OCRLanguage elements. This array isn't modifiable. The length is given by PDOCRGetNumLanguagesInstalled(). **Parameters** - (unnamed) (`void`) **Returns:** [`OCRLanguage *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#OCRLanguage) an array of OCRLanguage elements. #### PDOCRGetNumLanguagesInstalled ```cpp ASInt32 PDOCRGetNumLanguagesInstalled(void) ``` Header: `OCREngineProcs.h:65` Get the number of Languages installed. **Parameters** - (unnamed) (`void`) **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) number of languages installed. #### PDOCRParamsGetCandidateFonts ```cpp ASAtom * PDOCRParamsGetCandidateFonts(OCRParams params) ``` Header: `OCREngineProcs.h:218` Get the Candidate Fonts used to try to match recognized text, as an array of ASAtoms. Each ASAtom represents a name for a font to try to use for text recognition. The default list should work well in most cases. If you're using text that isn't represented by Latin fonts, or by Chinese, Japanese, or Korean fonts, then retrieve this list, add the font that can represent that text, then set that new list on OCRParams. Enough font names must be supplied to cover the expected languages/scripts in use. The code selects a font to represent each word. If a word code-switches between different scripts, for instance, if it contains non-Latin text and Arabic numerals, then make sure to supply the name of a font family that can handle both the text and the numerals. The quality of the results depends on the font choice. The list is searched in order until a font works for a particular word. To make the text fit better, it's recommended to list proportional fonts before fixed-width fonts. Decorative fonts with flourishes, like Zapf Chancery, deliver poor results. Generally, supply a font that would be used in block text, such as in a newspaper or work of literature, such as Times Roman, or a font already in the list, like MinionPro. If the PDOCRCreateForm() function can't identify a font that covers the whole text of a word, it will follow the policy set by the OCRMissingFontStrategy parameter. A candidate font that is not installed is skipped. The default list names only fonts APDFL supplies. To recognize a script APDFL supplies no font for, use PDOCRParamsSetCandidateFonts() to add a font that covers it and that you have the right to embed. Each element is an ASAtom corresponding to a string representing a candidate font. This array can only be modified by calling PDOCRParamsSetCandidateFonts(). The length is given by PDOCRParamsGetNumCandidateFonts(). **Parameters** - `params` ([`OCRParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#OCRParams)): IN OCRParams object **Returns:** [`ASAtom *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom) an array of ASAtoms #### PDOCRParamsGetConfigParameterCount ```cpp ASInt32 PDOCRParamsGetConfigParameterCount(OCRParams params) ``` Header: `OCREngineProcs.h:290` Get the number of engine-specific configuration parameters currently set. **Parameters** - `params` ([`OCRParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#OCRParams)): IN OCRParams object to query. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) Number of key-value pairs, or 0 if params is NULL. #### PDOCRParamsGetConfigParameterKey ```cpp const char * PDOCRParamsGetConfigParameterKey(OCRParams params, ASInt32 index) ``` Header: `OCREngineProcs.h:299` Get an engine-specific configuration parameter key by index. **Parameters** - `params` ([`OCRParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#OCRParams)): IN OCRParams object to query. - `index` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN Index of the parameter (0 to count-1). **Returns:** `const char *` The key string, or NULL if params is NULL or index is out of range. #### PDOCRParamsGetConfigParameterValue ```cpp const char * PDOCRParamsGetConfigParameterValue(OCRParams params, ASInt32 index) ``` Header: `OCREngineProcs.h:308` Get an engine-specific configuration parameter value by index. **Parameters** - `params` ([`OCRParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#OCRParams)): IN OCRParams object to query. - `index` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN Index of the parameter (0 to count-1). **Returns:** `const char *` The value string, or NULL if params is NULL or index is out of range. #### PDOCRParamsGetLanguagesConfigured ```cpp OCRLanguage * PDOCRParamsGetLanguagesConfigured(OCRParams params) ``` Header: `OCREngineProcs.h:142` Get the Languages configured to be recognized, as an array of OCRLanguage elements. This array can only be modified by calling PDOCRParamsSetLanguagesConfigured(). The length is given by PDOCRParamsGetNumLanguagesConfigured(). **Parameters** - `params` ([`OCRParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#OCRParams)): IN OCRParams object **Returns:** [`OCRLanguage *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#OCRLanguage) an array of OCRLanguage elements. #### PDOCRParamsGetNumCandidateFonts ```cpp ASInt32 PDOCRParamsGetNumCandidateFonts(OCRParams params) ``` Header: `OCREngineProcs.h:181` Get the Number of Candidate Fonts to try to match recognized text. The default list should work well in most cases. If you're using text that isn't represented by Latin fonts, or by Chinese, Japanese, or Korean fonts, then retrieve this list, add the font that can represent that text, then set that new list on OCRParams. Enough font names must be supplied to cover the expected languages/scripts in use. The code selects a font to represent each word. If a word code-switches between different scripts, for instance, if it contains non-Latin text and Arabic numerals, then make sure to supply the name of a font family that can handle both the text and the numerals. The quality of the results depends on the font choice. The list is searched in order until a font works for a particular word. To make the text fit better, it's recommended to list proportional fonts before fixed-width fonts. Decorative fonts with flourishes, like Zapf Chancery, deliver poor results. Generally, supply a font that would be used in block text, such as in a newspaper or work of literature, such as Times Roman, or a font already in the list, like MinionPro. If the PDOCRCreateForm() function can't identify a font that covers the whole text of a word, it will follow the policy set by the OCRMissingFontStrategy parameter. A candidate font that is not installed is skipped. The default list names only fonts APDFL supplies. To recognize a script APDFL supplies no font for, use PDOCRParamsSetCandidateFonts() to add a font that covers it and that you have the right to embed. **Parameters** - `params` ([`OCRParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#OCRParams)): IN OCRParams object **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) the number of candidate font members in the OCRParams #### PDOCRParamsGetNumLanguagesConfigured ```cpp ASInt32 PDOCRParamsGetNumLanguagesConfigured(OCRParams params) ``` Header: `OCREngineProcs.h:132` Get the Number of Languages configured to be recognized. **Parameters** - `params` ([`OCRParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#OCRParams)): IN OCRParams object **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) the number of languages currently configured in the OCRParams object #### PDOCRParamsGetPageSegmentationMode ```cpp OCRPageSegmentationMode PDOCRParamsGetPageSegmentationMode(OCRParams params) ``` Header: `OCREngineProcs.h:116` Get the page segmentation mode parameter for an OCRParams object. Specifies how the OCR engine will view the page, and how it detects text segments. **Parameters** - `params` ([`OCRParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#OCRParams)): IN OCRParams object **Returns:** [`OCRPageSegmentationMode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#OCRPageSegmentationMode) the OCRPageSegmentationMode value set in the OCRParams object. #### PDOCRParamsGetPerformance ```cpp OCRPerformance PDOCRParamsGetPerformance(OCRParams params) ``` Header: `OCREngineProcs.h:80` Get the performance parameter from an OCRParams object. **Parameters** - `params` ([`OCRParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#OCRParams)): IN OCRParams object **Returns:** [`OCRPerformance`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#OCRPerformance) the OCRPerformance value set in the OCRParams object. #### PDOCRParamsGetPreprocessing ```cpp ASBool PDOCRParamsGetPreprocessing(OCRParams params) ``` Header: `OCREngineProcs.h:97` Get the Preprocessing setting. Indicates if image preprocessing (including rescaling, denoising, and deskewing) is enabled before OCR to improve character recognition. **Parameters** - `params` ([`OCRParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#OCRParams)): IN OCRParams object **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) the state of the preprocess flag #### PDOCRParamsResetConfigParameters ```cpp void PDOCRParamsResetConfigParameters(OCRParams params) ``` Header: `OCREngineProcs.h:282` Clear all previously set engine-specific configuration parameters. **Parameters** - `params` ([`OCRParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#OCRParams)): IN OCRParams object to be modified. **Returns:** `void` #### PDOCRParamsSetCandidateFonts ```cpp void PDOCRParamsSetCandidateFonts(OCRParams params, ASAtom *fonts, ASInt32 numFonts) ``` Header: `OCREngineProcs.h:252` Set the Candidate Fonts used to try to match recognized text. The default list should work well in most cases. If you're using text that isn't represented by Latin fonts, or by Chinese, Japanese, or Korean fonts, then retrieve this list, add the font that can represent that text, then set that new list on OCRParams. Enough font names must be supplied to cover the expected languages/scripts in use. The code selects a font to represent each word. If a word code-switches between different scripts, for instance, if it contains non-Latin text and Arabic numerals, then make sure to supply the name of a font family that can handle both the text and the numerals. The quality of the results depends on the font choice. The list is searched in order until a font works for a particular word. To make the text fit better, it's recommended to list proportional fonts before fixed-width fonts. Decorative fonts with flourishes, like Zapf Chancery, deliver poor results. Generally, supply a font that would be used in block text, such as in a newspaper or work of literature, such as Times Roman, or a font already in the list, like MinionPro. If the PDOCRCreateForm() function can't identify a font that covers the whole text of a word, it will follow the policy set by the OCRMissingFontStrategy parameter. A candidate font that is not installed is skipped. The default list names only fonts APDFL supplies. To recognize a script APDFL supplies no font for, use PDOCRParamsSetCandidateFonts() to add a font that covers it and that you have the right to embed. Each element is an ASAtom corresponding to a string representing a candidate font. **Parameters** - `params` ([`OCRParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#OCRParams)): IN OCRParams object - `fonts` ([`ASAtom *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): IN an array of ASAtoms to set as candidate fonts - `numFonts` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): the size of the fonts array **Returns:** `void` #### PDOCRParamsSetConfigParameter ```cpp ASBool PDOCRParamsSetConfigParameter(OCRParams params, const char *key, const char *value) ``` Header: `OCREngineProcs.h:275` Set an engine-specific configuration parameter. Multiple calls accumulate parameters. Calling with the same key replaces the previous value. These parameters are passed through to the underlying OCR engine (e.g., Tesseract) as engine-specific settings. See the OCR engine documentation for valid parameter names and values. **Parameters** - `params` ([`OCRParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#OCRParams)): IN OCRParams object to be modified. - `key` (`const char *`): IN Parameter name (will be copied). Must not be NULL. - `value` (`const char *`): IN Parameter value (will be copied). Must not be NULL. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) true on success, false on failure (e.g., NULL params/key/value or memory allocation failure). #### PDOCRParamsSetLanguagesConfigured ```cpp void PDOCRParamsSetLanguagesConfigured(OCRParams params, OCRLanguage *languages, ASInt32 numLanguages) ``` Header: `OCREngineProcs.h:150` Set the Languages configured to be recognized, as an array of OCRLanguage elements. **Parameters** - `params` ([`OCRParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#OCRParams)): IN OCRParams object - `languages` ([`OCRLanguage *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#OCRLanguage)): IN languages to configure OCREngine with - `numLanguages` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): the size of the languages array **Returns:** `void` #### PDOCRParamsSetPageSegmentationMode ```cpp void PDOCRParamsSetPageSegmentationMode(OCRParams params, OCRPageSegmentationMode pageSegmentationMode) ``` Header: `OCREngineProcs.h:125` Set the page segementation mode parameter for an OCRParams object. Specifies how the OCR engine will view the page, and how it detects text segments. **Parameters** - `params` ([`OCRParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#OCRParams)): IN OCRParams object to be modified. - `pageSegmentationMode` ([`OCRPageSegmentationMode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#OCRPageSegmentationMode)) **Returns:** `void` #### PDOCRParamsSetPerformance ```cpp void PDOCRParamsSetPerformance(OCRParams params, OCRPerformance performance) ``` Header: `OCREngineProcs.h:87` Set the performance parameter for an OCRParams object. **Parameters** - `params` ([`OCRParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#OCRParams)): IN OCRParams object to be modified. - `performance` ([`OCRPerformance`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#OCRPerformance)): IN the OCRPerformance value to set on the OCRParams object. **Returns:** `void` #### PDOCRParamsSetPreprocessing ```cpp void PDOCRParamsSetPreprocessing(OCRParams params, ASBool preprocessing) ``` Header: `OCREngineProcs.h:107` Set the Preprocessing setting. Indicates if image preprocessing (including rescaling, denoising, and deskewing) is enabled before OCR to improve character recognition. **Parameters** - `params` ([`OCRParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#OCRParams)): IN OCRParams object - `preprocessing` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): IN whether to preprocess before OCR **Returns:** `void` #### PDOCRRecognizePage ```cpp void PDOCRRecognizePage(PDPage page, OCREngine engine, OCRMissingFontStrategy strategy) ``` Header: `OCREngineProcs.h:261` Run optical character recognition (OCR) on a page. **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): IN The page being OCR'd - `engine` ([`OCREngine`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#OCREngine)): IN Configured OCREngine object - `strategy` ([`OCRMissingFontStrategy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#OCRMissingFontStrategy)): IN specifies the behavior to take if a Font isn't available to represent the Text **Returns:** `void` #### PDOCRReleaseEngine ```cpp void PDOCRReleaseEngine(OCREngine engine) ``` Header: `OCREngineProcs.h:39` Release an OCREngine created with PDOCRCreateEngine. **Parameters** - `engine` ([`OCREngine`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#OCREngine)): IN OCREngine to be released. **Returns:** `void` #### PDOCRReleaseParams ```cpp void PDOCRReleaseParams(OCRParams params) ``` Header: `OCREngineProcs.h:26` Release an OCRParams obtained with PDOCRDefaultParams. **Parameters** - `params` ([`OCRParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#OCRParams)): IN OCRParams object to be released. **Returns:** `void` ### Structures (2) #### OCREngine ```cpp typedef struct _t_OCREngineRec* OCREngine ``` Header: `OCREngineExpT.h:205` #### OCRParams ```cpp typedef struct _t_OCRParamsRec* OCRParams ``` Header: `OCREngineExpT.h:203` ### Enums (4) #### OCRLanguage Header: `OCREngineExpT.h:70` Enumeration to specify the language. **Values** - `OCRLanguage_English = 0` - `OCRLanguage_Dutch = 1` - `OCRLanguage_French = 2` - `OCRLanguage_German = 3` - `OCRLanguage_Italian = 4` - `OCRLanguage_Portuguese = 5` - `OCRLanguage_Spanish = 6` - `OCRLanguage_Arabic = 7` - `OCRLanguage_Armenian = 8` - `OCRLanguage_ChineseTraditional = 9` - `OCRLanguage_ChineseTraditionalVertical = 10` - `OCRLanguage_ChineseSimplified = 11` - `OCRLanguage_ChineseSimplifiedVertical = 12` - `OCRLanguage_Japanese = 13` - `OCRLanguage_JapaneseVertical = 14` - `OCRLanguage_Korean = 15` - `OCRLanguage_KoreanVertical = 16` - `OCRLanguage_Afrikaans = 17` - `OCRLanguage_Amharic = 18` - `OCRLanguage_Assamese = 19` - `OCRLanguage_Azerbaijani = 20` - `OCRLanguage_AzerbaijaniCyrillic = 21` - `OCRLanguage_Belarusian = 22` - `OCRLanguage_Bengali = 23` - `OCRLanguage_Tibetan = 24` - `OCRLanguage_Bosnian = 25` - `OCRLanguage_Breton = 26` - `OCRLanguage_Bulgarian = 27` - `OCRLanguage_Catalan = 28` - `OCRLanguage_Corsican = 29` - `OCRLanguage_Cebuano = 30` - `OCRLanguage_Czech = 31` - `OCRLanguage_Cherokee = 32` - `OCRLanguage_Welsh = 33` - `OCRLanguage_Danish = 34` - `OCRLanguage_DanishFraktur = 35` - `OCRLanguage_Dhivehi = 36` - `OCRLanguage_Dzongkha = 37` - `OCRLanguage_Greek = 38` - `OCRLanguage_EnglishMiddle = 39` - `OCRLanguage_Esperanto = 40` - `OCRLanguage_MathEquationDetection = 41` - `OCRLanguage_Estonian = 42` - `OCRLanguage_Faroese = 43` - `OCRLanguage_Basque = 44` - `OCRLanguage_Persian = 45` - `OCRLanguage_Finnish = 46` - `OCRLanguage_Filipino = 47` - `OCRLanguage_GermanFraktur = 48` - `OCRLanguage_FrenchMiddle = 49` - `OCRLanguage_Frisian = 50` - `OCRLanguage_Irish = 51` - `OCRLanguage_Galician = 52` - `OCRLanguage_ScotsGaelic = 53` - `OCRLanguage_GreekAncient = 54` - `OCRLanguage_Gujarati = 55` - `OCRLanguage_Haitian = 56` - `OCRLanguage_Hebrew = 57` - `OCRLanguage_Hindi = 58` - `OCRLanguage_Croatian = 59` - `OCRLanguage_Hungarian = 60` - `OCRLanguage_Inuktitut = 61` - `OCRLanguage_Indonesian = 62` - `OCRLanguage_Icelandic = 63` - `OCRLanguage_ItalianOld = 64` - `OCRLanguage_Javanese = 65` - `OCRLanguage_Kannada = 66` - `OCRLanguage_Georgian = 67` - `OCRLanguage_GeorgianOld = 68` - `OCRLanguage_Kazakh = 69` - `OCRLanguage_CentralKhmer = 70` - `OCRLanguage_Kyrgyz = 71` - `OCRLanguage_Kurmanji = 72` - `OCRLanguage_KurdishArabicScript = 73` - `OCRLanguage_Lao = 74` - `OCRLanguage_Latin = 75` - `OCRLanguage_Latvian = 76` - `OCRLanguage_Lithuanian = 77` - `OCRLanguage_Luxembourgish = 78` - `OCRLanguage_Malayalam = 79` - `OCRLanguage_Marathi = 80` - `OCRLanguage_Macedonian = 81` - `OCRLanguage_Maltese = 82` - `OCRLanguage_Mongolian = 83` - `OCRLanguage_Maori = 84` - `OCRLanguage_Malay = 85` - `OCRLanguage_Burmese = 86` - `OCRLanguage_Nepali = 87` - `OCRLanguage_Norwegian = 88` - `OCRLanguage_Occitan = 89` - `OCRLanguage_Oriya = 90` - `OCRLanguage_OrientationAndScriptDetection = 91` - `OCRLanguage_Panjabi = 92` - `OCRLanguage_Polish = 93` - `OCRLanguage_Pashto = 94` - `OCRLanguage_Quechua = 95` - `OCRLanguage_Romanian = 96` - `OCRLanguage_Russian = 97` - `OCRLanguage_Sanskrit = 98` - `OCRLanguage_Sinhala = 99` - `OCRLanguage_Slovak = 100` - `OCRLanguage_SlovakFraktur = 101` - `OCRLanguage_Slovenian = 102` - `OCRLanguage_Sindhi = 103` - `OCRLanguage_SpanishOld = 104` - `OCRLanguage_Albanian = 105` - `OCRLanguage_Serbian = 106` - `OCRLanguage_SerbianLatin = 107` - `OCRLanguage_Sundanese = 108` - `OCRLanguage_Swahili = 109` - `OCRLanguage_Swedish = 110` - `OCRLanguage_Syriac = 111` - `OCRLanguage_Tamil = 112` - `OCRLanguage_Tatar = 113` - `OCRLanguage_Telugu = 114` - `OCRLanguage_Tajik = 115` - `OCRLanguage_Tagalog = 116` - `OCRLanguage_Thai = 117` - `OCRLanguage_Tigrinya = 118` - `OCRLanguage_Tonga = 119` - `OCRLanguage_Turkish = 120` - `OCRLanguage_Uyghur = 121` - `OCRLanguage_Ukrainian = 122` - `OCRLanguage_Urdu = 123` - `OCRLanguage_Uzbek = 124` - `OCRLanguage_UzbekCyrillic = 125` - `OCRLanguage_Vietnamese = 126` - `OCRLanguage_Yiddish = 127` - `OCRLanguage_Yoruba = 128` - `OCRLanguage_None = 129` #### OCRMissingFontStrategy Header: `OCREngineExpT.h:12` Enumeration to specify how to handle missing fonts during OCR. **Values** - `OCRMissingFontStrategy_Raise = 0`: Raise an exception. - `OCRMissingFontStrategy_Ignore = 1`: Ignore the missing font and continue recognizing the next word of text. - `OCRMissingFontStrategy_ReplacementText = 2`: Replace the characters of text with the Unicode replacement Character. NOTE: the CandidateFontsNames member of the OCRParams instance must include a Font that can represent this character or an exception will be raised. #### OCRPageSegmentationMode Header: `OCREngineExpT.h:40` Enumeration to specify how the OCR engine will view the page, and how it detects text segments. **Values** - `OCRPageSegmentationMode_OSDOnly = 0`: Orientation and script detection (OSD). - `OCRPageSegmentationMode_AutomaticOSD = 1`: Automatic page segmentation with OSD. - `OCRPageSegmentationMode_Automatic = 2`: Automatic without OSD. - `OCRPageSegmentationMode_SingleColumn = 3`: Assume a single column of text. - `OCRPageSegmentationMode_SingleBlockVertical = 4`: Assume a single block of vertically aligned text. - `OCRPageSegmentationMode_SingleBlock = 5`: Assume a single block of text. - `OCRPageSegmentationMode_SingleLine = 6`: Assume a single line of text. - `OCRPageSegmentationMode_SingleWord = 7`: Assume a single word. - `OCRPageSegmentationMode_CircleWord = 8`: Assume a single word in a circle. - `OCRPageSegmentationMode_SingleChar = 9`: Assume a single char. - `OCRPageSegmentationMode_SparseText = 10`: Find all text in no particular order. - `OCRPageSegmentationMode_SparseTextOSD = 11`: Sparse text with OSD. - `OCRPageSegmentationMode_RawLine = 12`: Treat as a raw line with no input processing. #### OCRPerformance Header: `OCREngineExpT.h:24` Enumeration to specify OCR performance. **Values** - `OCRPerformance_Default = 0`: Default performance. The default performance is useful for most scenarios and is a reasonable tradeoff of speed vs. accuracy, thus suitable for most languages. - `OCRPerformance_Accuracy = 1`: Blend accuracy with speed. - `OCRPerformance_MoreAccuracy = 2`: Favor accuracy over speed. - `OCRPerformance_BestAccuracy = 3`: Best possible accuracy. ## pdflattener ### Functions (6) #### PDFlattenerConvert ```cpp ASBool PDFlattenerConvert(PDDoc aPDDoc, PDFlatten flattenParams, float transQuality, ASUns32 firstPage, ASUns32 lastPage, ASUns32 *numFlattenedPages, ASUns32 flags) ``` Header: `PDFlattenerProcs.h:37` Flatten a PDF file. **Parameters** - `aPDDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The input PDDoc which we want to Flatten. The output will be in the same PDDoc. - `flattenParams` ([`PDFlatten`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFlatten)): Input parameters for flattening. - `transQuality` (`float`) - `firstPage` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The first page of aPDDoc which we want to Flatten. - `lastPage` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The last page of aPDDoc which we want to Flatten. - `numFlattenedPages` ([`ASUns32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): set to the number of pages that are flattened. - `flags` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): Kept for future use. Default to 0. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) 1 on success. #### PDFlattenerConvertEx ```cpp ASBool PDFlattenerConvertEx(PDDoc aPDDoc, PDFlatten flattenParams, float transQuality, ASUns32 firstPage, ASUns32 lastPage, ASUns32 *numFlattenedPages, ASUns32 flags, FlattenProgressMonitor FlattenProgress, void *progressClientData) ``` Header: `PDFlattenerProcs.h:58` Flatten a PDF file. **Parameters** - `aPDDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The input PDDoc which we want to Flatten. The output will be in the same PDDoc. - `flattenParams` ([`PDFlatten`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFlatten)): Input parameters for flattening. - `transQuality` (`float`) - `firstPage` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The first page of aPDDoc which we want to Flatten. - `lastPage` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The last page of aPDDoc which we want to Flatten. - `numFlattenedPages` ([`ASUns32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): set to the number of pages that are flattened. - `flags` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): Kept for future use. Default to 0. - `FlattenProgress` ([`FlattenProgressMonitor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#FlattenProgressMonitor)): the callback which we want to register with the plug-in. - `progressClientData` (`void *`): any client data which client wants to get back with the callback for its own reference. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) 1 on success. #### PDFlattenerConvertEx2 ```cpp ASBool PDFlattenerConvertEx2(PDDoc aPDDoc, ASUns32 firstPage, ASUns32 lastPage, ASUns32 *numFlattenedPages, PDFlattenerUserParams userParams) ``` Header: `PDFlattenerProcs.h:69` Flatten a PDF file. **Parameters** - `aPDDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The input PDDoc which we want to Flatten. The output will be in the same PDDoc. - `firstPage` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The first page of aPDDoc which we want to Flatten. - `lastPage` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The last page of aPDDoc which we want to Flatten. - `numFlattenedPages` ([`ASUns32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): set to the number of pages that are flattened. - `userParams` ([`PDFlattenerUserParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#PDFlattenerUserParams)): A structure object defined for user set parameters e.g flattenParams, transquality, Blending Colorspace profile, progress monitor and Compression Settings. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) 1 on success. #### PDFlattenerConvertEx3 ```cpp ASBool PDFlattenerConvertEx3(PDDoc aPDDoc, ASUns32 firstPage, ASUns32 lastPage, ASUns32 *numFlattenedPages, PDFlattenerUserParams userParams, ASBool embedFlattenerProfiles) ``` Header: `PDFlattenerProcs.h:81` Flatten a PDF file. **Parameters** - `aPDDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The input PDDoc which we want to Flatten. The output will be in the same PDDoc. - `firstPage` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The first page of aPDDoc which we want to Flatten. - `lastPage` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The last page of aPDDoc which we want to Flatten. - `numFlattenedPages` ([`ASUns32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): set to the number of pages that are flattened. - `userParams` ([`PDFlattenerUserParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#PDFlattenerUserParams)): A structure object defined for user set parameters e.g flattenParams, transquality, Blending Colorspace profile, progress monitor and Compression Settings. - `embedFlattenerProfiles` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): embed Flattener color profiles. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) 1 on success. #### PDFlattenerInitialize ```cpp ASBool PDFlattenerInitialize(void) ``` Header: `PDFlattenerProcs.h:25` Initialises the PDFlattener Plug-in. **Parameters** - (unnamed) (`void`) **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) An ASBool value. #### PDFlattenerTerminate ```cpp void PDFlattenerTerminate(void) ``` Header: `PDFlattenerProcs.h:44` Terminates the PDFlattener Plug-in. **Parameters** - (unnamed) (`void`) **Returns:** `void` void. ### Typedefs (1) #### FlattenProgressMonitor ```cpp typedef ASBool(*) FlattenProgressMonitor(ASInt32 pageNum, ASInt32 totalPages, float current, ASInt32 reserved, void *clientData)(ASInt32 pageNum, ASInt32 totalPages, float current, ASInt32 reserved, void *clientData) ``` Header: `PDFlattenerExpT.h:91` Prototype of the callback which is registered by the client with the plug-in ### Structures (1) #### PDFlattenerUserParams ```cpp typedef struct PDFlattenerUserParamsRec * PDFlattenerUserParams ``` Header: `PDFlattenerExpT.h:154` ### Enums (5) #### PDFlattenerColorCompSet Header: `PDFlattenerExpT.h:27` Enumeration for setting compression scheme for flattened color images. **Values** - `kPDFlattenerJpegCompression = 0` - `kPDFlattenerZipCompression = 1` - `kPDFlattenerJpeg2000Compression = 2` #### PDFlattenerGrayscaleCompSet Header: `PDFlattenerExpT.h:36` Enumeration for setting the compression scheme for the Flattened Grayscale images. **Values** - `kPDFlattenerGrayJpegCompression = 0` - `kPDFlattenerGrayZipCompression = 1` - `kPDFlattenerGrayJpeg2000Compression = 2` #### PDFlattenerMonochromeCompSet Header: `PDFlattenerExpT.h:45` Enumeration for setting the compression scheme for the Flattened Monochrome images. **Values** - `kPDFlattenerMonoCCITTGroup3Compression = 0` - `kPDFlattenerMonoCCITTGroup4Compression = 1` - `kPDFlattenerMonoZipCompression = 2` - `kPDFlattenerMonoRunLengthCompression = 3` #### PDFlattenerQualitySetting Header: `PDFlattenerExpT.h:55` Enumeration for setting the Quality setting for the JPEG or JPEG2000 images. **Values** - `kPDFlattenerMinimum = 0` - `kPDFlattenerLow = 1` - `kPDFlattenerMedium = 2` - `kPDFlattenerHigh = 3` - `kPDFlattenerMaximum = 4` - `kPDFlattenerJpeg2000Lossless = 5` #### kPDFlattenerFlags Header: `PDFlattenerExpT.h:184` **Values** - `kPDFlattenerCompressColorImagesZIP = 0x01`: Setting this flag will choose the ZIP compression scheme (Flate encoding) for compressing the color images. Otherwise we will stick to the current default behavior and try to use JPEG compression wherever possible. ## pdfprocessor ### Functions (6) #### PDFProcessorConvertAndSaveToPDFA ```cpp ASBool PDFProcessorConvertAndSaveToPDFA(PDDoc srcPDDoc, ASPathName outputFilePath, ASFileSys outputFileSystem, PDFProcessorPDFAConversionOption option, PDFProcessorPDFAConvertParams userParams) ``` Header: `PDFProcessorProcs.h:36` Processes a PDF file, converts it to a PDF/A standard, and saves the output document to disk . **Parameters** - `srcPDDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): Input PDDoc to be converted. - `outputFilePath` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): Output file path complete with the name of the PDF file we want to save the output to. - `outputFileSystem` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)) - `option` ([`PDFProcessorPDFAConversionOption`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#PDFProcessorPDFAConversionOption)): Define the PDF/A conversion option. - `userParams` ([`PDFProcessorPDFAConvertParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#PDFProcessorPDFAConvertParams)): Parameters to control the conversion. @Return True if conversion is successful. Will throw an exception in case of errors. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) #### PDFProcessorConvertAndSaveToPDFX ```cpp ASBool PDFProcessorConvertAndSaveToPDFX(PDDoc srcPDDoc, ASPathName outputFilePath, ASFileSys outputFileSystem, PDFProcessorPDFXConversionOption option, PDFProcessorPDFXConvertParams userParams) ``` Header: `PDFProcessorProcs.h:66` Processes a PDF file, converts it to a PDF/X standard and saves it to disk. **Parameters** - `srcPDDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): Input PDDoc to be converted. - `outputFilePath` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): Output file path complete with the name of the PDF file we want to save the output to. - `outputFileSystem` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)) - `option` ([`PDFProcessorPDFXConversionOption`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#PDFProcessorPDFXConversionOption)): Define the PDF/X conversion option. - `userParams` ([`PDFProcessorPDFXConvertParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#PDFProcessorPDFXConvertParams)): Parameters to control the conversion. @Return True if conversion is successful. Will throw an exception in case of errors. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) #### PDFProcessorConvertToPDFA ```cpp ASBool PDFProcessorConvertToPDFA(PDDoc srcPDDoc, PDDoc *outPDDoc, PDFProcessorPDFAConversionOption option, PDFProcessorPDFAConvertParams userParams, PDDocSaveParams outSaveParams) ``` Header: `PDFProcessorProcs.h:48` Processes a PDF file and provides a pointer to the converted PDDoc. **Parameters** - `srcPDDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): Input PDDoc to be converted. - `outPDDoc` ([`PDDoc *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)) - `option` ([`PDFProcessorPDFAConversionOption`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#PDFProcessorPDFAConversionOption)): Define the PDF/A conversion option. - `userParams` ([`PDFProcessorPDFAConvertParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#PDFProcessorPDFAConvertParams)): Parameters to control the conversion. - `outSaveParams` ([`PDDocSaveParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSaveParams)) **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) #### PDFProcessorConvertToPDFX ```cpp ASBool PDFProcessorConvertToPDFX(PDDoc srcPDDoc, PDDoc *outPDDoc, PDFProcessorPDFXConversionOption option, PDFProcessorPDFXConvertParams userParams, PDDocSaveParams outSaveParams) ``` Header: `PDFProcessorProcs.h:78` Processes a PDF file, and provides a pointer to the converted PDDoc. **Parameters** - `srcPDDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): Input PDDoc to be converted. - `outPDDoc` ([`PDDoc *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)) - `option` ([`PDFProcessorPDFXConversionOption`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#PDFProcessorPDFXConversionOption)): Define the PDF/X conversion option. - `userParams` ([`PDFProcessorPDFXConvertParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#PDFProcessorPDFXConvertParams)): Parameters to control the conversion. - `outSaveParams` ([`PDDocSaveParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocSaveParams)) **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) #### PDFProcessorInitialize ```cpp ASBool PDFProcessorInitialize(void) ``` Header: `PDFProcessorProcs.h:25` Initialises the PDFProcessor Plug-in. **Parameters** - (unnamed) (`void`) **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) An ASBool value. #### PDFProcessorTerminate ```cpp void PDFProcessorTerminate(void) ``` Header: `PDFProcessorProcs.h:55` Terminates the PDFProcessor Plug-in. **Parameters** - (unnamed) (`void`) **Returns:** `void` void. ### Typedefs (1) #### PDFProcessorProgressMon ```cpp typedef ASBool(*) PDFProcessorProgressMon(ASInt32 pageNum, ASInt32 totalPages, float current, void *clientData)(ASInt32 pageNum, ASInt32 totalPages, float current, void *clientData) ``` Header: `PDFProcessorExpT.h:166` Prototype of the callback which is registered by the client with the plug-in ### Structures (2) #### PDFProcessorPDFAConvertParams ```cpp typedef struct PDFProcessorPDFAConvertParamsRec * PDFProcessorPDFAConvertParams ``` Header: `PDFProcessorExpT.h:263` #### PDFProcessorPDFXConvertParams ```cpp typedef struct PDFProcessorPDFXConvertParamsRec * PDFProcessorPDFXConvertParams ``` Header: `PDFProcessorExpT.h:355` ### Enums (5) #### PDFProcessorColorCompressionSet Header: `PDFProcessorExpT.h:134` Enumeration for setting compression scheme for Color Images. **Values** - `kPDFProcessorColorJpegCompression = 0` - `kPDFProcessorColorZipCompression = 1` - `kPDFProcessorColorJpeg2000Compression = 2` #### PDFProcessorGrayscaleCompressionSet Header: `PDFProcessorExpT.h:143` Enumeration for setting compression scheme for Grayscale Images. **Values** - `kPDFProcessorGrayJpegCompression = 0` - `kPDFProcessorGrayZipCompression = 1` - `kPDFProcessorGrayJpeg2000Compression = 2` #### PDFProcessorMonochromeCompressionSet Header: `PDFProcessorExpT.h:152` Enumeration for setting compression scheme for Monochrome Images. **Values** - `kPDFProcessorMonoCCITTGroup3Compression = 0` - `kPDFProcessorMonoCCITTGroup4Compression = 1` - `kPDFProcessorMonoZipCompression = 2` - `kPDFProcessorMonoRunLengthCompression = 3` #### PDFProcessorPDFAConversionOption Header: `PDFProcessorExpT.h:33` This is used to select which particular PDF/A standard we want to convert to. **Values** - `kPDFProcessorConvertToPDFA1aRGB = 0`: Convert to PDF/A-1a RGB - `kPDFProcessorConvertToPDFA1aCMYK = 1`: Convert to PDF/A-1a CMYK - `kPDFProcessorConvertToPDFA1bRGB = 2`: Convert to PDF/A-1b RGB - `kPDFProcessorConvertToPDFA1bCMYK = 3`: Convert to PDF/A-1b CMYK - `kPDFProcessorConvertToPDFA2aRGB = 4`: Convert to PDF/A-2a RGB - `kPDFProcessorConvertToPDFA2aCMYK = 5`: Convert to PDF/A-2a CMYK - `kPDFProcessorConvertToPDFA2bRGB = 6`: Convert to PDF/A-2b RGB - `kPDFProcessorConvertToPDFA2bCMYK = 7`: Convert to PDF/A-2b CMYK - `kPDFProcessorConvertToPDFA2uRGB = 8`: Convert to PDF/A-2u RGB - `kPDFProcessorConvertToPDFA2uCMYK = 9`: Convert to PDF/A-2u CMYK - `kPDFProcessorConvertToPDFA3aRGB = 10`: Convert to PDF/A-3a RGB - `kPDFProcessorConvertToPDFA3aCMYK = 11`: Convert to PDF/A-3a CMYK - `kPDFProcessorConvertToPDFA3bRGB = 12`: Convert to PDF/A-3b RGB - `kPDFProcessorConvertToPDFA3bCMYK = 13`: Convert to PDF/A-3b CMYK - `kPDFProcessorConvertToPDFA3uRGB = 14`: Convert to PDF/A-3u RGB - `kPDFProcessorConvertToPDFA3uCMYK = 15`: Convert to PDF/A-3u CMYK - `kPDFProcessorConvertToPDFA4RGB = 16`: Convert to PDF/A-4 RGB - `kPDFProcessorConvertToPDFA4CMYK = 17`: Convert to PDF/A-4 CMYK - `kPDFProcessorConvertToPDFA4eRGB = 18`: Convert to PDF/A-4e RGB - `kPDFProcessorConvertToPDFA4eCMYK = 19`: Convert to PDF/A-4e CMYK - `kPDFProcessorConvertToPDFA4fRGB = 20`: Convert to PDF/A-4f RGB - `kPDFProcessorConvertToPDFA4fCMYK = 21`: Convert to PDF/A-4f CMYK #### PDFProcessorPDFXConversionOption Header: `PDFProcessorExpT.h:90` This is used to select which particular PDF/X standard we want to convert to. **Values** - `kPDFProcessorConvertToPDFX1a2001 = 0`: Convert to PDF/X-1a 2001 - `kPDFProcessorConvertToPDFX32003 = 1`: Convert to PDF/X-3 2003 - `kPDFProcessorConvertToPDFX42010 = 2`: Convert to PDF/X-4 2010 - `kPDFProcessorConvertToPDFX62020 = 3`: Convert to PDF/X-6 2020 - `kPDFProcessorConvertToPDFX5g2010 = 4`: Convert to PDF/X-5g 2010, the PDF/X-5 conformance level for externally referenced graphical content (ISO 15930-8, 8.1). - `kPDFProcessorConvertToPDFX5pg2010 = 5`: Convert to PDF/X-5pg 2010, the PDF/X-5 conformance level combining externally referenced graphical content with an externally referenced output intent profile (ISO 15930-8, Clause 9). Requires destOutputProfileURL. - `kPDFProcessorConvertToPDFX5n2010 = 6`: Convert to PDF/X-5n 2010, the PDF/X-5 conformance level for an n-colorant printing condition (ISO 15930-8, Clause 7). Requires destOutputProfilePath and destOutputProfileURL naming an xCLR ICC profile; the PDF Reference forbids embedding an n-colorant profile, so it can only ever be referenced. - `kPDFProcessorConvertToPDFX4p2010 = 7`: Convert to PDF/X-4p 2010 (ISO 15930-7, Annex A): PDF/X-4 conformance with the output intent ICC profile referenced externally rather than embedded. Requires destOutputProfileURL. ## webtopdf ### Functions (11) #### WebToPDFConvertFileTree ```cpp WebToPDFResultCode WebToPDFConvertFileTree(const char *rootPath, const char *indexFile, const char *outputPath, WebToPDFParams params) ``` Header: `WebToPDFProcs.h:85` Convert a local directory to PDF. **Parameters** - `rootPath` (`const char *`): Path to the root directory (UTF-8 encoded). - `indexFile` (`const char *`): Entry-point file name (e.g. "index.html"), or `NULL` for auto-detect. - `outputPath` (`const char *`): Path to the output PDF file (UTF-8 encoded). - `params` ([`WebToPDFParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#WebToPDFParams)): Conversion parameters, or `NULL` for defaults. **Returns:** [`WebToPDFResultCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#WebToPDFResultCode) A [`WebToPDFResultCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#WebToPDFResultCode) indicating success or failure. #### WebToPDFConvertHTML ```cpp WebToPDFResultCode WebToPDFConvertHTML(const char *htmlContent, const char *baseURL, const char *outputPath, WebToPDFParams params) ``` Header: `WebToPDFProcs.h:72` Convert an HTML string to PDF. **Parameters** - `htmlContent` (`const char *`): The HTML content to convert (UTF-8 encoded). - `baseURL` (`const char *`): Base URL for resolving relative resources, or `NULL`. - `outputPath` (`const char *`): Path to the output PDF file (UTF-8 encoded). - `params` ([`WebToPDFParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#WebToPDFParams)): Conversion parameters, or `NULL` for defaults. **Returns:** [`WebToPDFResultCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#WebToPDFResultCode) A [`WebToPDFResultCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#WebToPDFResultCode) indicating success or failure. #### WebToPDFConvertURL ```cpp WebToPDFResultCode WebToPDFConvertURL(const char *inputURL, const char *outputPath, WebToPDFParams params) ``` Header: `WebToPDFProcs.h:50` Convert a URL to PDF. **Parameters** - `inputURL` (`const char *`): The URL to convert (UTF-8 encoded). Supported schemes: [http://](http://), [https://](https://), [file://](file://). - `outputPath` (`const char *`): Path to the output PDF file (UTF-8 encoded). - `params` ([`WebToPDFParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#WebToPDFParams)): Conversion parameters, or `NULL` for defaults. **Returns:** [`WebToPDFResultCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#WebToPDFResultCode) A [`WebToPDFResultCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#WebToPDFResultCode) indicating success or failure. #### WebToPDFConvertURLW ```cpp WebToPDFResultCode WebToPDFConvertURLW(const wchar_t *inputURL, const wchar_t *outputPath, WebToPDFParams params) ``` Header: `WebToPDFProcs.h:60` Convert a URL to PDF (wide-string version). **Parameters** - `inputURL` (`const wchar_t *`): The URL to convert (UTF-16 encoded). - `outputPath` (`const wchar_t *`): Path to the output PDF file (UTF-16 encoded). - `params` ([`WebToPDFParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#WebToPDFParams)): Conversion parameters, or `NULL` for defaults. **Returns:** [`WebToPDFResultCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#WebToPDFResultCode) A [`WebToPDFResultCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#WebToPDFResultCode) indicating success or failure. #### WebToPDFGetConversionInfo ```cpp ASBool WebToPDFGetConversionInfo(WebToPDFConversionInfo info) ``` Header: `WebToPDFProcs.h:104` Get information about the most recent conversion. **Parameters** - `info` ([`WebToPDFConversionInfo`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#WebToPDFConversionInfo)): Pointer to a `WebToPDFConversionInfoRec` to populate. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` if info was filled, `false` if no conversion has occurred. #### WebToPDFGetLastError ```cpp ASInt32 WebToPDFGetLastError(char *buffer, ASInt32 bufferSize) ``` Header: `WebToPDFProcs.h:96` Get a detailed error message from the last failed operation. **Parameters** - `buffer` (`char *`): Buffer to receive the error message. - `bufferSize` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): Size of `buffer` in bytes. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The actual length of the error message (may exceed `bufferSize` if truncated). #### WebToPDFGetVersion ```cpp ASUns32 WebToPDFGetVersion(void) ``` Header: `WebToPDFProcs.h:112` Get the plugin version. **Parameters** - (unnamed) (`void`) **Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32) Version packed as `(major << 16 | minor << 8 | patch)`. #### WebToPDFInitParams ```cpp void WebToPDFInitParams(WebToPDFParams params) ``` Header: `WebToPDFProcs.h:39` Initialize a parameters structure with default values. **Parameters** - `params` ([`WebToPDFParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#WebToPDFParams)): Pointer to a `WebToPDFParamsRec` to fill with defaults. **Returns:** `void` #### WebToPDFInitialize ```cpp ASBool WebToPDFInitialize(void) ``` Header: `WebToPDFProcs.h:24` Initialize the WebToPDF plugin. Must be called once before any other WebToPDF functions. Sets up the Chromium Embedded Framework and internal plugin state. **Parameters** - (unnamed) (`void`) **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) `true` on success, `false` on failure. #### WebToPDFShutdown ```cpp void WebToPDFShutdown(void) ``` Header: `WebToPDFProcs.h:121` Permanently shut down the plugin's CEF runtime (final, synchronous). Joins the Chromium thread pool via CefShutdown() before returning. Unlike `WebToPDFTerminate()` (a repeatable per-session no-op), this is one-shot. Call once, at end-of-life, before the host unloads the plugin. **Parameters** - (unnamed) (`void`) **Returns:** `void` #### WebToPDFTerminate ```cpp void WebToPDFTerminate(void) ``` Header: `WebToPDFProcs.h:32` Terminate the WebToPDF plugin. Must be called when done using the plugin to release all resources, including the CEF runtime. **Parameters** - (unnamed) (`void`) **Returns:** `void` ### Typedefs (4) #### ASBool ```cpp typedef unsigned short ASBool ``` Header: `WebToPDFExpT.h:54` #### ASUns16 ```cpp typedef unsigned short ASUns16 ``` Header: `WebToPDFExpT.h:63` #### WebToPDFLogCallback ```cpp typedef void(*) WebToPDFLogCallback(ASInt32 level, const char *message, void *clientData)(ASInt32 level, const char *message, void *clientData) ``` Header: `WebToPDFExpT.h:251` Logging callback function prototype. Called to deliver log messages generated during conversion. The callback is invoked on the conversion thread, so implementations should be thread-safe or dispatch to the appropriate thread. #### WebToPDFProgressCallback ```cpp typedef ASBool(*) WebToPDFProgressCallback(ASInt32 pageNum, ASInt32 totalPages, float progress, void *clientData)(ASInt32 pageNum, ASInt32 totalPages, float progress, void *clientData) ``` Header: `WebToPDFExpT.h:232` Progress callback function prototype. Called periodically during conversion to report progress. The callback may return `false` to request cancellation of the current operation. ### Structures (2) #### WebToPDFConversionInfo ```cpp typedef struct WebToPDFConversionInfoRec * WebToPDFConversionInfo ``` Header: `WebToPDFExpT.h:429` #### WebToPDFParams ```cpp typedef struct WebToPDFParamsRec * WebToPDFParams ``` Header: `WebToPDFExpT.h:408` ### Enums (6) #### WebToPDFDownsamplingDPI Header: `WebToPDFExpT.h:209` Downsampling resolution options for raster images in the output PDF. Images whose native resolution exceeds the chosen threshold are downsampled to reduce file size. **Values** - `kWebToPDFDPIDisabled = -1`: Disable downsampling; preserve original resolution. - `kWebToPDFDPI300 = 0`: Downsample to 300 DPI (default). - `kWebToPDFDPI75 = 1`: Downsample to 75 DPI (screen quality). - `kWebToPDFDPI150 = 2`: Downsample to 150 DPI. - `kWebToPDFDPI600 = 3`: Downsample to 600 DPI (high quality print). - `kWebToPDFDPI1200 = 4`: Downsample to 1200 DPI (very high quality). #### WebToPDFImageCompression Header: `WebToPDFExpT.h:195` Image compression modes for raster images embedded in the output PDF. DeprecatedNot supported and has no effect. Conversion is performed by the CEF PDF generator, which exposes no image-compression control, so the compression of the raster images Chromium embeds cannot be selected. The enum is retained so the ABI stays compatible. Setting anything other than `kWebToPDFCompressionJPEG` emits a warning through `WebToPDFParamsRec::logCallback`. **Values** - `kWebToPDFCompressionJPEG = 0`: Lossy JPEG compression (smaller file size). Not honored. - `kWebToPDFCompressionLossless`: Lossless compression (larger file, pixel-perfect). Not honored. #### WebToPDFPageOrientation Header: `WebToPDFExpT.h:160` Page orientation for the output PDF. **Values** - `kWebToPDFOrientationPortrait = 0`: Portrait orientation (taller than wide). - `kWebToPDFOrientationLandscape`: Landscape orientation (wider than tall). #### WebToPDFPageSize Header: `WebToPDFExpT.h:173` Standard page sizes for the output PDF. Choose `kWebToPDFPageSizeCustom` and populate `WebToPDFParamsRec::customPageSize` to specify exact dimensions in points. **Values** - `kWebToPDFPageSizeLetter = 0`: US Letter (8.5 x 11 in). - `kWebToPDFPageSizeLegal = 1`: US Legal (8.5 x 14 in). - `kWebToPDFPageSizeLedger = 2`: US Ledger / Tabloid (11 x 17 in). - `kWebToPDFPageSizeA3 = 3`: ISO A3 (297 x 420 mm). - `kWebToPDFPageSizeA4 = 4`: ISO A4 (210 x 297 mm). - `kWebToPDFPageSizeA5 = 5`: ISO A5 (148 x 210 mm). - `kWebToPDFPageSizeCustom = 6`: Custom dimensions specified in `WebToPDFParamsRec::customPageSize`. #### WebToPDFResultCode Header: `WebToPDFExpT.h:117` Result codes returned by WebToPDF conversion operations. Every conversion function returns one of these codes to indicate success or the specific category of failure. Use `WebToPDFGetLastError()` to obtain a human-readable description when a non-success code is returned. **Values** - `kWebToPDFSuccess = 0`: Operation completed successfully. - `kWebToPDFErrorBadPath = 1`: An input or output file path is invalid or inaccessible. - `kWebToPDFErrorConverterFailure = 2`: The CEF rendering engine reported an internal error. - `kWebToPDFErrorCEFInitFailed = 3`: CEF could not be initialized (missing binaries, sandbox failure, etc.). - `kWebToPDFErrorInvalidURL = 4`: The supplied URL is malformed or uses an unsupported scheme. - `kWebToPDFErrorTimeout = 5`: The conversion exceeded the configured timeout. - `kWebToPDFErrorOutputFailed = 6`: The output PDF file could not be written. - `kWebToPDFErrorNotInitialized = 7`: `WebToPDFInitialize()` has not been called yet. - `kWebToPDFErrorCancelled = 8`: The conversion was cancelled via the progress callback. - `kWebToPDFErrorInvalidParams = 9`: The parameter block's `size` field is not a size this library can interpret. #### WebToPDFViewportSize Header: `WebToPDFExpT.h:148` Viewport size presets used when rendering web content. Controls the virtual browser viewport dimensions during rendering. Choose `kWebToPDFViewportCustom` and populate `WebToPDFParamsRec::customViewport` to specify exact pixel dimensions. **Values** - `kWebToPDFViewportDesktop = 0`: Desktop viewport (default 1280x1024). - `kWebToPDFViewportMobile = 1`: Mobile viewport (e.g. 375x812). - `kWebToPDFViewportTablet = 2`: Tablet viewport (e.g. 768x1024). - `kWebToPDFViewportCustom = 3`: Custom dimensions specified in `WebToPDFParamsRec::customViewport`. ## xps2pdf ### Functions (3) #### XPS2PDFConvert ```cpp ASInt32 XPS2PDFConvert(ASCab inSettings, ASInt32 conversionFlags, ASPathName inPath, ASFileSys inFileSys, PDDoc *outPDDoc, void *clientData) ``` Header: `XPS2PDFProcs.h:37` Converts aa XPS file into a PDF file. **Parameters** - `inSettings` ([`ASCab`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCab)) - `conversionFlags` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): Kept for future use. Default to 0. - `inPath` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): Folder path where the input XPS files are kept. - `inFileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): File system - `outPDDoc` ([`PDDoc *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The output PDDoc which we want to make from XPS. - `clientData` (`void *`): Kept for future use. Default to NULL. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) #### XPS2PDFInitialize ```cpp ASBool XPS2PDFInitialize(void) ``` Header: `XPS2PDFProcs.h:25` Initialises the XPS2PDF Plug-in. **Parameters** - (unnamed) (`void`) **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) An ASBool value. #### XPS2PDFTerminate ```cpp void XPS2PDFTerminate(void) ``` Header: `XPS2PDFProcs.h:44` Terminates the XPS2PDF Plug-in. **Parameters** - (unnamed) (`void`) **Returns:** `void` void. --- # Forms Extension Source: https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/formsextension ## General ### Functions (2) #### GetFormsExtensionVersionNumber ```cpp void GetFormsExtensionVersionNumber(FormsExtensionVersion version) ``` Header: `DLExtrasProcs.h:1425` Retrieves the Forms Extension Version Number. **Parameters** - `version` ([`FormsExtensionVersion`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/formsextension.md#FormsExtensionVersion)): OUT - Structure that holds the version number sub-components. **Returns:** `void` #### IsFormsExtensionSupported ```cpp ASBool IsFormsExtensionSupported(void) ``` Header: `DLExtrasProcs.h:1276` Validate the Forms Extension for APDFL dependencies are present. **Parameters** - (unnamed) (`void`) **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) ### Structures (1) #### FormsExtensionVersion ```cpp typedef struct FormsExtensionVersionRec * FormsExtensionVersion ``` Header: `DLExtrasExpT.h:572` ## PDDoc ### Functions (12) #### PDDocConvertXFAFieldsToAcroFormFields ```cpp void PDDocConvertXFAFieldsToAcroFormFields(PDDoc doc, ASUns32 *pagesConverted) ``` Header: `DLExtrasProcs.h:1308` Convert a XFA document into a document with only AcroForms. XFA content is not widely supported by PDF processors, converting this content transforms XFA fields into AcroForm fields which are more widely supported by PDF processors. All XFA fields are removed. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The PDF document object. - `pagesConverted` ([`ASUns32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): OUT The number of output pages created in the converted document. **Returns:** `void` #### PDDocExportAcroFormsData ```cpp ASBool PDDocExportAcroFormsData(PDDoc doc, ASFileSys fileSys, ASPathName pathName, AcroFormExportType acroFormExportType) ``` Header: `DLExtrasProcs.h:1349` Export the AcroForms data. AcroForms data is exported to a format that can later be imported into another AcroForms document. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN The PDF document object. - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): IN The file system to write the data to (May be NULL, in which case the default file system will be used) - `pathName` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): OUT The path on disk of the file the AcroForms data is exported to. - `acroFormExportType` ([`AcroFormExportType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/formsextension.md#AcroFormExportType)): IN The format type the AcroForm data should be exported to. The supported types are XFDF, FDF, and XML. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) #### PDDocExportXFAFormsData ```cpp ASBool PDDocExportXFAFormsData(PDDoc doc, ASFileSys fileSys, ASPathName pathName, XFAFormExportType exportType) ``` Header: `DLExtrasProcs.h:1322` Export the XFA Forms data. XFA forms data is exported to a format that can later be imported into another XFA document. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN The PDF document object. - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): IN The file system to write the document to (May be NULL, in which case the default file system will be used) - `pathName` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): OUT The path on disk of the file the XFA form data is exported to. - `exportType` ([`XFAFormExportType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/formsextension.md#XFAFormExportType)): IN The format type the XFA data should be exported to. The supported types are XDP, XML, and XFD. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) #### PDDocFlattenAcroFormFields ```cpp void PDDocFlattenAcroFormFields(PDDoc doc) ``` Header: `DLExtrasProcs.h:1296` Flatten an AcroForms document. Interactive AcroForm fields are flattened into static PDF page content. All AcroForm fields are removed. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)) **Returns:** `void` #### PDDocFlattenNonFormAnnotations ```cpp void PDDocFlattenNonFormAnnotations(PDDoc doc) ``` Header: `DLExtrasProcs.h:1407` Flatten a Non-Form (no AcroForm, no XFA) document's Annotations. Annotations are flattened into static PDF page content. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The PDF document object. **Returns:** `void` #### PDDocFlattenXFAFields ```cpp void PDDocFlattenXFAFields(PDDoc doc, ASUns32 *pagesOutput) ``` Header: `DLExtrasProcs.h:1288` Flatten a XFA Document (Static or Dynamic). XFA content is not widely supported by PDF processors. Flattening this content transforms into static PDF page content that is part of typical PDF files that can easily be understood by PDF processors. All XFA fields are removed. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The PDF document object. - `pagesOutput` ([`ASUns32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)) **Returns:** `void` #### PDDocFlattenXFAFieldsAsIfPrinted ```cpp void PDDocFlattenXFAFieldsAsIfPrinted(PDDoc doc, ASUns32 *pagesOutput) ``` Header: `DLExtrasProcs.h:1397` Flatten a XFA Document (Static or Dynamic) as if printed. XFA content is not widely supported by PDF processors. Flattening this content transforms into static PDF page content that is part of typical PDF files that can easily be understood by PDF processors. All XFA fields are removed. The Flattened appearance will take into consideration how the document's appearance should appear when printed. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The PDF document object. - `pagesOutput` ([`ASUns32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): OUT The number of output pages created in the flattened document. **Returns:** `void` #### PDDocGetFormsType ```cpp void PDDocGetFormsType(PDDoc doc, PDDocFormsType *formsType) ``` Header: `DLExtrasProcs.h:1417` Returns the document's Forms Type. This method is more versatile than the related PDDocIsDynamicXFA() and PDDocIsStaticXFA() methods. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN The PDF document object. - `formsType` ([`PDDocFormsType *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/formsextension.md#PDDocFormsType)): OUT The type of forms the document contains. **Returns:** `void` #### PDDocImportAcroFormsData ```cpp ASBool PDDocImportAcroFormsData(PDDoc doc, ASFileSys fileSys, ASPathName pathName, AcroFormImportType acroFormImportType) ``` Header: `DLExtrasProcs.h:1363` Import the AcroForms data. AcroForms data is imported from a supported format into the AcroForms document so its existing fields can be populated for example. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The PDF document object. - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): IN The file system to import the data from (May be NULL, in which case the default file system will be used) - `pathName` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): IN The path on disk of the AcroFormsdata file to be imported. - `acroFormImportType` ([`AcroFormImportType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/formsextension.md#AcroFormImportType)): IN The format type the data type should be imported to. The supported types are XFDF, FDF, and XML. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) #### PDDocImportXFAFormsData ```cpp ASBool PDDocImportXFAFormsData(PDDoc doc, ASFileSys fileSys, ASPathName pathName) ``` Header: `DLExtrasProcs.h:1335` Import the XFA Forms data. XFA forms data is imported from a supported format into the XFA document so its existing fields can be populated for example. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The PDF document object. - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): IN The file system to import the document from (May be NULL, in which case the default file system will be used) - `pathName` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): IN The path on disk of the XFA form data file to be imported. The supported types are XDP, XML, and XFD. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) #### PDDocIsDynamicXFA ```cpp ASBool PDDocIsDynamicXFA(PDDoc doc) ``` Header: `DLExtrasProcs.h:1373` Check if document is Dynamic XFA **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN The PDF document object. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) #### PDDocIsStaticXFA ```cpp ASBool PDDocIsStaticXFA(PDDoc doc) ``` Header: `DLExtrasProcs.h:1383` Check if document is Static XFA **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN The PDF document object. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) ### Enums (4) #### AcroFormExportType Header: `DLExtrasExpT.h:542` AcroForm Export Data type options. **Values** - `AcroFormExportTypeXFDF = 1`: XFDF (XML Forms Data Format) representing form field data. - `AcroFormExportTypeFDF = 2`: FDF (Forms Data Format) representing form field data. - `AcroFormExportTypeXML = 3`: XML (Extensible Markup Language) representing form field data. #### AcroFormImportType Header: `DLExtrasExpT.h:532` AcroForm Import Data type options. **Values** - `AcroFormImportTypeXFDF = 1`: XFDF (XML Forms Data Format) representing form field data. - `AcroFormImportTypeFDF = 2`: FDF (Forms Data Format) representing form field data. - `AcroFormImportTypeXML = 3`: XML (Extensible Markup Language) representing form field data. #### PDDocFormsType Header: `DLExtrasExpT.h:553` Document Forms Type options. **Values** - `PDDocFormsTypeNone = 1`: Document contains no Forms. - `PDDocFormsTypeDynamicXFA = 2`: Document contains Dynamic XFA Forms. - `PDDocFormsTypeStaticXFA = 3`: Document contains Static XFA Forms. - `PDDocFormsTypeAcroForms = 4`: Document contains AcroForms. #### XFAFormExportType Header: `DLExtrasExpT.h:522` XFA Form Export Data type options. **Values** - `XFAFormExportTypeXML = 1`: XML (Extensible Markup Language) representing form field data. - `XFAFormExportTypeXFD = 2`: XFD (Extensible Forms Description language) representing form field data. - `XFAFormExportTypeXDP = 3`: XDP (XML Data Package) representing form field data. --- # Additional functionality from Datalogics Source: https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras ## CosStream ### Functions (1) #### CosStreamSetData ```cpp void CosStreamSetData(CosObj stream, ASStm sourceP, ASInt32 sourceStart, ASBool encodeTheSourceData, CosObj attributes, CosObj encodeParms, ASInt32 sourceLength) ``` Header: `DLExtrasProcs.h:156` Essentially identical to CosNewStream, except that the result is a modification of an existing stream. **Parameters** - `stream` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): Stream to be modified - `sourceP` ([`ASStm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASStm)): source stream to be added. - `sourceStart` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The byte offset to the starting point of the stream to be added. - `encodeTheSourceData` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): Flag indicating whether the source data is to encoded via filters specified in the attributes. - `attributes` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): dictionary containing string data attributes, including its length and encoding parameters. - `encodeParms` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): Parameters to be used for encoding (if any). - `sourceLength` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): length of data to be read from the source, or `-1` to read to EOF. **Returns:** `void` **See also:** `CosStreamNew` ## General ### Functions (70) #### ACGetOption ```cpp AC_Error ACGetOption(AC_OptionCode code, ASUns32 *value) ``` Header: `DLExtrasProcs.h:129` Returns the current value for the given AC_OptionCode. This call controls the behavior of colorspace conversions and manipulations carried out via AC-layer calls; it does not impact other Adobe PDF Library color behaviors. **Parameters** - `code` ([`AC_OptionCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#AC_OptionCode)): AC_Option_BlackPointCompensation indicates whether the Acrobat Color Engine will carry out black point compensation when converting between colorspaces with different black points. - `value` ([`ASUns32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): AC_Option_BlackPointCompensation flag value to be retrieved (Filled by the method) **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) Indicates if an error occurred. **See also:** [`ACSetOption`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#ACSetOption) #### ACSetOption ```cpp AC_Error ACSetOption(AC_OptionCode code, ASUns32 value) ``` Header: `DLExtrasProcs.h:140` Sets the current value for the option specified by the supplied AC_OptionCode. This call controls the behavior of colorspace conversions and manipulations carried out via AC-layer calls; it does not impact other Adobe PDF Library color behaviors. **Parameters** - `code` ([`AC_OptionCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#AC_OptionCode)) - `value` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The flag value to be set. **Returns:** [`AC_Error`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Error) Indicates if an error occurred. **See also:** [`ACGetOption`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#ACGetOption) #### ASSetDefaultFileSys ```cpp void ASSetDefaultFileSys(ASFileSys fileSys) ``` Header: `DLExtrasProcs.h:19` Sets the default file system implementation for a platform. Added by Datalogics. **Parameters** - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): Alternate file system to be used **Returns:** `void` **See also:** [`ASGetDefaultFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASGetDefaultFileSys), [`ASGetTempFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASGetTempFileSys), [`ASGetRamFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASGetRamFileSys) **Since:** `@product { Singer }` #### ConvertPDFToExcel ```cpp ASBool ConvertPDFToExcel(ASPathName inputPath, ASPathName outputPath, ASFileSys fileSys) ``` Header: `DLExtrasProcs.h:1056` Converts a PDF file from the specified file path to a Microsoft Excel document (.xlsx) at the specified file path. **Parameters** - `inputPath` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): The input path of the PDF document. - `outputPath` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): The output path of the Office document. - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): The File System in use. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) #### ConvertPDFToPowerPoint ```cpp ASBool ConvertPDFToPowerPoint(ASPathName inputPath, ASPathName outputPath, ASFileSys fileSys) ``` Header: `DLExtrasProcs.h:1067` Converts a PDF file from the specified file path to a Microsoft Powerpoint document (.pptx) at the specified file path. **Parameters** - `inputPath` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): The input path of the PDF document. - `outputPath` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): The output path of the Office document. - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): The File System in use. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) #### ConvertPDFToWord ```cpp ASBool ConvertPDFToWord(ASPathName inputPath, ASPathName outputPath, ASFileSys fileSys) ``` Header: `DLExtrasProcs.h:1045` Converts a PDF file from the specified file path to a Microsoft Word document (.docx) at the specified file path. **Parameters** - `inputPath` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): The input path of the PDF document. - `outputPath` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): The output path of the Office document. - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): The File System in use. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) #### DLColorConvertPDEImage ```cpp PDEImage DLColorConvertPDEImage(PDDoc *document, PDEImage image, AC_ProfileCode code, AC_RenderIntent intent, ASBool embed) ``` Header: `DLExtrasProcs.h:1212` Converts the colorspace of a provided image using a new color profile and render intent. **Parameters** - `document` ([`PDDoc *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): A pointer to a PDDoc object containing the PDEImage. - `image` ([`PDEImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage)): The PDEImage in a PDF document that will be converted. - `code` ([`AC_ProfileCode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_ProfileCode)): The code of the target profile for the conversion. - `intent` ([`AC_RenderIntent`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_RenderIntent)): The rendering intent of used to convert the image. - `embed` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): A boolian value. If true, embed the target profile. If false the resulting color is Device, if possible. **Returns:** [`PDEImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage) #### DLCreatePDEImageFromASFile ```cpp PDEImage DLCreatePDEImageFromASFile(ASFile file) ``` Header: `DLExtrasProcs.h:1463` Imports an image file (TIFF, JPEG, BMP, PNG, GIF) from the specified ASFile to a PDEImage. **Parameters** - `file` ([`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): The ASFile representing the file. **Returns:** [`PDEImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage) #### DLCreatePDEImageFromFile ```cpp PDEImage DLCreatePDEImageFromFile(ASPathName imageInputPath, ASFileSys fileSys) ``` Header: `DLExtrasProcs.h:1117` Imports an image file (TIFF, JPEG, BMP, PNG, GIF) from the specified file path to a PDEImage. **Parameters** - `imageInputPath` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): The input path of the image. - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): The File System in use. **Returns:** [`PDEImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage) #### DLCreatePDEImagesFromASFile ```cpp PDEImage * DLCreatePDEImagesFromASFile(ASFile file) ``` Header: `DLExtrasProcs.h:1472` Imports a multipage TIFF from the specified ASFile to a collection of PDEImage's. **Parameters** - `file` ([`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): The ASFile representing the file. **Returns:** [`PDEImage *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage) #### DLCreatePDEImagesFromTIFF ```cpp PDEImage * DLCreatePDEImagesFromTIFF(ASPathName imageInputPath, ASFileSys fileSys) ``` Header: `DLExtrasProcs.h:1436` Imports a multipage TIFF from the specified file path to a collection of PDEImage's. **Parameters** - `imageInputPath` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): The input path of the TIFF. - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): The File System in use. **Returns:** [`PDEImage *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage) #### DLCreateResampledPDEImage ```cpp PDEImage DLCreateResampledPDEImage(PDEImage image, DLPDEImageExportParams *exportParams, ASInt32 resolution) ``` Header: `DLExtrasProcs.h:1249` Create a new PDEImage from an existing one modifying the resolution (dots per inch). This image can be freely modified inside a PDF document. **Parameters** - `image` ([`PDEImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage)): The PDEImage in a PDF document. - `exportParams` (`DLPDEImageExportParams *`): A pointer to the DLPDEImageExportParams structure used by the PDEImage. During the function call, ExportHorizontalDPI and ExportVeritcalDPI are updated to using the new resolution. - `resolution` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The new resolution as a 32 bit integer value. **Returns:** [`PDEImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage) #### DLEnableLicensedBehavior ```cpp ASBool DLEnableLicensedBehavior(const char *keyVal, const char *additionalInfo) ``` Header: `DLExtrasProcs.h:21` **Parameters** - `keyVal` (`const char *`) - `additionalInfo` (`const char *`) **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) #### DLExportImageToNChannelTIFF ```cpp void DLExportImageToNChannelTIFF(char *buffer, size_t bufferSize, ASInt32 width, ASInt32 height, ASPathName outputPath, DLPDEImageExportParams exportParams, PDPageInk inks) ``` Header: `DLExtrasProcs.h:1477` For Internal Use only. **Parameters** - `buffer` (`char *`) - `bufferSize` (`size_t`) - `width` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)) - `height` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)) - `outputPath` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)) - `exportParams` (`DLPDEImageExportParams`) - `inks` (`PDPageInk`) **Returns:** `void` #### DLExportPDEImage ```cpp void DLExportPDEImage(PDEImage image, ASPathName outputPath, DLImageExportType exporttype, DLPDEImageExportParams exportParams) ``` Header: `DLExtrasProcs.h:1127` Exports a PDEImage from a document to a specified image type TIFF, JPEG, BMP, PNG, GIF the specified file path. **Parameters** - `image` ([`PDEImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage)): The PDEImage in a PDF document. - `outputPath` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): The output path of the image. - `exporttype` ([`DLImageExportType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#DLImageExportType)): The exported image format (TIFF, JPEG, BMP, PNG, GIF). - `exportParams` (`DLPDEImageExportParams`): The DLPDEImageExportParams structure. **Returns:** `void` #### DLExportPDEImagesToTIFF ```cpp void DLExportPDEImagesToTIFF(PDEImage *images, ASPathName outputPath, DLPDEImageExportParams exportParams) ``` Header: `DLExtrasProcs.h:1445` Exports a collection of PDEImage's to a multipage TIFF at the specified file path. **Parameters** - `images` ([`PDEImage *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage)) - `outputPath` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): The output path of the TIFF file. - `exportParams` (`DLPDEImageExportParams`): The DLPDEImageExportParams structure. **Returns:** `void` #### DLGetImageType ```cpp DLImageExportType DLGetImageType(ASFile file) ``` Header: `DLExtrasProcs.h:1454` Gets the image file type (TIFF, JPEG, BMP, PNG, GIF). **Parameters** - `file` ([`ASFile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFile)): The ASFile representing the file. **Returns:** [`DLImageExportType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#DLImageExportType) #### DLPDEImageGetCompression ```cpp DLImageCompression DLPDEImageGetCompression(const PDEImage image) ``` Header: `DLExtrasProcs.h:1237` Gets the compression scheme of the image data. **Parameters** - `image` ([`const PDEImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage)): The PDEImage in a PDF document. **Returns:** [`DLImageCompression`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#DLImageCompression) #### DLPDEImageGetExportParams ```cpp DLPDEImageExportParams DLPDEImageGetExportParams() ``` Header: `DLExtrasProcs.h:1182` Initializes a structure of PDEImage export parameters with default values. **Returns:** `DLPDEImageExportParams` #### DLPDEImageGetHeight ```cpp ASDouble DLPDEImageGetHeight(const PDEImage image) ``` Header: `DLExtrasProcs.h:1175` Gets height of specified image. **Parameters** - `image` ([`const PDEImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage)): The PDEImage in a PDF document. **Returns:** [`ASDouble`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDouble) #### DLPDEImageGetIntent ```cpp const char * DLPDEImageGetIntent(const PDEImage inputImage) ``` Header: `DLExtrasProcs.h:1220` Gets the image's Render Intent. **Parameters** - `inputImage` ([`const PDEImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage)) **Returns:** `const char *` #### DLPDEImageGetSoftMask ```cpp PDEImage * DLPDEImageGetSoftMask(const PDEImage image) ``` Header: `DLExtrasProcs.h:1191` Gets the soft masl of a provided image. **Parameters** - `image` ([`const PDEImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage)): The PDEImage in a PDF document. **Returns:** [`PDEImage *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage) #### DLPDEImageGetWidth ```cpp ASDouble DLPDEImageGetWidth(const PDEImage image) ``` Header: `DLExtrasProcs.h:1166` Gets width of specified image. **Parameters** - `image` ([`const PDEImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage)): The PDEImage in a PDF document. **Returns:** [`ASDouble`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDouble) #### DLPDEImageRotate ```cpp void DLPDEImageRotate(PDEImage image, ASDouble theta) ``` Header: `DLExtrasProcs.h:1157` Rotates an image by theta degrees. A rotation is produced by [cos(theta), sin(theta), -sin(theta), cos(theta), 0, 0], which has the effect of rotating the coordinate system axes by an angle theta (degrees) counterclockwise. **Parameters** - `image` ([`PDEImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage)): The PDEImage in a PDF document. - `theta` ([`ASDouble`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDouble)): The rotation angle (degrees). **Returns:** `void` #### DLPDEImageScale ```cpp void DLPDEImageScale(PDEImage image, ASDouble sx, ASDouble sy) ``` Header: `DLExtrasProcs.h:1148` Scales an image by sx units. A scaling is obtained by [sx 0 0 sy 0 0]. This scales the coordinates so that 1 unit in the horizontal and vertical dimension of the new coordinate system is the same size as sx and sy units, respectively, as in the previous coordinate system. **Parameters** - `image` ([`PDEImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage)): The PDEImage in a PDF document. - `sx` ([`ASDouble`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDouble)): X scaling factor. - `sy` ([`ASDouble`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDouble)): Y scaling factor. **Returns:** `void` #### DLPDEImageSetIntent ```cpp void DLPDEImageSetIntent(PDEImage inputImage, const char *renderIntent) ``` Header: `DLExtrasProcs.h:1228` Sets the image's Render Intent. **Parameters** - `inputImage` ([`PDEImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage)) - `renderIntent` (`const char *`): A pointer to the string representation of an ASAtom value that will be used to set the image's intent data. **Returns:** `void` #### DLPDEImageSetSoftMask ```cpp void DLPDEImageSetSoftMask(PDEImage image, PDEImage *softMask) ``` Header: `DLExtrasProcs.h:1199` Uses the specified soft mask and applies it to the PDEImage. **Parameters** - `image` ([`PDEImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage)): The PDEImage in a PDF document. - `softMask` ([`PDEImage *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage)): The pointer to the PDEImage's soft mask, that will be applied to the PDEImage, or a null pointer which will delete the current soft mask. **Returns:** `void` #### DLPDEImageTranslate ```cpp void DLPDEImageTranslate(PDEImage image, ASDouble tx, ASDouble ty) ``` Header: `DLExtrasProcs.h:1138` Translates an image by (tx,ty) units. A translation is specified as [ 1 0 0 1 tx ty], where tx and ty are the distance to translate from the origin of the coordinate system in the horizontal and vertical dimension, respectively. **Parameters** - `image` ([`PDEImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage)): The PDEImage in a PDF document. - `tx` ([`ASDouble`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDouble)): X translation distance. - `ty` ([`ASDouble`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDouble)): Y translation distance. **Returns:** `void` #### PDFLAddFontDirectories ```cpp ASBool PDFLAddFontDirectories(ASInt32 pathCount, ASPathName *paths) ``` Header: `DLExtrasProcs.h:453` This call allows Adobe PDF Library to rescan for fonts without re-initializing. This will allow an operating Library process to detect and update new font directories and resources after startup, without requiring a restart and re-initialization. This will add one or more directories, and the fonts within them, to the set of all directories containing fonts (those specified in the DirList string arrays of resource locations). This call should be followed by a call to PDFLRescanFontDirectories after all new font directories have been loaded. **Parameters** - `pathCount` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): Number of new paths to be added. - `paths` ([`ASPathName *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): Paths to new resource locations to be added. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) Indicates if fonts directories were changed. **See also:** [`PDFLRescanFontDirectories`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDFLRescanFontDirectories) #### PDFLReinit ```cpp ASInt32 PDFLReinit(void) ``` Header: `PDFLProcs.h:688` Warm reinitialization of the Adobe PDF Library. Call this method if you closed all documents and other PD/PDE/Cos objects. Releases memory used for cached data. **Parameters** - (unnamed) (`void`) **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) **See also:** [`PDFLInit`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDFLInit) #### PDFLRescanFontDirectories ```cpp ASBool PDFLRescanFontDirectories(FontRescanFlags flags) ``` Header: `DLExtrasProcs.h:439` This call allows Adobe PDF Library to rescan for fonts without re-initializing. This will allow an operating Library process to detect and update new font directories and resources after startup, without requiring a restart and re-initialization. This call can, depending on flag settings, force a rescan of font resource areas defined in your dirList array, a rescan of those residing in the System folder, or both. To add new font resources to your dirList array, use the PDFLAddFontDirectories call. **Note:** This call, as well as the PDFLAddFontDirectories call, will act upon all PDSysFont structures referenced by the font cache that have a reference count of zero. Any pointers to such structures will become invalid after a rescan call has occurred. By default, all referenced PDSysFont structures will be affected, as their reference counts are always zero. To preserve a PDSysFont reference across a rescan call, use PDEAcquire and PDERelease calls to increment and decrement usage counts of a PDSysFont object as like other PDE Object. **Parameters** - `flags` ([`FontRescanFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#FontRescanFlags)): Flags controlling rescan process. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) Indicates if fonts directories were changed. **See also:** [`PDFLAddFontDirectories`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDFLAddFontDirectories) #### PDSignDocGetCredentialDataFormat ```cpp CredentialDataFmt PDSignDocGetCredentialDataFormat(PDSignDocSignParams params) ``` Header: `DLExtrasProcs.h:1644` Gets the encoding format of public-key credentials used to sign the document. **Parameters** - `params` ([`PDSignDocSignParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSignParams)): IN Object to be verified. **Returns:** [`CredentialDataFmt`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#CredentialDataFmt) Format of public-key credentials used to sign the document. #### PDSignDocGetDigestCategory ```cpp DigestCategory PDSignDocGetDigestCategory(PDSignDocSignParams params) ``` Header: `DLExtrasProcs.h:1630` Gets the cryptographic hash function used to generate message digests. **Parameters** - `params` ([`PDSignDocSignParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSignParams)) **Returns:** [`DigestCategory`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#DigestCategory) Cryptographic hash function used to generate message digests. #### PDSignDocGetDocMajorVersionNumber ```cpp PDDocVersion PDSignDocGetDocMajorVersionNumber(PDSignDocSaveParams params) ``` Header: `DLExtrasProcs.h:1823` Gets the major PDF version number of the document. **Parameters** - `params` ([`PDSignDocSaveParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSaveParams)): IN Object to be checked. **Returns:** [`PDDocVersion`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocVersion) Major PDF version number of the document. #### PDSignDocGetDocMinorVersionNumber ```cpp PDDocVersion PDSignDocGetDocMinorVersionNumber(PDSignDocSaveParams params) ``` Header: `DLExtrasProcs.h:1837` Gets the minor PDF version number of the document. **Parameters** - `params` ([`PDSignDocSaveParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSaveParams)): IN Object to be checked. **Returns:** [`PDDocVersion`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocVersion) Minor PDF version number of the document. #### PDSignDocGetDocSignType ```cpp SignatureType PDSignDocGetDocSignType(PDSignDocSignParams params) ``` Header: `DLExtrasProcs.h:1716` Gets the type of signature that was added to the document. **Parameters** - `params` ([`PDSignDocSignParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSignParams)): IN Object fetch the value of SignatureType, **Returns:** [`SignatureType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#SignatureType) #### PDSignDocGetFieldID ```cpp SignatureFieldID PDSignDocGetFieldID(PDSignDocSignParams params) ``` Header: `DLExtrasProcs.h:1557` Gets the field identifier that determines the form field containing the digital signature that was added to the document. **Parameters** - `params` ([`PDSignDocSignParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSignParams)) **Returns:** [`SignatureFieldID`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#SignatureFieldID) Current value of the SignatureFieldID enum. #### PDSignDocGetFieldName ```cpp ASConstText PDSignDocGetFieldName(PDSignDocSignParams params) ``` Header: `DLExtrasProcs.h:1572` Gets the fully qualified name of the form field that contains the digital signature that was added to the document. **Parameters** - `params` ([`PDSignDocSignParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSignParams)): IN Object to be checked. **Returns:** [`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText) Fully qualified field name of the form field that contains the digital signature. May return NULL based on the SignatureFieldID attribute defined by the user. #### PDSignDocGetFieldObject ```cpp CosObj PDSignDocGetFieldObject(PDSignDocSignParams params) ``` Header: `DLExtrasProcs.h:1587` Gets the Cos object of the field dictionary that contains the digital signature that was added to the document. **Parameters** - `params` ([`PDSignDocSignParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSignParams)): IN Object to be checked. **Returns:** [`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj) Cos object identifying the field dictionary containing the signature. May return NULL based on the SignatureFieldID attribute defined by the user. #### PDSignDocGetOutputPath ```cpp ASPathName PDSignDocGetOutputPath(PDSignDocSaveParams params) ``` Header: `DLExtrasProcs.h:1783` Gets the output path to which the signed document is saved. **Parameters** - `params` ([`PDSignDocSaveParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSaveParams)): IN Object to be checked. **Returns:** [`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName) Path to which the signed document is saved. #### PDSignDocGetSignatureBoxPageNumber ```cpp ASUns32 PDSignDocGetSignatureBoxPageNumber(PDSignDocSignParams params) ``` Header: `DLExtrasProcs.h:1601` Gets the page number on which the widget annotation of the signature field is created. **Parameters** - `params` ([`PDSignDocSignParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSignParams)): IN Object to be checked. **Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32) Page number on which signature field's widget annotation is created. A value of zero is returned if page number was not set. #### PDSignDocGetSignatureBoxRectangle ```cpp ASFixedRectP PDSignDocGetSignatureBoxRectangle(PDSignDocSignParams params) ``` Header: `DLExtrasProcs.h:1616` Gets the dimension of the annotation rectangle of the signature field being created. **Parameters** - `params` ([`PDSignDocSignParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSignParams)): IN Object to be checked. **Returns:** `ASFixedRectP` Dimension of the annotation rectangle of the signature field being created. A value of {0,0,0,0} is returned if annotation rectangle dimension was not set. #### PDSignDocSaveInitParams ```cpp PDSignDocSaveParams PDSignDocSaveInitParams(void) ``` Header: `DLExtrasProcs.h:1763` Creates a set of parameters used for saving the document to which a digital signature has been added. The parameters are set to default values and can be examined using "get" methods, and modified via "set" methods. When these parameters are no longer needed (after the call to PDSignDocWithParams, although they can be re-used any number of times), they must be freed by calling PDSignDocSaveReleaseParams(). **Parameters** - (unnamed) (`void`) **Returns:** [`PDSignDocSaveParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSaveParams) Initialized document signature parameters that can be further modified. **See also:** [`PDSignDocSaveReleaseParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSaveReleaseParams) #### PDSignDocSaveReleaseParams ```cpp void PDSignDocSaveReleaseParams(PDSignDocSaveParams params) ``` Header: `DLExtrasProcs.h:1769` Deallocates resources used by a PDSignDocSaveParams structure. **Parameters** - `params` ([`PDSignDocSaveParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSaveParams)): IN Object to deallocate. **Returns:** `void` #### PDSignDocSetCancelProc ```cpp void PDSignDocSetCancelProc(PDSignDocSaveParams params, ASCancelProc cancelProc, void *cancelProcClientData) ``` Header: `DLExtrasProcs.h:1808` Sets the cancel process callback and client data for the callback. **Parameters** - `params` ([`PDSignDocSaveParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSaveParams)): IN Object to be modified. - `cancelProc` ([`ASCancelProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCancelProc)): IN 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. - `cancelProcClientData` (`void *`): IN Pointer to user-supplied data to pass to cancelProc each time it is called. It must be NULL if cancelProc is NULL. **Returns:** `void` #### PDSignDocSetCredentialDataFormat ```cpp void PDSignDocSetCredentialDataFormat(PDSignDocSignParams params, CredentialDataFmt dataFmt) ``` Header: `DLExtrasProcs.h:1637` Sets the encoding format of public-key credentials required to sign the document. **Parameters** - `params` ([`PDSignDocSignParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSignParams)): IN Object to be modified. - `dataFmt` ([`CredentialDataFmt`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#CredentialDataFmt)): IN Encoding format of public-key credentials required to sign the document. **Returns:** `void` #### PDSignDocSetDigestCategory ```cpp void PDSignDocSetDigestCategory(PDSignDocSignParams params, DigestCategory digestCat) ``` Header: `DLExtrasProcs.h:1623` Sets the value of the cryptographic hash function to use for generating message digests. **Parameters** - `params` ([`PDSignDocSignParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSignParams)): IN Object to be modified. - `digestCat` ([`DigestCategory`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#DigestCategory)): IN Cryptographic hash function to use for generating message digests. **Returns:** `void` #### PDSignDocSetDocMajorVersionNumber ```cpp void PDSignDocSetDocMajorVersionNumber(PDSignDocSaveParams params, PDDocVersion major) ``` Header: `DLExtrasProcs.h:1816` Sets the major PDF version number of the document. **Parameters** - `params` ([`PDSignDocSaveParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSaveParams)): IN Object to be modified. - `major` ([`PDDocVersion`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocVersion)): IN Major PDF version number of the document. If major equals 0, both major and minor are ignored. It is the users responsibility to ensure the document conforms to the version number that is specified. **Returns:** `void` #### PDSignDocSetDocMinorVersionNumber ```cpp void PDSignDocSetDocMinorVersionNumber(PDSignDocSaveParams params, PDDocVersion minor) ``` Header: `DLExtrasProcs.h:1830` Sets the minor PDF version number of the document. **Parameters** - `params` ([`PDSignDocSaveParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSaveParams)): IN Object to be modified. - `minor` ([`PDDocVersion`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDocVersion)): IN Minor PDF version number of the document. **Returns:** `void` #### PDSignDocSetDocSignType ```cpp void PDSignDocSetDocSignType(PDSignDocSignParams params, SignatureType signType) ``` Header: `DLExtrasProcs.h:1710` Sets the type of signature to be added to the document. **Parameters** - `params` ([`PDSignDocSignParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSignParams)): IN Object to be modified. - `signType` ([`SignatureType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#SignatureType)): IN The type of signature to be added to a document. **Returns:** `void` #### PDSignDocSetFieldID ```cpp void PDSignDocSetFieldID(PDSignDocSignParams params, SignatureFieldID id) ``` Header: `DLExtrasProcs.h:1550` Sets the field identifier used to determine the form field that will contain the digital signature. **Parameters** - `params` ([`PDSignDocSignParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSignParams)): IN Object to be modified. - `id` ([`SignatureFieldID`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#SignatureFieldID)): IN Identifier to determine the form field that will contain the digital signature. **Returns:** `void` #### PDSignDocSetFieldName ```cpp void PDSignDocSetFieldName(PDSignDocSignParams params, ASConstText fieldName) ``` Header: `DLExtrasProcs.h:1564` Sets the fully qualified name of the form field that will contain the digital signature to be added to the document. **Parameters** - `params` ([`PDSignDocSignParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSignParams)): IN Object to be modified. - `fieldName` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): IN Fully qualified name of the form field that will contain the digital signature. **Returns:** `void` #### PDSignDocSetFieldObject ```cpp void PDSignDocSetFieldObject(PDSignDocSignParams params, CosObj fieldObj) ``` Header: `DLExtrasProcs.h:1579` Sets the form field Cos object identifying the field dictionary that will contain the digital signature. **Parameters** - `params` ([`PDSignDocSignParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSignParams)): IN Object to be modified. - `fieldObj` ([`CosObj`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/coslayer.md#CosObj)): IN Cos object identifying the field dictionary containing the signature. **Returns:** `void` #### PDSignDocSetFileSys ```cpp void PDSignDocSetFileSys(PDSignDocSaveParams params, ASFileSys outputFileSys) ``` Header: `DLExtrasProcs.h:1790` Sets the file system of the signed document to be saved. **Parameters** - `params` ([`PDSignDocSaveParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSaveParams)): IN Object to be modified. - `outputFileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)): IN The file system. If NULL, the file system of the document's current backing file is used. **Returns:** `void` #### PDSignDocSetNonPfxPassphrase ```cpp void PDSignDocSetNonPfxPassphrase(PDSignDocSignParams params, void *passphrase, ASSize_t passphraseSize, CredentialStorageFmt storageFmt) ``` Header: `DLExtrasProcs.h:1672` Sets the passphrase used to decrypt NonPFX credentials. The passphrase provided must use the exact same character encoding used to encrypt the private key. The application makes no effort whatsoever to re-encode the same. **Parameters** - `params` ([`PDSignDocSignParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSignParams)): IN Object to be modified. - `passphrase` (`void *`): IN Passphrase used to encrypt NonPFX private key. Should be set to NULL if unencrypted. - `passphraseSize` ([`ASSize_t`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASSize_t)): IN Passphrase size in bytes. Shall be set to 0 if private key is unencrypted or passphrase is stored on disk. - `storageFmt` ([`CredentialStorageFmt`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#CredentialStorageFmt)): IN Storage format for passphrase. **Returns:** `void` #### PDSignDocSetNonPfxPrivateKey ```cpp void PDSignDocSetNonPfxPrivateKey(PDSignDocSignParams params, void *privateKey, ASSize_t keySize, CredentialStorageFmt storageFmt) ``` Header: `DLExtrasProcs.h:1662` Sets the private key for NonPFX credentials. **Parameters** - `params` ([`PDSignDocSignParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSignParams)): IN Object to be modified. - `privateKey` (`void *`): IN Private key corresponding to the public key in the signer certificate. - `keySize` ([`ASSize_t`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASSize_t)): IN Size of private key in bytes. Shall be set to 0 if key is stored on disk. - `storageFmt` ([`CredentialStorageFmt`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#CredentialStorageFmt)): IN Storage format for private key. **Returns:** `void` #### PDSignDocSetNonPfxSignerCert ```cpp void PDSignDocSetNonPfxSignerCert(PDSignDocSignParams params, void *signerCert, ASSize_t certSize, CredentialStorageFmt storageFmt) ``` Header: `DLExtrasProcs.h:1653` Sets the signer certificate for NonPFX credentials. **Parameters** - `params` ([`PDSignDocSignParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSignParams)): IN Object to be modified. - `signerCert` (`void *`): IN Signer certificate. - `certSize` ([`ASSize_t`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASSize_t)): IN Size of signer certificate in bytes. Shall be set to 0 if certificate is stored on disk. - `storageFmt` ([`CredentialStorageFmt`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#CredentialStorageFmt)): IN Storage format for the signer certificate. **Returns:** `void` #### PDSignDocSetOutputPath ```cpp void PDSignDocSetOutputPath(PDSignDocSaveParams params, ASPathName outputPath) ``` Header: `DLExtrasProcs.h:1776` Sets the output path to which the signed document is saved. **Parameters** - `params` ([`PDSignDocSaveParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSaveParams)): IN Object to be modified. - `outputPath` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): IN Path to which the signed document is saved. **Returns:** `void` #### PDSignDocSetPfxCredentials ```cpp void PDSignDocSetPfxCredentials(PDSignDocSignParams params, void *credentials) ``` Header: `DLExtrasProcs.h:1679` Sets PFX/PKCS#12 credentials. **Parameters** - `params` ([`PDSignDocSignParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSignParams)): IN Object to be modified. - `credentials` (`void *`): IN Credentials in PFX/PKCS#12 file format. **Returns:** `void` #### PDSignDocSetPfxPassphrase ```cpp void PDSignDocSetPfxPassphrase(PDSignDocSignParams params, void *passphrase, ASSize_t passphraseSize, CredentialStorageFmt storageFmt) ``` Header: `DLExtrasProcs.h:1689` Sets the passphrase used to decrypt PFX/PKCS#12 credentials. The passphrase provided must use the exact same character encoding used to encrypt the PFX credentials. The application makes no effort whatsoever to re-encode the same. **Parameters** - `params` ([`PDSignDocSignParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSignParams)): IN Object to be modified. - `passphrase` (`void *`): IN Passphrase used to encrypt PFX/PKCS#12 credentials. Shall be set to NULL if credentials are unencrypted. - `passphraseSize` ([`ASSize_t`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASSize_t)): IN Passphrase size in bytes. Shall be set to 0 if PFX credentials are unencrypted or passphrase is stored on disk. - `storageFmt` ([`CredentialStorageFmt`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#CredentialStorageFmt)): IN Storage format for PFX/PKCS#12 credentials. **Returns:** `void` #### PDSignDocSetProgressMon ```cpp void PDSignDocSetProgressMon(PDSignDocSaveParams params, ASProgressMonitor progMon, void *progMonClientData) ``` Header: `DLExtrasProcs.h:1798` Sets the progress monitor and client data for the monitor. **Parameters** - `params` ([`PDSignDocSaveParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSaveParams)): IN Object to be modified. - `progMon` (`ASProgressMonitor`): IN Progress monitor. Use AVAppGetDocProgressMonitor() to obtain the default. It may be NULL. - `progMonClientData` (`void *`): IN A pointer to user-supplied data to pass to mon each time it is called. It must be NULL if mon is NULL. **Returns:** `void` #### PDSignDocSetSigPolicy ```cpp ASInt32 PDSignDocSetSigPolicy(PDSignDocSignParams params, ASConstText oid) ``` Header: `DLExtrasProcs.h:1727` Adds a signature policy as a signed attribute to the PAdES signature used to sign the document. Signature policies may be applied to PAdES signatures, only. It is required that signature type be defined prior to adding a signature policy. **Parameters** - `params` ([`PDSignDocSignParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSignParams)): IN Object to be modified. - `oid` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): IN Object Identifier (OID) that uniquely identifies a specific version of the signature policy to be added. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) Number of signature policies contained within the PAdES signature. **Exceptions** - `Raises`: if signature type is undefined or set to a type other than PAdES, or if an invalid policy OID is provided. #### PDSignDocSetSigPolicyQualifierURI ```cpp void PDSignDocSetSigPolicyQualifierURI(PDSignDocSignParams params, ASConstText uri) ``` Header: `DLExtrasProcs.h:1735` Adds an element of type SPuri containing a URI value that specifies the location of the copy of the document of the most recently added signature policy. **Parameters** - `params` ([`PDSignDocSignParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSignParams)): IN Object to be modified. - `uri` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): IN URI value where a copy of the document of the most-recently added signature policy can be obtained. **Returns:** `void` **Exceptions** - `Raises`: if qualifying an undefined signature policy, or qualifying an existing signature policy with multiple qualifiers. #### PDSignDocSetSigPolicyQualifierUserNotice ```cpp void PDSignDocSetSigPolicyQualifierUserNotice(PDSignDocSignParams params, ASConstText displayText, ASConstText org, ASInt64 *noticeNos, ASSize_t numNoticeNos) ``` Header: `DLExtrasProcs.h:1750` Adds an element of type SPUserNotice containing information that is intended for being displayed whenever the PAdES signature is validated. The displayText and org attributes can be defined independent of each other. However, a valid org attribute must be defined in order to qualify a PAdES signature policy with the noticeNos attribute. **Parameters** - `params` ([`PDSignDocSignParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSignParams)): IN Object to be modified. - `displayText` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): IN Text of the notice to be displayed. - `org` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): IN Organization name that to be specified as part of the NoticeRef field. - `noticeNos` ([`ASInt64 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt64)): IN Array of integers that identify a group of textual statements prepared by the organization to allow for retrieval of notices. - `numNoticeNos` ([`ASSize_t`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASSize_t)): IN Size of the array containing notice numbers. **Returns:** `void` **Exceptions** - `Raises`: if qualifying an undefined signature policy, qualifying an existing signature policy with multiple qualifiers, or defining a noticeNos attribute without a corresponding org attribute definition. #### PDSignDocSetSignatureBoxPageNumber ```cpp void PDSignDocSetSignatureBoxPageNumber(PDSignDocSignParams params, ASUns32 pageNumber) ``` Header: `DLExtrasProcs.h:1594` Sets the page number on which the widget annotation of the signature field is created. **Parameters** - `params` ([`PDSignDocSignParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSignParams)): IN Object to be modified. - `pageNumber` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): IN Page number on which to create the widget annotation. **Returns:** `void` #### PDSignDocSetSignatureBoxRectangle ```cpp void PDSignDocSetSignatureBoxRectangle(PDSignDocSignParams params, ASFixedRectP boxRect) ``` Header: `DLExtrasProcs.h:1608` Sets the dimension of the annotation rectangle of the signature field being created. **Parameters** - `params` ([`PDSignDocSignParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSignParams)): IN Object to be modified. - `boxRect` (`ASFixedRectP`): IN Dimension of the annotation rectangle of the signature field. **Returns:** `void` #### PDSignDocSetSignerInfo ```cpp void PDSignDocSetSignerInfo(PDSignDocSignParams params, PDEImage logo, ASFixed opacity, ASConstText name, ASConstText location, ASConstText reason, ASConstText contactInfo, ASInt32 displayTraits) ``` Header: `DLExtrasProcs.h:1702` Sets signer info attributes that define corresponding signature dictionary entries and signature appearance traits. **Parameters** - `params` ([`PDSignDocSignParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSignParams)): IN Object to be modified. - `logo` ([`PDEImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage)): IN Image to display as part of signature appearance. - `opacity` ([`ASFixed`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFixed)): IN Opacity of image to display as part of signature appearance. - `name` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): IN Name of the person or authority signing the document. - `location` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): IN CPU host name or physical location of the signing. - `reason` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): IN Reason for signing the document. - `contactInfo` ([`ASConstText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASConstText)): IN Information provided by the signer to enable recipients to contact signer for signature verification. - `displayTraits` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN DisplayTraits fields to display as part of signature appearance. **Returns:** `void` #### PDSignDocSignInitParams ```cpp PDSignDocSignParams PDSignDocSignInitParams(void) ``` Header: `DLExtrasProcs.h:1537` Defines a set of document signature parameters. When these parameters are no longer needed (after the call to PDSignDocWithParams, although they can be re-used any number of times), they should be freed by calling PDSignDocSignReleaseParams(). **Parameters** - (unnamed) (`void`) **Returns:** [`PDSignDocSignParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSignParams) Initialized document signature parameters that can be further modified. **See also:** [`PDSignDocSignReleaseParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSignReleaseParams) #### PDSignDocSignReleaseParams ```cpp void PDSignDocSignReleaseParams(PDSignDocSignParams params) ``` Header: `DLExtrasProcs.h:1543` Deallocates resources used by the PDSignDocSignParams object. **Parameters** - `params` ([`PDSignDocSignParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSignParams)): IN Object to deallocate. **Returns:** `void` #### PDSignDocWithParams ```cpp void PDSignDocWithParams(PDDoc doc, PDSignDocSaveParams saveParams, PDSignDocSignParams signParams) ``` Header: `DLExtrasProcs.h:1525` Adds a digital signature to a document. It is expected that the PDSignDocSaveParams and PDSignDocSignParams structure definitions have been set by the user prior to signing a document. If the document has not been previously signed, signs and saves the entire document. If the document has been previously signed, signs and saves only the portions of the document that have changed. If the document has been previously signed and the path to which the file is saved is NULL or the same as the path specified by the parameter, doc, signs and copies the document, saving only the portions of the document that have changed. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The PDF document object. - `saveParams` ([`PDSignDocSaveParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSaveParams)): IN A PDSignDocSaveParams structure specifying how the document should be saved. - `signParams` ([`PDSignDocSignParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDSignDocSignParams)): IN A PDSignDocSignParams structure specifying how the document should be signed. **Returns:** `void` ### Structures (5) #### OptimizedFont ```cpp typedef struct OptimizedFontRec * OptimizedFont ``` Header: `DLExtrasExpT.h:311` #### OptimizedImage ```cpp typedef struct OptimizedImageRec * OptimizedImage ``` Header: `DLExtrasExpT.h:297` #### PDSignDocSaveParams ```cpp typedef struct _t_PDSignDocSaveParams* PDSignDocSaveParams ``` Header: `DLExtrasExpT.h:690` Type that specifies the parameters required for saving the document to which a digital signature is added. #### PDSignDocSignParams ```cpp typedef struct _t_PDSignDocSignParams* PDSignDocSignParams ``` Header: `DLExtrasExpT.h:687` Type that specifies the parameters required for adding a digital signature to a document. #### QREncodeParams ```cpp typedef struct _t_QREncodeParamsRec* QREncodeParams ``` Header: `DLExtrasExpT.h:742` An opaque type collecting together QREncodeParams parameters. ### Enums (11) #### AC_OptionCode Header: `DLExtrasExpT.h:22` Datalogics-specific flags for the Acro Color Layer. **Values** - `AC_Option_BlackPointCompensation = FOUR_CHAR_CODE('kptc')`: Controls whether to adjust for differences in black points when converting colors between color spaces. If enabled the full dynamic range of the source space is mapped into the full dynamic range of the destination space. If disabled, the dynamic range of the source space is simulated in the destination space (which can result in blocked or gray shadows) This option is ignored if the rendering intent for the transformation is AC_AbsColorimetric. Default is 0 (zero). - `AC_Option_Dither8 = FOUR_CHAR_CODE('dth8')`: Dither transformations to 8 bit color spaces. This may be ignored by optimized transforms. This option is used by AC_ApplyTransform. Default is 0 (zero). - `AC_OptionCode_MaxEnum = 0xFFFFFFFFL` #### CredentialDataFmt Header: `DLExtrasExpT.h:628` Enumeration to specify user-credential format. **Values** - `NonPFX = 0`: Base64-encoded or Binary DER (ASN.1 Distinguished Encoding Rules) format. - `PFX = 1`: PKCS#12 format. #### CredentialStorageFmt Header: `DLExtrasExpT.h:636` Enumeration to specify whether user-credentials reside on-disk or are cached in memory. **Values** - `OnDisk = 0`: Credential resides on-disk. - `InMemory = 1`: Credential is cached in memory. #### DLImageCompression Header: `DLExtrasExpT.h:462` Compression values for exporting TIF images. **Values** - `Compression_Default = 0`: Use the default for the output image type. - `Compression_NONE = 1`: Use no image compression. Valid for BMP, PNG and TIFF outputs only. - `Compression_FLATE = 2`: Deflate algorithm (PNG only). An open source standard widely used for creating zip files and with PDF. - `Compression_LZW = 3`: Lempel-Ziv-Welch, valid for TIFF output. A lossless algorithm, resulting files are larger but retain original quality. - `Compression_G3 = 4`: CCITT Group3 compression. Valid for TIFF, requires colorModel gray. A lossless algorithm for black and white images that efficiently compresses whitespace. - `Compression_G4 = 5`: CCITT Group4 compression. Valid for TIFF, requires colorModel gray. A lossless algorithm for black and white images based on G3. - `Compression_DCT = 6`: Discrete Cosine Transform. Lossy algorithm, valid for JPEG. Best when used with continuous tone (such as photographs). #### DLImageExportType Header: `DLExtrasExpT.h:446` Export Image Types. **Values** - `ExportType_Invalid = 0`: Used for error handling - `ExportType_TIF = 1`: Tagged Image File Format - `ExportType_JPEG = 2`: Joint Photographic Experts Group - `ExportType_BMP = 3`: Microsoft Windows Bitmap - `ExportType_PNG = 4`: Portable Network Graphic - `ExportType_GIF = 5`: Graphics Interchange Format #### DLTIFFByteOrder Header: `DLExtrasExpT.h:479` **Values** - `Order_BigEndian = 0` - `Order_LittleEndian = 1` - `HostEndian = 2` #### DigestCategory Header: `DLExtrasExpT.h:644` Enumeration to specify cryptographic hash functions that generate variable-length message digests required for digital signature creation. **Values** - `sha1 = 0`: SHA-1 message digest comprised of a 160-bit hash value. - `sha224 = 1`: SHA-2 message digest comprised of a 224-bit hash value. - `sha256 = 2`: SHA-2 message digest comprised of a 256-bit hash value. - `sha384 = 3`: SHA-2 message digest comprised of a 384-bit hash value. - `sha512 = 4`: SHA-2 message digest comprised of a 512-bit hash value. #### DisplayTraits Header: `DLExtrasExpT.h:658` Enumeration to specify fields to display as part of signature appearance. **Values** - `kDisplayNone = 0x0`: Do not display text labels or logo image. Note that specifying this option results in an empty signature appearance. - `kDisplayAll = 0x1`: Display all available text labels and logo image. Note that the application expects valid data to be supplied for each available label that will be displayed as a result of this option being selected. - `kDisplayName = 0x2`: Display the Name label. - `kDisplayReason = 0x4`: Display the Reason label. - `kDisplayLocation = 0x8`: Display the Location label. - `kDisplayDate = 0x10`: Display the Date label. - `kDisplayContactInfo = 0x20`: Display the ContactInfo label. - `kDisplayDN = 0x40`: Display the Signer Certificate's Distinguished Name label. - `kDisplayLogo = 0x80`: Display logo image. #### FontRescanFlags Header: `DLExtrasExpT.h:73` flags for rescanning font directories for additional fonts after Library initialization. **Values** - `FontRescan_Files = 1`: This will rescan just the fields defined in dirList, plus those added with PDFLAddFontDirectories. - `FontRescan_System = 2`: This will rescan the system directories. - `FontRescan_All = 3`: This, or an "or" of the previous two, will rescan both. #### SignatureFieldID Header: `DLExtrasExpT.h:594` Enumeration to specify identifying information of the form field expected to contain the digital signature. **Values** - `SearchForFirstUnsignedField = 0`: Search for the first available signature field, i.e., a field that does not contain a signature. No new signature field is created if none found. Exception raised if not found. - `FieldCosObject = 1`: Cos object of an existing signature field that does not contain a signature. No new signature field is created if not found. Exception raised if not found. - `FullyQualifiedFieldName = 2`: Fully qualified field name of a valid T entry in an existing field dictionary that is expected to contain the digital signature. Refer PDF specification ISO 32000-2:2020, Section 12.7.4.2 for additional information. No new signature field is created if not found. Exception raised if not found. - `CreateFieldWithQualifiedName = 3`: Creates a new signature field to be signed using the T-entry fully qualified field name provided. The signature field created will contain neither parent nor child entries, i.e., the partial field name is the same as the fully qualified field name, per PDF specification ISO 32000-2:2020 Section 12.7.4.2. Field name provided shall not be separated by a period (.) character. Appearance of the generated signature field is determined by widget annotation attributes specified by signatureBoxInfo. If signatureBoxInfo is undefined, the annotation is not drawn, resulting in the creation of an invisible signature field on the first page. #### SignatureType Header: `DLExtrasExpT.h:693` Enumeration to specify the type of signature to be added to the document. **Values** - `CMS = 0`: Digital signature based on the Cryptographic Message Syntax (CMS) standard. CMS-based digital signatures contain embedded timestamps, per the RFC3161 specification. - `RFC3161 = 1`: Trusted timestamp based on the Time-Stamp Protocol (RFC3161). Timestamp signatures are not available on 32-bit Linux and 64-bit AIX systems. - `PADES = 2`: PAdES B-T baseline and policy-based digital signatures per the ETSI EN 319 142 European Standard. PAdES signatures are not available on 32-bit Linux and 64-bit AIX systems. ### Definitions (1) #### FOUR_CHAR_CODE Header: `DLExtrasExpT.h:16` Value: `(x)` ## JPXColorSpace ### Functions (1) #### JPXColorSpaceGetApprox ```cpp ASInt32 JPXColorSpaceGetApprox(JPXColorSpace jpxColorSpace) ``` Header: `DLExtrasProcs.h:814` Returns the approximation of the JPX color space specification. **Parameters** - `jpxColorSpace` ([`JPXColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#JPXColorSpace)): IN/OUT A JPX color space object. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The JPX color space approximation. **See also:** [`PDEImageJPXAcquireJPXColorSpace`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageJPXAcquireJPXColorSpace) ## Metadata ### Functions (1) #### PDDocGetXAPMetadataCompactOptional ```cpp ASText PDDocGetXAPMetadataCompactOptional(IN PDDoc pdDoc, IN ASBool enableCompactRDF) ``` Header: `PDMetadataProcs.h:573` Allow customer to get XML/RDF metadata in a full (non-compact) form Gets the XMP metadata associated with a document. It returns an ASText whose text is the XML text of the XMP metadata associated with the document `pdDoc`. The ASText becomes the property of the client, which is free to alter or destroy it. The XMP metadata returned always represents all the properties in the `pdDoc` object's Info dictionary, and can also contain properties not present in the Info dictionary. This call is preferred to PDDocGetInfo(), which only returns properties that are in the Info dictionary (although the older function is supported for compatibility). **Note:** The term *XAP* refers to an early internal code name for Adobe's Extensible Metadata Platform (XMP). For more information on this protocol, see the Adobe XMP specification. **Parameters** - `pdDoc` (`IN PDDoc`): The document containing the metadata. - `enableCompactRDF` (`IN ASBool`): True if the XML/RDF output is in compact form. **Returns:** [`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText) An ASText object containing the XMP metadata associated with the document pdDoc. **Exceptions** - `pdMetadataErrCouldntCreateMetaXAP` **See also:** `PDDocGetXAPMetadataProperty`, `PDDocSetXAPMetadata`, `PDDocSetXAPMetadataProperty` ## PDDoc ### Functions (35) #### PDDocDeletePagesEx ```cpp void PDDocDeletePagesEx(IN PDDoc doc, ASInt32 firstPage, ASInt32 lastPage, ProgressMonitor progMon, void *progMonClientData, PDPageDeleteFlags flags) ``` Header: `DLExtrasProcs.h:899` Deletes the specified pages. **Parameters** - `doc` (`IN PDDoc`): The document from which pages are deleted. - `firstPage` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The page number of the first page to delete. The first page is `0`. - `lastPage` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The page number of the last page to delete. - `progMon` ([`ProgressMonitor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ProgressMonitor)): A progress monitor. Use AVAppGetDocProgressMonitor() to obtain the default progress monitor. `NULL` may be passed, in which case no progress monitor is used. - `progMonClientData` (`void *`): A pointer to user-supplied datapassed to `progMon` each time it is called. It should be `NULL` if progMon is `NULL`. - `flags` ([`PDPageDeleteFlags`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDPageDeleteFlags)): Page Deletion flags that can be used to modify the how the deletion process works. **Returns:** `void` #### PDDocEmbedFonts ```cpp void PDDocEmbedFonts(PDDoc doc, ASUns32 flags, ASStatusMonitorProcs statusMon) ``` Header: `DLExtrasProcs.h:197` Routine to embed unembedded fonts in a document. **Note:** If the font has information indicating that it cannot be embedded for print and preview, the font will not be embedded in the document. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): PDDoc to operate on. The fonts will be embedded in this document. To keep the changes the document must be saved. Fonts on the user's system that match the original font definition will be embedded. For the Times Roman and Helvetica and corresponding styles, if displayed with a font alias, then the font alias will be embedded in the file. If the font has information that indicates the font cannot be embedded for print and preview, the font will not be embedded in the document. - `flags` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): One of the following: kDocEmbedSubset If set fonts will be subset when embedded. Otherwise the entire font will be embedded. Full fonts should only be embedded if the information in the fonts indicates it can be used for editible embedding. Fonts that have more than 2048 characters will be subset embedded regardless of the setting of this flag. kDocEmbedSubsetOfEmbeddedFont If set, fonts that have already been embedded but are not subset fonts, will be reembedded as a subset font. - `statusMon` (`ASStatusMonitorProcs`): Pointer to a record containing a Progress Monitor, Cancel procedure, and report procedure. The procedures in the progress monitor are called to indicate the progress of the routine. The cancel procedure is called periodically to allow the client to cancel the routine. If the cancel procedure returns false then the routine is canceled. The report procedure will be called to report errors or warnings while embedding the fonts. For each font that cannot be embedded, the report procedure will be called. **Returns:** `void` **See also:** [`PDDocEmbedFontsFromFontArray`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocEmbedFontsFromFontArray) #### PDDocEmbedFontsFromFontArray ```cpp void PDDocEmbedFontsFromFontArray(PDDoc doc, const PDFont *fonts, ASUns32 nFonts, ASUns32 flags, ASStatusMonitorProcs statusMon) ``` Header: `DLExtrasProcs.h:240` Routine to embed fonts in a document. This will embed only the fonts listed in an array. The parameters to this routine are them same as described for PDDocEmbedFonts. With the exception of the additional fonts and nFonts parameters described below. **Note:** If the font has information indicating that it cannot be embedded for print and preview, then the font will not be embedded in the document. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): PDDoc to operate on. The fonts will be embedded in this document. To keep the changes the document must be saved. Fonts on the user's system that match the original font definition will be embedded. For the Times Roman and Helvetica and corresponding styles, if displayed with a font alias, then the font alias will be embedded in the file. If the font has information that indicates the font cannot be embedded for print and preview, then the font will not be embedded in the document. - `fonts` ([`const PDFont *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFont)): An array of PDFont containing fonts to be embedded. - `nFonts` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The number of fonts in the fonts array. - `flags` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): One of the following: kDocEmbedSubset If set fonts will be subset when embedded. Otherwise the entire font will be embedded. Full fonts should only be embedded if the information in the fonts indicates it can be used for editible embedding. Fonts that have more than 2048 characters will be subset embedded regardless of the setting of this flag. kDocEmbedSubsetOfEmbeddedFont If set, fonts that have already been embedded but are not subset fonts, will be reembedded as a subset font. - `statusMon` (`ASStatusMonitorProcs`): Pointer to a record containing a Progress Monitor, Cancel procedure, and report procedure. The procedures in the progress monitor are called to indicate the progress of the routine. The cancel procedure is called periodically to allow the client to cancel the routine. If the cancel procedure returns false then the routine is canceled. The report procedure will be called to report errors or warnings while embedding the fonts. For each font that cannot be embedded, the report procedure will be called. **Returns:** `void` **See also:** [`PDDocEmbedFonts`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocEmbedFonts) #### PDDocFlattenAcroFormFieldsAsIfPrinted ```cpp void PDDocFlattenAcroFormFieldsAsIfPrinted(PDDoc doc) ``` Header: `DLExtrasProcs.h:1489` Flatten a AcroForms Document as if printed. Flattening transforms the document into static PDF page content. All AcroForm fields are removed. The Flattened appearance will take into consideration how the document's appearance should look when printed. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN/OUT The PDF document object. **Returns:** `void` #### PDDocHasSignature ```cpp ASBool PDDocHasSignature(PDDoc pdDoc) ``` Header: `DLExtrasProcs.h:794` Determines if the document contains a digital signature. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) If the document has a digital signature. #### PDDocOptimizeDefaultParams ```cpp PDFOptimizationParams PDDocOptimizeDefaultParams(void) ``` Header: `DLExtrasProcs.h:647` This will create a set of optimization parameters, set to the default values. These can be examined using "get" methods, and changed with the "set" methods When these parameters are no longer needed (after the call to PDDocumentOptimize, although they be re-used any number of times), they should be freed by the method PDDocOptimizeReleaseParams. **Parameters** - (unnamed) (`void`) **Returns:** [`PDFOptimizationParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDFOptimizationParams) initialized optimization parameters that can be further modified. **See also:** [`PDDocOptimizeReleaseParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocOptimizeReleaseParams) #### PDDocOptimizeGetImageRecompress ```cpp void PDDocOptimizeGetImageRecompress(PDFOptimizationParams Params, PDFOptimizerCompressImageType imageType, ASInt16 *recompressIfAbove, ASInt16 *recompressTo, PDFOptimizerCompressionType *compressType, PDFOptimizationCompressQuality *compressQuality) ``` Header: `DLExtrasProcs.h:729` This will return the values set for one of the three cases of Image Recompression and Downsampling. These values are used in deciding which Images from the set of all Images in the document will be modified by the Optimizer. **Parameters** - `Params` ([`PDFOptimizationParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDFOptimizationParams)): IN a PDFOptimizationParams object to be checked - `imageType` ([`PDFOptimizerCompressImageType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDFOptimizerCompressImageType)): OUT The class of Images these parameters are to refer to. - `recompressIfAbove` ([`ASInt16 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16)): OUT The lower limit of resolution (In DPI) of an Image to be Resampled. - `recompressTo` ([`ASInt16 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16)): OUT The target DPI for Resampling. Images which are Resampled will be changed to this resolution. - `compressType` ([`PDFOptimizerCompressionType *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDFOptimizerCompressionType)): OUT a member of the enumeration PDFOptimizerCompressionType. - `compressQuality` ([`PDFOptimizationCompressQuality *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDFOptimizationCompressQuality)): OUT a member of the enumeration PDFOptimizationCompressQuality **Returns:** `void` **See also:** [`PDDocOptimizeSetImageRecompress`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocOptimizeSetImageRecompress) #### PDDocOptimizeGetObjectCompression ```cpp PDFOptimizerObjectCompressionType PDDocOptimizeGetObjectCompression(PDFOptimizationParams params) ``` Header: `DLExtrasProcs.h:671` This will get the type of compression used for objects. **Parameters** - `params` ([`PDFOptimizationParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDFOptimizationParams)): the PDFOptimizationParams object from which the compression type will be read from. **Returns:** [`PDFOptimizerObjectCompressionType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDFOptimizerObjectCompressionType) PDFOptimizerObjectCompressionType **See also:** [`PDDocOptimizeSetObjectCompression`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocOptimizeSetObjectCompression) #### PDDocOptimizeGetOption ```cpp ASBool PDDocOptimizeGetOption(PDFOptimizationParams Params, PDFOptimizerOption option) ``` Header: `DLExtrasProcs.h:750` This will return the setting of an optimization option. **Parameters** - `Params` ([`PDFOptimizationParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDFOptimizationParams)): IN. A PDFOptimizationParams object to be checked - `option` ([`PDFOptimizerOption`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDFOptimizerOption)): IN. A member of the enumeration PDFOptimizerOption, selecting which option to effect. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) If true, the associated option is ON. If false, the option is OFF. #### PDDocOptimizeGetPDFOutputLevel ```cpp void PDDocOptimizeGetPDFOutputLevel(PDFOptimizationParams params, ASInt16 *majorP, ASInt16 *minorP) ``` Header: `DLExtrasProcs.h:691` Gets the output level for the optimized pdf. **Parameters** - `params` ([`PDFOptimizationParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDFOptimizationParams)) - `majorP` ([`ASInt16 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16)): (Filled by method) The major version number. - `minorP` ([`ASInt16 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16)): (Filled by method) The minor version number. **Returns:** `void` **See also:** [`PDDocOptimizeSetPDFOutputLevel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocOptimizeSetPDFOutputLevel) #### PDDocOptimizeReleaseParams ```cpp void PDDocOptimizeReleaseParams(PDFOptimizationParams params) ``` Header: `DLExtrasProcs.h:654` This will completely free the resources used by a PDFOptimizationParams structure. **Parameters** - `params` ([`PDFOptimizationParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDFOptimizationParams)): the PDFOptimizationParams to free. **Returns:** `void` #### PDDocOptimizeSetImageRecompress ```cpp void PDDocOptimizeSetImageRecompress(PDFOptimizationParams Params, PDFOptimizerCompressImageType imageType, ASInt16 recompressIfAbove, ASInt16 recompressTo, PDFOptimizerCompressionType compressType, PDFOptimizationCompressQuality compressQuality) ``` Header: `DLExtrasProcs.h:712` This will set the value for one of the cases of Image Recompression and Downsampling. These values are used in deciding which Images from the set of all Images in the document will be modified by the Optimizer. **Parameters** - `Params` ([`PDFOptimizationParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDFOptimizationParams)): IN a PDFOptimizationParams object to be modified - `imageType` ([`PDFOptimizerCompressImageType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDFOptimizerCompressImageType)): IN The class of Images these parameters are to refer to. This is a member of the Enumeration PDFOptimizerCompressImageType and is one of the set of values "Color", "Gray", or "Monochrome" (B/W). - `recompressIfAbove` ([`ASInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16)): IN The lower limit of resolution (In DPI) of an Image to be Resampled. Only Images above this limitation will be considered for Resampling. - `recompressTo` ([`ASInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16)): IN The target DPI for Resampling. Images which are Resampled will be changed to this resolution. - `compressType` ([`PDFOptimizerCompressionType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDFOptimizerCompressionType)): IN a member of the enumeration PDFOptimizerCompressionType. Images which are either Resampled or Recompressed will be written in this compression type. If the value of this enumeration is either the specifier for "Same", or for "None", then we will not Recompress images which do not require Downsampling. - `compressQuality` ([`PDFOptimizationCompressQuality`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDFOptimizationCompressQuality)): IN a member of the enumeration PDFOptimizationCompressQuality. NOTE that this enumeration is only meaningful for lossy compression techniques. Note also that it is an error to specify "Lossless" for techniques that cannot support lossless compression. **Returns:** `void` **See also:** [`PDDocOptimizeGetImageRecompress`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocOptimizeGetImageRecompress) #### PDDocOptimizeSetObjectCompression ```cpp void PDDocOptimizeSetObjectCompression(PDFOptimizationParams params, PDFOptimizerObjectCompressionType compressionType) ``` Header: `DLExtrasProcs.h:663` This will set the type of compression used for objects. **Parameters** - `params` ([`PDFOptimizationParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDFOptimizationParams)): a PDFOptimizationParams object to be modified. - `compressionType` ([`PDFOptimizerObjectCompressionType`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDFOptimizerObjectCompressionType)): The type of compression to apply to the document. **Returns:** `void` **See also:** [`PDDocOptimizeGetObjectCompression`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocOptimizeGetObjectCompression) #### PDDocOptimizeSetOption ```cpp void PDDocOptimizeSetOption(PDFOptimizationParams Params, PDFOptimizerOption option, ASBool OnOff) ``` Header: `DLExtrasProcs.h:741` This will set one the optimzation option either ON or OFF. **Parameters** - `Params` ([`PDFOptimizationParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDFOptimizationParams)): IN. A PDFOptimizationParams object to be modified - `option` ([`PDFOptimizerOption`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDFOptimizerOption)): IN. A member of the enumeration PDFOptimizerOption, selecting which option to effect. - `OnOff` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): IN. If true, set the associated option as ON. If false, set it as OFF. **Returns:** `void` **See also:** [`PDDocOptimizeGetOption`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocOptimizeGetOption) #### PDDocOptimizeSetPDFOutputLevel ```cpp void PDDocOptimizeSetPDFOutputLevel(PDFOptimizationParams params, ASInt16 majorP, ASInt16 minorP) ``` Header: `DLExtrasProcs.h:681` Sets the output level for the optimized pdf. **Parameters** - `params` ([`PDFOptimizationParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDFOptimizationParams)) - `majorP` ([`ASInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16)): The major version number. - `minorP` ([`ASInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16)): The minor version number. **Returns:** `void` **See also:** [`PDDocOptimizeGetPDFOutputLevel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocOptimizeGetPDFOutputLevel) #### PDDocOptimizeSetTDMReservationPolicy ```cpp void PDDocOptimizeSetTDMReservationPolicy(PDDoc inputDoc, PDFOptimizationParams params, ASBool reservation, ASText policyURL) ``` Header: `DLExtrasProcs.h:1846` This will set the Text Data Mining (TDM) reservation and policy of the Document. **Parameters** - `inputDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN Document object - `params` ([`PDFOptimizationParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDFOptimizationParams)): IN PDFOptimizationParams object - `reservation` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): IN TDM reservation being set - `policyURL` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)) **Returns:** `void` #### PDDocQREncodeParamsDefault ```cpp QREncodeParams PDDocQREncodeParamsDefault(void) ``` Header: `DLExtrasProcs.h:1871` This will create a set of Encode Parameters, set to the default values. These can be examined using "get" methods, and changed with the "set" methods When these parameters are no longer needed, they should be freed by the method PDDocQREncodeParamsRelease. **Parameters** - (unnamed) (`void`) **Returns:** [`QREncodeParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#QREncodeParams) initialized parameters that can be further modified. NOTE: Typical usage is to specify where the code should be located, what size it should be, what should be encoded etc. The default values are prepopulated to be a small visible barcode on a typical page size. **See also:** [`PDDocQREncodeParamsRelease`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocQREncodeParamsRelease) #### PDDocQREncodeParamsGetBackgroundColor ```cpp void PDDocQREncodeParamsGetBackgroundColor(QREncodeParams params, QRColor *backgroundColor) ``` Header: `DLExtrasProcs.h:1949` Gets the Background Color of the QR code to be Encoded. **Parameters** - `params` ([`QREncodeParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#QREncodeParams)) - `backgroundColor` ([`QRColor *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#QRColor)): The color of the Background of the barcode **Returns:** `void` **See also:** [`PDDocQREncodeParamsSetBackgroundColor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocQREncodeParamsSetBackgroundColor) #### PDDocQREncodeParamsGetCodeColor ```cpp void PDDocQREncodeParamsGetCodeColor(QREncodeParams params, QRColor *codeColor) ``` Header: `DLExtrasProcs.h:1963` Gets the Code Color of the QR code to be Encoded. **Parameters** - `params` ([`QREncodeParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#QREncodeParams)) - `codeColor` ([`QRColor *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#QRColor)): The color of the Code itself **Returns:** `void` **See also:** [`PDDocQREncodeParamsSetCodeColor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocQREncodeParamsSetCodeColor) #### PDDocQREncodeParamsGetErrorLevel ```cpp void PDDocQREncodeParamsGetErrorLevel(QREncodeParams params, QRErrorCorrectionLevel *errorLevel) ``` Header: `DLExtrasProcs.h:1921` Gets the Error Correction Level of the QR code to be Encoded **Parameters** - `params` ([`QREncodeParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#QREncodeParams)) - `errorLevel` ([`QRErrorCorrectionLevel *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#QRErrorCorrectionLevel)): The Error Correction Level **Returns:** `void` **See also:** [`PDDocQREncodeParamsSetErrorLevel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocQREncodeParamsSetErrorLevel) #### PDDocQREncodeParamsGetPositionAndSize ```cpp void PDDocQREncodeParamsGetPositionAndSize(QREncodeParams params, ASDouble *x, ASDouble *y, ASDouble *width, ASDouble *height) ``` Header: `DLExtrasProcs.h:1904` Gets the Position and Size of the QR code to be Encoded. **Parameters** - `params` ([`QREncodeParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#QREncodeParams)) - `x` ([`ASDouble *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDouble)): The x location of the Code - `y` ([`ASDouble *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDouble)): The y location of the Code - `width` ([`ASDouble *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDouble)): The width of the Code - `height` ([`ASDouble *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDouble)): The height of the Code **Returns:** `void` **See also:** [`PDDocQREncodeParamsSetPositionAndSize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocQREncodeParamsSetPositionAndSize) #### PDDocQREncodeParamsGetQuietZoneSize ```cpp void PDDocQREncodeParamsGetQuietZoneSize(QREncodeParams params, ASUns32 *quietZoneSize) ``` Header: `DLExtrasProcs.h:1935` Gets the Size in pixels of the Quiet Zone on each side of the QR code to be Encoded. **Parameters** - `params` ([`QREncodeParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#QREncodeParams)) - `quietZoneSize` ([`ASUns32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The Size of the Quiet Zone **Returns:** `void` **See also:** [`PDDocQREncodeParamsSetQuietZoneSize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocQREncodeParamsSetQuietZoneSize) #### PDDocQREncodeParamsGetTextToEncode ```cpp void PDDocQREncodeParamsGetTextToEncode(QREncodeParams params, ASText *textToEncode) ``` Header: `DLExtrasProcs.h:1886` Gets the Text of the QR code to be Encoded. **Parameters** - `params` ([`QREncodeParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#QREncodeParams)) - `textToEncode` ([`ASText *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): The text to be encoded **Returns:** `void` **See also:** [`PDDocQREncodeParamsSetTextToEncode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocQREncodeParamsSetTextToEncode) #### PDDocQREncodeParamsRelease ```cpp void PDDocQREncodeParamsRelease(QREncodeParams params) ``` Header: `DLExtrasProcs.h:1879` This will completely free the resources used by a QREncodeParams structure. **Parameters** - `params` ([`QREncodeParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#QREncodeParams)): the QREncodeParams to free. **Returns:** `void` **See also:** [`PDDocQREncodeParamsDefault`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocQREncodeParamsDefault) #### PDDocQREncodeParamsSetBackgroundColor ```cpp void PDDocQREncodeParamsSetBackgroundColor(QREncodeParams params, QRColor backgroundColor) ``` Header: `DLExtrasProcs.h:1956` Sets the Background Color of the QR code to be Encoded. **Parameters** - `params` ([`QREncodeParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#QREncodeParams)) - `backgroundColor` ([`QRColor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#QRColor)): The color of the Background of the barcode **Returns:** `void` **See also:** [`PDDocQREncodeParamsGetBackgroundColor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocQREncodeParamsGetBackgroundColor) #### PDDocQREncodeParamsSetCodeColor ```cpp void PDDocQREncodeParamsSetCodeColor(QREncodeParams params, QRColor codeColor) ``` Header: `DLExtrasProcs.h:1970` Sets the Code Color of the QR code to be Encoded. **Parameters** - `params` ([`QREncodeParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#QREncodeParams)) - `codeColor` ([`QRColor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#QRColor)): The color of the Code itself **Returns:** `void` **See also:** [`PDDocQREncodeParamsGetCodeColor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocQREncodeParamsGetCodeColor) #### PDDocQREncodeParamsSetErrorLevel ```cpp void PDDocQREncodeParamsSetErrorLevel(QREncodeParams params, QRErrorCorrectionLevel errorLevel) ``` Header: `DLExtrasProcs.h:1928` Sets the Error Correction Level of the QR code to be Encoded **Parameters** - `params` ([`QREncodeParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#QREncodeParams)) - `errorLevel` ([`QRErrorCorrectionLevel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#QRErrorCorrectionLevel)): The Error Correction Level **Returns:** `void` **See also:** [`PDDocQREncodeParamsGetErrorLevel`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocQREncodeParamsGetErrorLevel) #### PDDocQREncodeParamsSetPositionAndSize ```cpp void PDDocQREncodeParamsSetPositionAndSize(QREncodeParams params, ASDouble x, ASDouble y, ASDouble width, ASDouble height) ``` Header: `DLExtrasProcs.h:1914` Sets the Position and Size of the QR code to be Encoded. **Parameters** - `params` ([`QREncodeParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#QREncodeParams)) - `x` ([`ASDouble`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDouble)): The x location of the Code - `y` ([`ASDouble`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDouble)): The y location of the Code - `width` ([`ASDouble`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDouble)): The width of the Code - `height` ([`ASDouble`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASDouble)): The height of the Code **Returns:** `void` **See also:** [`PDDocQREncodeParamsGetPositionAndSize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocQREncodeParamsGetPositionAndSize) #### PDDocQREncodeParamsSetQuietZoneSize ```cpp void PDDocQREncodeParamsSetQuietZoneSize(QREncodeParams params, ASUns32 quietZoneSize) ``` Header: `DLExtrasProcs.h:1942` Sets the Size in pixels of the Quiet Zone on each side of the QR code to be Encoded. **Parameters** - `params` ([`QREncodeParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#QREncodeParams)) - `quietZoneSize` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)) **Returns:** `void` **See also:** [`PDDocQREncodeParamsGetQuietZoneSize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocQREncodeParamsGetQuietZoneSize) #### PDDocQREncodeParamsSetTextToEncode ```cpp void PDDocQREncodeParamsSetTextToEncode(QREncodeParams params, ASText textToEncode) ``` Header: `DLExtrasProcs.h:1894` Sets the Text of the QR code to be Encoded. **Parameters** - `params` ([`QREncodeParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#QREncodeParams)) - `textToEncode` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): The text to be encoded NOTE: If textToEncode has already been set to a ASText object, it will be released first. **Returns:** `void` **See also:** [`PDDocQREncodeParamsGetTextToEncode`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocQREncodeParamsGetTextToEncode) #### PDDocRemoveAttachment ```cpp void PDDocRemoveAttachment(PDDoc doc, char *attachmentNameToRemove) ``` Header: `DLExtrasProcs.h:1497` Removes a PDF attachment that matches the specified name. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN The PDF document object. - `attachmentNameToRemove` (`char *`): IN The attachment name to remove, this should be a null terminated string. **Returns:** `void` #### PDDocReplaceUnembeddedSimpleFonts ```cpp void PDDocReplaceUnembeddedSimpleFonts(PDDoc doc, ASAtom *currentFontNames, ASAtom *newFontNames, ASUns32 fontNamesLength) ``` Header: `DLExtrasProcs.h:853` NOTE: This method should only be used by advanced users. It is useful for applications that need to define precise font substitutions for unembedded fonts rather than relying on the PDF Viewer to find a suitable font on the local system. If you choose a new font replacement that is not similar to the font being replaced, in terms of encoding, metrics, and glyphs, your result may appear distorted or incorrect in a variety of ways. The user must take care when selecting a replacement font. This method replaces Simple (not Type 0 or Composite), Unembedded, non-subset Fonts with a different font. NOTE: Fonts that lack required dictionary entries (e.g. /FontDescriptor) will have default ones created. **Parameters** - `doc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN a PDDoc object (Required) - `currentFontNames` ([`ASAtom *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): IN The names of the fonts to be replaced (Required) - `newFontNames` ([`ASAtom *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom)): IN The names of the new fonts (Required) - `fontNamesLength` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): IN The number of current font names and the number of new font names (they have to be the same) (Required) **Returns:** `void` #### PDDocWillNeedIncrementalSave ```cpp ASBool PDDocWillNeedIncrementalSave(PDDoc pdDoc) ``` Header: `DLExtrasProcs.h:802` Determines if the document must be saved incrementally. **Parameters** - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): The document. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) If the document requires an Incremental save. #### PDDocumentOptimize ```cpp ASBool PDDocumentOptimize(PDDoc InputDoc, ASPathName OutputPath, ASFileSys fileSys, PDFOptimizationParams params, ProgressMonitor progMon, void *progMonClientData, ASCancelProc cancelProc, void *cancelProcClientData) ``` Header: `DLExtrasProcs.h:633` This function is used to create an optimized document. The types of Optimization performed depend on the optimization parameters. The result of optimization is a new document, saved to a file. **Parameters** - `InputDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN a PDDoc object (Required) - `OutputPath` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): IN an ASFilePath where the optimized document is to be written (Required) - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)) - `params` ([`PDFOptimizationParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDFOptimizationParams)) - `progMon` ([`ProgressMonitor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ProgressMonitor)) - `progMonClientData` (`void *`): IN An optional pointer to client data used by the progress monitor. - `cancelProc` ([`ASCancelProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCancelProc)): IN an optional pointer to a cancel procedure - `cancelProcClientData` (`void *`): IN an optional pointer to cancel proc client data **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) #### PDDocumentOptimizeWithReport ```cpp ASBool PDDocumentOptimizeWithReport(PDDoc InputDoc, ASPathName OutputPath, ASFileSys fileSys, PDFOptimizationParams params, ProgressMonitor progMon, void *progMonClientData, ASCancelProc cancelProc, void *cancelProcClientData, PDFOptimizerReport report) ``` Header: `DLExtrasProcs.h:834` This facility is used to create an optimized copy of the original document. Optimization can be in many specific forms, controlled by control records input to the optimizer. The result of optimization is always a new document, saved to a file. This is because some of the optimizations are done at Document save time. **Parameters** - `InputDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN a PDDoc object (Required) - `OutputPath` ([`ASPathName`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASPathName)): IN an ASFilePath where the optimized document is to be written (Required) - `fileSys` ([`ASFileSys`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASFileSys)) - `params` ([`PDFOptimizationParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDFOptimizationParams)) - `progMon` ([`ProgressMonitor`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ProgressMonitor)) - `progMonClientData` (`void *`): IN An optional pointer to client data used by the progress monitor - `cancelProc` ([`ASCancelProc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASCancelProc)): IN an optional pointer to a cancel procedure - `cancelProcClientData` (`void *`): IN an optiona pointer to cancel proc client data - `report` ([`PDFOptimizerReport`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDFOptimizerReport)): OUT an PDFOptimizerReport that will be filled by the method **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) ### Structures (5) #### PDDocTextFinder ```cpp typedef struct _t_PDDocTextFinder* PDDocTextFinder ``` Header: `DLExtrasExpT.h:395` Extracts words or phrases that match a regular expression (regex) on a given page range or on all of the pages in a document. #### PDDocTextFinderConfig ```cpp typedef struct PDDocTextFinderConfigRec * PDDocTextFinderConfig ``` Header: `DLExtrasExpT.h:404` #### PDFOptimizationParams ```cpp typedef struct _t_PDFOptimizationParamsRec* PDFOptimizationParams ``` Header: `DLExtrasExpT.h:253` An opaque type collecting together the PDFOptimizerOption parameters for PDDocumentOptimize. #### PDFOptimizerReport ```cpp typedef struct PDFOptimizerReportRec * PDFOptimizerReport ``` Header: `DLExtrasExpT.h:391` #### QRColor ```cpp typedef struct QRColorRec * QRColor ``` Header: `DLExtrasExpT.h:739` ### Enums (7) #### PDDocEmbedFontFlags Header: `DLExtrasExpT.h:50` Flags for PDDocEmbedFonts. **Values** - `kDocEmbedSubset = 0x01`: Fonts will be subset when embedded. Otherwise the entire font will be embedded. Full fonts should only be embedded if the information in the fonts indicates it can be used for editible embedding. Fonts that have more than 2048 characters will be subset embedded regardless of the setting of this flag. This flag implies a scan of the document text to ensure that all required characters are in the subset. - `kDocEmbedSubsetOfEmbeddedFont = 0x02`: If set, fonts that have already been embedded but are not subset fonts, will be reembedded as a subset font. If clear, already embedded fonts will not be re-scanned for embedding at all, subset or no. #### PDFOptimizationCompressQuality Header: `DLExtrasExpT.h:106` Compression quality options **Values** - `PDFOptimizerCompressQualityUnset = 0` - `PDFOptimizerCompressMinimum = 1` - `PDFOptimizerCompressLowQuality = 2` - `PDFOptimizerCompressMediumQuality = 3` - `PDFOptimizerCompressHighQuality = 4` - `PDFOptimizerCompressMaximumQuality = 5` - `PDFOptimizerCompressLossless = 6` #### PDFOptimizerCompressImageType Header: `DLExtrasExpT.h:117` Image types for PDFOptimizer compression **Values** - `PDFOptimizerColor = 1`: Compress colored images - `PDFOptimizerGray = 2`: Compress Gray scale Images - `PDFOptimizerMonochrome = 3`: Compress B/W images #### PDFOptimizerCompressionType Header: `DLExtrasExpT.h:84` types of compression for PDFOptimizer **Values** - `PDFOptimizerRecompressNone = 0`: Used only when original image is not compressed - `PDFOptimizerRecompressSame = 1`: Compress using the same compression - `PDFOptimizerRecompressFlate = 2`: Compress image using Flate - `PDFOptimizerRecompressJpeg = 3`: Compress image using Jpeg - `PDFOptimizerRecompressJP2k = 4`: Compress image using JPEG2000 - `PDFOptimizerRecompressJBig = 5`: Compress image using JBig2 - `PDFOptimizerRecompressCCITTG4 = 6`: Compress image using CCITTG4 - `PDFOptimizerRecompressCCITTG3 = 7`: Compress image using CCITTG3 - `PDFOptimizerRecompressFlateJpeg = 8`: Compress using Flate and Jpeg #### PDFOptimizerObjectCompressionType Header: `DLExtrasExpT.h:127` Object Compression types for PDFOptimizer **Values** - `PDFOptimizerObjectCompressionAll = 0`: Compress all objects. - `PDFOptimizerObjectCompressionNone = 1`: No object compression is used. - `PDFOptimizerObjectCompressionStructure = 2`: Compress objects related to Logical Structure of a document. - `PDFOptimizerObjectCompressionLeaveUnchanged = 3`: Leave object compression unchanged. #### PDFOptimizerOption Header: `DLExtrasExpT.h:143` PDFOptimizer Options **Values** - `PDFOptimizerDownsampleColor = 1`: Defaults to ON - `PDFOptimizerRecompressColor = 2`: Defaults to ON - `PDFOptimizerDownsampleGray = 3`: Defaults to ON - `PDFOptimizerRecompressGray = 4`: Defaults to ON - `PDFOptimizerDownsampleBW = 5`: Defaults to ON - `PDFOptimizerRecompressBW = 6`: Defaults to ON - `PDFOptimizerDownsampleRecompressOnlyIfSmaller = 7`: Defaults to ON - `PDFOptimizerDiscardAlternateImages = 8`: Defaults to ON - `PDFOptimizerSubsetAllEmbeddedFonts = 9`: Defaults to ON - `PDFOptimizerRemoveAllEmbeddedFonts = 10`: Defaults to OFF - `PDFOptimizerRemoveAllBase14Fonts = 11`: Defaults to ON - `PDFOptimizerMergeDuplicateFonts = 12`: Defaults to ON - `PDFOptimizerDiscardBookmarks = 13`: Defaults to OFF - `PDFOptimizerDiscardAcroforms = 14`: Defaults to OFF - `PDFOptimizerDiscardOutputIntent = 15`: Defaults to ON - `PDFOptimizerDiscardThumbnails = 16`: Defaults to ON - `PDFOptimizerDiscardPageLabels = 17`: Defaults to ON - `PDFOptimizerDiscardNameTrees = 18`: Defaults to ON - `PDFOptimizerDiscardStructureTrees = 19`: Defaults to ON - `PDFOptimizerDiscardFileAttachments = 20`: Defaults to ON - `PDFOptimizerDiscardXMPPadding = 21`: Defaults to ON Remove padding from XMP Metadata - `PDFOptimizerDiscardUnusedForms = 22`: Defaults to ON - `PDFOptimizerDiscardPieceData = 23`: Defaults to ON - `PDFOptimizerCompressStreams = 24`: Defaults to ON, indicates if Uncompressed Streams will be compressed when possible. - `PDFOptimizerReplaceLZW = 25`: Defaults to ON When set to false, the related option PDFOptimizerOptimizeContentStreams must also be disabled or Page /Contents that are LZW-compressed won't be affected. - `PDFOptimizerDiscardMetadata = 26`: Defaults to ON - `PDFOptimizerDiscardDocumentInfo = 27`: Defaults to ON - `PDFOptimizerOptimizeContentStreams = 28`: Defaults to ON, indicates if Page /Contents will be compressed when possible by removing redundancies and utilizing Flate compression. - `PDFOptimizerLinearize = 29`: Defaults to OFF - `PDFOptimizerDiscardDuplicateForms = 30`: Defaults to OFF - `PDFOptimizerDiscardDuplicateObjects = 31`: Defaults to ON - `PDFOptimizerDiscardASCIIFilters = 32`: Defaults to ON - `PDFOptimizerDiscardComments = 33`: Defaults to OFF, discards Markup Annotations - `PDFOptimizerDiscardAnnotations = 34`: Defaults to OFF, discards any Annotation besides Widgets - `PDFOptimizerDiscardJavaScriptActions = 35`: Defaults to OFF - `PDFOptimizerFlattenOptionalContent = 36`: Defaults to OFF - `PDFOptimizerResubsetSubsetFonts = 37`: Defaults to ON. The related option PDFOptimizerSubsetAllEmbeddedFonts must be Enabled for this option to have an effect. Fonts which are already Embedded Subset will be Re-subset. If the document being optimized represents an extraction of pages from a larger document, or if the document has been edited to remove Content, this can result in savings. NOTE: This can ONLY remove glyphs from an already subset font. It doesn't add missing glyphs. - `PDFOptimizerDownConvert16To8BpcImages = 38`: Defaults to ON - `PDFOptimizerDiscardUnusedImages = 39`: Defaults to ON - `PDFOptimizerDiscardUnusedFonts = 40`: Defaults to ON - `PDFOptimizerIncludeIndexedImages = 41`: Defaults to ON. Controls if Indexed images are eligible for compression and downsampling or not. When true, if possible, Indexed images are recompressed and/or downsampled. When false, Indexed images aren't recompressed or downsampled. - `PDFOptimizerDoNotPersistFileAttributes = 42`: Defaults to OFF - `PDFOptimizerDoNotConvertDeviceNImages = 43`: Defaults to OFF - `PDFOptimizerLastOption = 44` **See also:** [`PDDocOptimizeDefaultParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocOptimizeDefaultParams), [`PDDocumentOptimize`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocumentOptimize) #### QRErrorCorrectionLevel Header: `DLExtrasExpT.h:713` The Error Correction Level of the QR Code **Values** - `Low = 0`: Can tolerate 7% of bad codewords. - `Medium = 1`: Can tolerate 15% of bad codewords. - `Quartile = 2`: Can tolerate 25% of bad codewords. - `High = 3`: Can tolerate 30% of bad codewords. ## PDDocTextFinder ### Functions (5) #### PDDocTextFinderAcquireMatchList ```cpp PDDocTextFinderMatchList PDDocTextFinderAcquireMatchList(PDDocTextFinder mObj, PDDoc pdDoc, ASInt32 beginPageNumber, ASInt32 endPageNumber, const char *regexstr) ``` Header: `DLExtrasProcs.h:987` Finds all regular expression (regex) matches for the given page range. Only words within or partially within the page's crop box (see PDPageGetCropBox()) are included. Words outside the crop box are skipped. There can be only one match list in existence at a time; clients must release the previous match list, using PDDocTextFinderReleaseMatchList(), before creating a new one. Available only on Windows, Mac, and Linux platforms **Parameters** - `mObj` ([`PDDocTextFinder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocTextFinder)): IN (Required) The document text finder used to acquire the match list. - `pdDoc` ([`PDDoc`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDDoc)): IN (Required) The document to search for matches. - `beginPageNumber` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN (Required) The beginning page number from which to search. The first page is `0`, not `1` as designated in Acrobat. Pass PDAllPages (see PDExpT.h) to sequentially process all pages in the document. - `endPageNumber` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): IN (Required) The end page number from which to search to. If beginPageNumber is set to PDAllPages, this parameter is ignored. - `regexstr` (`const char *`) **Returns:** `PDDocTextFinderMatchList` **Exceptions** - `pdErrBadRegex` **See also:** [`PDDocTextFinderCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocTextFinderCreate), [`PDDocTextFinderReleaseMatchList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocTextFinderReleaseMatchList) #### PDDocTextFinderCreate ```cpp PDDocTextFinder PDDocTextFinderCreate(PDWordFinderConfig wfConfig) ``` Header: `DLExtrasProcs.h:919` Creates a document text finder that is used to extract words or phrases that match regular expressions from a PDF file based on words extracted using a given word finder configuration. Available only on Windows, Mac, and Linux platforms **Parameters** - `wfConfig` (`PDWordFinderConfig`): IN (Required) The word finder configuration to be used to extract the words. **Returns:** [`PDDocTextFinder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocTextFinder) **See also:** [`PDDocTextFinderDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocTextFinderDestroy), [`PDDocTextFinderAcquireMatchList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocTextFinderAcquireMatchList), [`PDDocTextFinderReleaseMatchList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocTextFinderReleaseMatchList), [`PDDocTextFinderCreateEx`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocTextFinderCreateEx) #### PDDocTextFinderCreateEx ```cpp PDDocTextFinder PDDocTextFinderCreateEx(PDWordFinderConfig wfConfig, PDDocTextFinderConfig dtfConfig) ``` Header: `DLExtrasProcs.h:937` Creates a document text finder with additional configurable properties. Available only on Windows, Mac, and Linux platforms **Parameters** - `wfConfig` (`PDWordFinderConfig`): IN (Required) The word finder configuration to be used to extract the words. - `dtfConfig` ([`PDDocTextFinderConfig`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocTextFinderConfig)): IN (Required) The document text finder configuration to be used to configure the extracted text. **Returns:** [`PDDocTextFinder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocTextFinder) **See also:** [`PDDocTextFinderDestroy`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocTextFinderDestroy), [`PDDocTextFinderAcquireMatchList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocTextFinderAcquireMatchList), [`PDDocTextFinderReleaseMatchList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocTextFinderReleaseMatchList), [`PDDocTextFinderCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocTextFinderCreate) #### PDDocTextFinderDestroy ```cpp void PDDocTextFinderDestroy(PDDocTextFinder mObj) ``` Header: `DLExtrasProcs.h:951` Destroys a document text finder. Use this when you are done extracting phrases in a file. Available only on Windows, Mac, and Linux platforms **Parameters** - `mObj` ([`PDDocTextFinder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocTextFinder)): IN (Required) The document text finder to destroy. **Returns:** `void` **See also:** [`PDDocTextFinderCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocTextFinderCreate) #### PDDocTextFinderReleaseMatchList ```cpp void PDDocTextFinderReleaseMatchList(PDDocTextFinder mObj) ``` Header: `DLExtrasProcs.h:1002` Releases the match list. Use this to release a list created by PDDocTextFinderAcquireMatchList() when you are done using this list. Available only on Windows, Mac, and Linux platforms **Parameters** - `mObj` ([`PDDocTextFinder`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocTextFinder)): IN (Required) A document text finder object. **Returns:** `void` **See also:** [`PDDocTextFinderCreate`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocTextFinderCreate), [`PDDocTextFinderAcquireMatchList`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDDocTextFinderAcquireMatchList) ## PDEContent ### Functions (2) #### PDEContentGetAttrsEx ```cpp void PDEContentGetAttrsEx(IN PDEContent pdeContent, OUT PDEContentAttrsExP attrsP, IN ASUns32 attrsSize) ``` Header: `PERProcs.h:3426` Obtains `PDEContentAttrsEx`, which gives matrix and bounding box in ASDouble Gets the attributes of a content. **Parameters** - `pdeContent` (`IN PDEContent`): IN/OUT A content object. - `attrsP` (`OUT PDEContentAttrsExP`): IN/OUT (Filled by the method) A pointer to a `PDEContentAttrsEx` structure containing the attributes of the content. - `attrsSize` (`IN ASUns32`): IN/OUT The size of the `attrsP` buffer in bytes. **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` #### PDEContentToCosObjEx ```cpp void PDEContentToCosObjEx(IN PDEContent pdeContent, IN ASUns32 flags, IN PDEContentAttrsExP attrs, IN ASUns32 attrsSize, IN CosDoc cosDoc, IN PDEFilterArrayP filtersP, OUT CosObj *contentsP, OUT CosObj *resourcesP) ``` Header: `PEWProcs.h:108` This is the same as PDEContentToCosObj, above, except that the Content Attributes are passed as `PDEContentAttrsEx`, so as to allow for ASDouble Matrices and Bounding Boxes **Parameters** - `pdeContent` (`IN PDEContent`) - `flags` (`IN ASUns32`) - `attrs` (`IN PDEContentAttrsExP`) - `attrsSize` (`IN ASUns32`) - `cosDoc` (`IN CosDoc`) - `filtersP` (`IN PDEFilterArrayP`) - `contentsP` (`OUT CosObj *`) - `resourcesP` (`OUT CosObj *`) **Returns:** `void` ## PDEFont ### Functions (1) #### PDEFontCheckASTextIsRepresentable ```cpp ASBool PDEFontCheckASTextIsRepresentable(const PDEFont font, const ASText text, ASUns32 *index) ``` Header: `DLExtrasProcs.h:338` Routine to check that the entire contents of an ASText are representable in the font. If the index parameter is not NULL and this function returns FALSE, the index will indicate the first character not representable in the font. An exception will be raised if the supplied font is incompatible with the API. Such may happen, for example, if font is a Type 1 font or if the font is retrieved from an existing PDF document. **Parameters** - `font` ([`const PDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFont)): The PDEFont to check against. Its type must be 'Type0' or 'TrueType'. - `text` ([`const ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): An ASText containing the text to check - `index` ([`ASUns32 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The index of the first character in the Unicode representation of the string that could not be represented in the font. May be NULL if the user wants to ignore this information. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) Whether the ASText is representable or not using the font. ## PDEForm ### Functions (7) #### PDEFormCalcBBox ```cpp void PDEFormCalcBBox(PDEForm form) ``` Header: `DLExtrasProcs.h:616` This function allows the BBox stored in a form's XObject to be recalculated after its contents have been modified. The bounding box of a form is set in the COS form, and is usually not changed by any event in the conversions between PDE and COS content. This is done so that the user may set the bounding box of a form so as to specifically clip its contents to a given path (the bounding box). Sometimes the content of a form is changed, and then the user may want to reset the form's bounding box to the size of the current content. **Parameters** - `form` ([`PDEForm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEForm)): the PDEForm whose BBox should be recalculated. **Returns:** `void` #### PDEFormGetFont ```cpp PDEFont PDEFormGetFont(PDEForm form) ``` Header: `DLExtrasProcs.h:558` This retrieves the PDEFont referenced in a PDEForm. **Parameters** - `form` ([`PDEForm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEForm)): The PDEForm of interest **Returns:** [`PDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFont) **See also:** [`PDEFormSetFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDEFormSetFont) #### PDEFormGetName ```cpp ASAtom PDEFormGetName(IN PDEForm form) ``` Header: `DLExtrasProcs.h:1014` Reserved for Internal Use. **Parameters** - `form` (`IN PDEForm`) **Returns:** [`ASAtom`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASAtom) #### PDEFormGetTextState ```cpp void PDEFormGetTextState(IN PDEForm form, OUT PDETextState *tState) ``` Header: `PERProcs.h:3389` Gets the `PDETextState` for a form. **Parameters** - `form` (`IN PDEForm`): IN The form whose Cos object is obtained. - `tState` (`OUT PDETextState *`) **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` #### PDEFormSetContentEx ```cpp void PDEFormSetContentEx(IN PDEForm form, IN PDEContent content) ``` Header: `DLExtrasProcs.h:1106` Reserved for Internal Use. **Parameters** - `form` (`IN PDEForm`) - `content` (`IN PDEContent`) **Returns:** `void` #### PDEFormSetFont ```cpp void PDEFormSetFont(PDEForm form, PDEFont font) ``` Header: `DLExtrasProcs.h:565` This sets the PDEFont referenced in a PDEForm. **Parameters** - `form` ([`PDEForm`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEForm)): The PDEForm of interest. - `font` ([`PDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFont)): The PDEFont to be set. **Returns:** `void` **See also:** [`PDEFormGetFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDEFormGetFont) #### PDEFormSetTextState ```cpp void PDEFormSetTextState(IN PDEForm form, IN PDETextState *tState) ``` Header: `PERProcs.h:3398` Sets the `PDETextState` for a form. **Parameters** - `form` (`IN PDEForm`): IN The form whose Cos object is obtained. - `tState` (`IN PDETextState *`) **Returns:** `void` **Exceptions** - `peErrWrongPDEObjectType` ## PDEGraphicFont ### Functions (1) #### PDEGraphicFontGetPDEFont ```cpp PDEFont PDEGraphicFontGetPDEFont(IN PDEGraphicFont font) ``` Header: `DLExtrasProcs.h:1008` Reserved for Internal Use. **Parameters** - `font` (`IN PDEGraphicFont`) **Returns:** [`PDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFont) ## PDEImage ### Functions (2) #### PDEImageGetColorValue ```cpp void PDEImageGetColorValue(IN PDEImage image, IN PDEColorValueP color) ``` Header: `PERProcs.h:3364` Gets an image's Color Value. This call is valid only for a PDEImage which is an Image Mask **Parameters** - `image` (`IN PDEImage`): IN/OUT The image whose data is obtained. - `color` (`IN PDEColorValueP`) **Returns:** `void` **Exceptions** - `peErrUnknownPDEColorSpace` - `genErrBadParm` - `peErrWrongPDEObjectType` #### PDEImageRemoveIndexedColor ```cpp PDEImage PDEImageRemoveIndexedColor(PDEImage image) ``` Header: `DLExtrasProcs.h:786` If the image input uses an indexed color space, a new image will be created from it. The new image will use the base color space. If the image is not using an indexed color model, the original image will be incremented and returned. **Note:** The image returned must be released when no longer needed. **Parameters** - `image` ([`PDEImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage)): The Indexed image `inP`. **Returns:** [`PDEImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage) The new image or the original image. ## PDEImageJPX ### Functions (1) #### PDEImageJPXGetSMask ```cpp PDEImage PDEImageJPXGetSMask(PDEImageJPX pdeImageJPX) ``` Header: `DLExtrasProcs.h:1507` Retrieves the SoftMask image contained within the JPX-encoded data. **Parameters** - `pdeImageJPX` ([`PDEImageJPX`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImageJPX)): IN The JP2K encoded image object. NOTE: The returned PDEImage must be released using PDERelease() when done using it. **Returns:** [`PDEImage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEImage) The PDEImage representing the Soft Mask image of the JPX-encoded data if one is present, otherwise NULL. ## PDEPS ### Functions (1) #### PDEPSGetCosObj ```cpp void PDEPSGetCosObj(IN PDEPS ps, OUT CosObj *cosObjP) ``` Header: `DLExtrasProcs.h:421` Get the CosObj for a Postscript Passthrough. **Parameters** - `ps` (`IN PDEPS`): IN The PostScript XObject whose Cos object is obtained. - `cosObjP` (`OUT CosObj *`): OUT The Cos object of the PostScript XObject. **Returns:** `void` ## PDEPath ### Functions (4) #### PDEPathGetDataDouble ```cpp ASUns32 PDEPathGetDataDouble(IN PDEPath path, OUT ASDouble *data, IN ASUns32 dataSize) ``` Header: `DLExtrasProcs.h:1100` Gets the size of the path data. **Parameters** - `path` (`IN PDEPath`): IN The path whose data is obtained. - `data` (`OUT ASDouble *`): OUT A pointer to the path data. If `data` is non-`NULL`, it contains a variable-sized array of path operators and operands. The format is a 32-bit operator followed by 0 to 3 ASDouble values, depending on the operator. Opcodes are codes for `moveto`, `lineto`, `curveto`, `rect`, or `closepath` operators; operands are ASDouble values. If `data` is `NULL`, the number of bytes required for `data` is returned by the method. Note that it returns *raw* path data. If you want the points in page coordinates, concatenate the path data points with the PDEElement matrix obtained from PDEElementGetMatrix(). - `dataSize` (`IN ASUns32`): IN Specifies the size of the buffer provided in data. If it is less than the length of the path data, the method copies `dataSize` bytes.`path`. **Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32) #### PDEPathGetDataFloat ```cpp ASUns32 PDEPathGetDataFloat(IN PDEPath path, OUT ASFloat *data, IN ASUns32 dataSize) ``` Header: `PERProcs.h:3407` Superseded by PDEPathGetDataEx(). Get path using float-point values for coordinate values. This effectively removes the PDEPathGetData implementation limit that path coordinate values need to be no larger than +/-32767.0. **Parameters** - `path` (`IN PDEPath`) - `data` (`OUT ASFloat *`) - `dataSize` (`IN ASUns32`) **Returns:** [`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32) #### PDEPathSetDataDouble ```cpp void PDEPathSetDataDouble(IN PDEPath path, IN ASDouble *data, IN ASUns32 dataSize) ``` Header: `DLExtrasProcs.h:1081` Sets the size of the path data. **Parameters** - `path` (`IN PDEPath`): IN The path whose data is set. - `data` (`IN ASDouble *`): IN A pointer to the path data. It is a variable-sized array of path operators and operands. The format is a 32-bit operator followed by zero to three ASDouble values, depending on the operator. Operators are codes for `moveto`, `lineto`, `curveto`, `rect`, or `closepath` operators, and must be one of PDEPathElementType. Operands are ASDouble values. The data is copied into the PDEPath object. - `dataSize` (`IN ASUns32`): IN The size of the new path data in bytes. **Returns:** `void` #### PDEPathSetDataFloat ```cpp void PDEPathSetDataFloat(IN PDEPath path, IN ASFloat *data, IN ASUns32 dataSize) ``` Header: `PEWProcs.h:3837` Superseded by PDEPathSetDataEx(). Set path using floats for pdfs that use larger values than will fit in ASFixed/ASInt32. **Parameters** - `path` (`IN PDEPath`) - `data` (`IN ASFloat *`) - `dataSize` (`IN ASUns32`) **Returns:** `void` ## PDEText ### Functions (2) #### PDETextAddASText ```cpp void PDETextAddASText(PDEText pdeText, ASUns32 flags, ASInt32 index, ASText text, PDEFont font, PDEGraphicStateP gstateP, ASUns32 gstateLen, PDETextStateP tstateP, ASUns32 tstateLen, ASFixedMatrixP textMatrixP) ``` Header: `DLExtrasProcs.h:363` Adds a character or a text run to a PDEText object, taking them from the ASText; thus Unicode characters can be placed in the PDEText. This function will accept characters that are not representable in the given font; such characters will be replaced with the .notdef glyph. An exception will be raised if the supplied font is incompatible with the API. Such may happen, for example, if font is a Type 1 font or if the font is retrieved from an existing PDF document. **Parameters** - `pdeText` ([`PDEText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEText)): The text object to which a character or text run is added. - `flags` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): A PDETextFlags that specifies what kind of text to add. - `index` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The index after which to add the character or text run. - `text` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): An ASText containing the text to add - `font` ([`PDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFont)): The PDEFont for the element. Its type must be 'Type0' or 'TrueType'. - `gstateP` (`PDEGraphicStateP`): A pointer to a PDEGraphicStateP structure with the graphics state for the element. - `gstateLen` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The length of the graphics state for the element. - `tstateP` (`PDETextStateP`): A pointer to a `PDETextState` structure with the text state for the element. - `tstateLen` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The length of the text state for the element. - `textMatrixP` (`ASFixedMatrixP`): A pointer to an `ASFixedMatrix` that holds the matrix for the element. **Returns:** `void` **See also:** [`PDEFontCheckASTextIsRepresentable`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDEFontCheckASTextIsRepresentable), [`PDETextGetASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDETextGetASText) #### PDETextGetASText ```cpp void PDETextGetASText(PDEText pdeText, ASUns32 flags, ASInt32 index, ASText text) ``` Header: `DLExtrasProcs.h:412` Gets the text for a text run or character. The PDEFont associated with the PDEText must contain a ToUnicode table unless the descendant CIDFont uses the Adobe-GB1, Adobe-CNS1, Adobe-Japan1, or Adobe-Korea1 character collection. **Parameters** - `pdeText` ([`PDEText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEText)): A text object containing a character or text run whose text is found - `flags` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): A PDETextFlags that specifies whether index refers to a character or a text run. - `index` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The index of the character or text run in pdeText - `text` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): An ASText that is filled with the text from the text item **Returns:** `void` **See also:** [`PDETextAddASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDETextAddASText) ## PDETextItem ### Functions (2) #### PDETextItemCopyASText ```cpp void PDETextItemCopyASText(PDETextItem textItem, ASText text) ``` Header: `DLExtrasProcs.h:396` Copies the text from a text item element into an ASText. The PDEFont associated with the PDEText must contain a ToUnicode table. **Parameters** - `textItem` ([`PDETextItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItem)): The text item from which the text will be copied - `text` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): An ASText object that is filled in with the text from the text item. **Returns:** `void` **See also:** [`PDETextItemCreateASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDETextItemCreateASText) #### PDETextItemCreateASText ```cpp PDETextItem PDETextItemCreateASText(ASText text, PDEFont font, PDEGraphicStateP gStateP, ASUns32 gStateLen, PDETextStateP textStateP, ASUns32 textStateLen, ASFixedMatrixP textMatrixP) ``` Header: `DLExtrasProcs.h:385` Creates a text element containing a character or text run which can be added to a PDEText object. This function will accept characters that are not representable in the given font; such characters will be replaced with the .notdef glyph. An exception will be raised if the supplied font is incompatible with the API. Such may happen, for example, if font is a Type 1 font or if the font is retrieved from an existing PDF document. **Parameters** - `text` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): An ASText containing the text to add. Note that passing an ASText containing an empty string will throw a genErrBadParm. - `font` ([`PDEFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDEFont)): The PDEFont for the element. Its type must be 'Type0' or 'TrueType'. - `gStateP` (`PDEGraphicStateP`): A pointer to a PDEGraphicStateP structure with the graphics state for the element. - `gStateLen` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The length of the graphics state for the element. - `textStateP` (`PDETextStateP`): A pointer to a `PDETextState` structure with the text state for the element. Note that PDFEdit ignores the wasSetFlags flag of the `PDETextState` structure, so you must initialize the `PDETextState` fields. - `textStateLen` ([`ASUns32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns32)): The length of the text state for the element. - `textMatrixP` (`ASFixedMatrixP`): A pointer to an `ASFixedMatrix` that holds the matrix for the element. **Returns:** [`PDETextItem`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdelayer.md#PDETextItem) **Exceptions** - `genErrBadParm` **See also:** [`PDETextItemCopyASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDETextItemCopyASText) ## PDFileAttachment ### Functions (2) #### PDFileAttachmentGetAFRelationship ```cpp ASBool PDFileAttachmentGetAFRelationship(PDFileAttachment attachment, AFRelationship *relationship) ``` Header: `DLExtrasProcs.h:1979` Gets the Associated Files Relationship of the FileAttachment **Parameters** - `attachment` ([`PDFileAttachment`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileAttachment)): IN a PDFileAttachment object. - `relationship` ([`AFRelationship *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#AFRelationship)): The AFRelationship found **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) if True, the AFRelationship was successfully found. NOTE: Since PDF 2.0 **See also:** [`PDFileAttachmentSetAFRelationship`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDFileAttachmentSetAFRelationship) #### PDFileAttachmentSetAFRelationship ```cpp void PDFileAttachmentSetAFRelationship(PDFileAttachment attachment, AFRelationship relationship) ``` Header: `DLExtrasProcs.h:1987` Sets the Associated Files Relationship of the FileAttachment to the specified value **Parameters** - `attachment` ([`PDFileAttachment`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFileAttachment)): IN a PDFileAttachment object to be modified. - `relationship` ([`AFRelationship`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#AFRelationship)): The AFRelationship to be set **Returns:** `void` **See also:** `PDFileAttachmentGetAFRelationship NOTE: Since PDF 2.0` ### Enums (1) #### AFRelationship Header: `DLExtrasExpT.h:745` Represents the relationship between the component of the PDF document that refers to this attachment and the file denoted by the attachment **Values** - `Source = 0`: Original source material. - `Data = 1`: Information used to derive a visual presentation, e.g. table or graph. - `Alternative = 2`: Alternative representation of content, e.g. audio. - `Supplement = 3`: Supplemental representation of the original source or data that may be more easily consumable. - `EncryptedPayload = 4`: Encrypted payload document that should be displayed if the Processor has the cryptographic filter needed to decrypt it. - `FormData = 5`: Data associated with the AcroForm. - `Schema = 6`: Schema definition for the associated object. - `UnspecifiedOrUnknown = 7`: Relationship is not known or can't be described using of the other values. ## PDFont ### Functions (1) #### PDFontXlateToUCSCanRaise ```cpp ASInt32 PDFontXlateToUCSCanRaise(PDFont fontP, ASUns8 *inP, ASInt32 inLen, ASUns8 *outP, ASInt32 outLen) ``` Header: `DLExtrasProcs.h:773` Translates a string from whatever encoding the PDFont uses to Unicode encoding. This may raise an error. **Parameters** - `fontP` ([`PDFont`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFont)): The font of the input string `inP`. - `inP` ([`ASUns8 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns8)): A pointer to the string to translate. - `inLen` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The length of the `inP` buffer in bytes. - `outP` ([`ASUns8 *`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASUns8)): (Filled by the method) A pointer to the translated string. If it is `NULL`, the method returns the size of the translated string. - `outLen` ([`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32)): The length of the `outP` buffer in bytes. If it is `0`, the method returns the size of the translated string. **Returns:** [`ASInt32`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt32) The number of bytes in the translated string in `outP`. **Exceptions** - `An`: genErrBadParm can be raised. **See also:** [`PDFontXlateToUCS`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDFontXlateToUCS) ## PDPage ### Functions (8) #### PDPageAddQRBarcode ```cpp ASBool PDPageAddQRBarcode(PDPage page, ASText textToEncode, double x, double y, double width, double height) ``` Header: `DLExtrasProcs.h:1266` Add a QR Two-Dimensional Barcode encoded with the specified Text to the specified PDF page as an image. **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page of the PDF document. - `textToEncode` ([`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText)): The Text to be encoded in the barcode - `x` (`double`): The horizontal location on the page in points - `y` (`double`): The vertical location on the page in points - `width` (`double`): The width of the barcode image in points - `height` (`double`): The height of the barcode image in points NOTE: The Error Correction Level is set to Medium. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) #### PDPageAddQRBarcodeEx ```cpp ASBool PDPageAddQRBarcodeEx(PDPage page, QREncodeParams params) ``` Header: `DLExtrasProcs.h:1856` Add a QR Two-Dimensional Barcode encoded with the specified Params to the specified PDF page as an image. **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page of the PDF document. - `params` ([`QREncodeParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#QREncodeParams)): The Params specified how to encode the barcode **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) #### PDPageDrawContentsToMemoryWithParams ```cpp ASSize_t PDPageDrawContentsToMemoryWithParams(PDPage page, PDPageDrawMParams drawParams) ``` Header: `DLExtrasProcs.h:49` Renders a page to memory. For use in rasterizing pages for viewing or previewing. This call supports the same rasterization parameters as PDPageDrawContentsToMemory, and also allows users to specify these additional arguments: • The destination rectangle (in ASFixed or ASReal notation) • The update rectangle (in ASFixed notation) • The transformation matrix (in ASFixed or ASReal notation) • The colorspace to use, as a named colorspace or as a color profile • The rendering intent to use for rendering • A request to ignore restrictions on content copying & page extraction • Default profile for uncalibrated RGB **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The PDPage to be rendered. - `drawParams` (`PDPageDrawMParams`): Set of parameters describing how to rasterize the supplied PDPage, rasterizing the PDPage into a memory buffer supplied in the parameter set. **Returns:** [`ASSize_t`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASSize_t) the size of the buffer required to rasterize the PDPage if the buffer is not supplied and the length of the buffer is specified as `0`. **See also:** [`PDPageDrawContentsToMemory`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdfllayer.md#PDPageDrawContentsToMemory), [`PDPageDrawContentsToWindowWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDPageDrawContentsToWindowWithParams) #### PDPageDrawContentsToMemoryWithParams ```cpp ASSize_t PDPageDrawContentsToMemoryWithParams(PDPage page, PDPageDrawMParams drawParams) ``` Header: `PDPageDrawM.h:257` **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)) - `drawParams` (`PDPageDrawMParams`) **Returns:** [`ASSize_t`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASSize_t) #### PDPageDrawContentsToWindowWithParams ```cpp void PDPageDrawContentsToWindowWithParams(PDPage page, PDPageDrawWParams drawParams) ``` Header: `DLExtrasProcs.h:68` Renders a page to a (platform-dependent) window. For use in rasterizing pages for viewing or previewing. This API accepts a structure of type PDPageDrawWParams, which includes a set of ASReal-based values in the same manner as PDPageDrawContentsToMemoryWithParams. It is intended to address overflow or underflow issues with the ASFixed-based drawing APIs when rendering a page to a window object. **Note:** Platform: (!MAC_PLATFORM || (MAC_PLATFORM && !AS_ARCH_64BIT)) **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The PDPage to be rendered. - `drawParams` (`PDPageDrawWParams`): Set of parameters describing how to rasterize the supplied PDPage to a platform-dependent window object. **Returns:** `void` **See also:** [`PDPageDrawContentsToMemoryWithParams`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDPageDrawContentsToMemoryWithParams) #### PDPageDrawContentsToWindowWithParams ```cpp void PDPageDrawContentsToWindowWithParams(PDPage page, PDPageDrawWParams drawParams) ``` Header: `PDPageDrawM.h:262` **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)) - `drawParams` (`PDPageDrawWParams`) **Returns:** `void` #### PDPageEnumInksWithParams ```cpp void PDPageEnumInksWithParams(PDPage Page, PDPageEnumInksParam Params) ``` Header: `DLExtrasProcs.h:757` Enumerates the inks for a page, using the supplied options specified in the parameters. **Parameters** - `Page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The page of interest. - `Params` ([`PDPageEnumInksParam`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDPageEnumInksParam)): The parameters describing options for enumerating inks. **Returns:** `void` #### PDPageSetBlendingProfile ```cpp void PDPageSetBlendingProfile(PDPage page, AC_Profile profile) ``` Header: `DLExtrasProcs.h:508` This function sets the blending profile for a PD page for the duration of of the PDPage. Effectively, this creates an isolated page level, a non-knockout transparency group with the specified profile for the page. This apparent group will be used in rendering the page, but it is not preserved when the document is saved. In order to create a persistent transparency group, the user must add a "Group" entry to the page dictionary. **Parameters** - `page` ([`PDPage`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPage)): The PDPage to be rendered. - `profile` ([`AC_Profile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/acrocolor.md#AC_Profile)): The color blending profile to be used when rendering. **Returns:** `void` ### Structures (1) #### PDPageEnumInksParam ```cpp typedef struct PDPageEnumInksParamRec * PDPageEnumInksParam ``` Header: `DLExtrasExpT.h:280` ### Enums (1) #### PDPageDeleteFlags Header: `DLExtrasExpT.h:436` Page Deletion Flags. **Values** - `PDDeleteNormal = 1`: Normal page deletion. - `PDDeleteDoNotParseStructureTree = 2`: Do not parse Structure Tree. For documents with a complicated Structure Tree, parsing can be exhorbitantly slow, set this flag to bypass processing it. ## PDPref ### Functions (17) #### PDPrefGetAllowOpeningXFA ```cpp ASBool PDPrefGetAllowOpeningXFA(void) ``` Header: `DLExtrasProcs.h:293` Routine to get the current allow-XFA setting. **Parameters** - (unnamed) (`void`) **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) true if opening XFA PDFs is allowed. **See also:** [`PDPrefGetAllowOpeningXFA`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDPrefGetAllowOpeningXFA) #### PDPrefGetAllowRelaxedSyntax ```cpp ASBool PDPrefGetAllowRelaxedSyntax(void) ``` Header: `DLExtrasProcs.h:493` Returns the current value of the AllowRelaxedSyntax flag setting. **Parameters** - (unnamed) (`void`) **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) if True, the Library will attempt to resolve or ignore certain minor PDF syntax errors. **See also:** [`PDPrefSetAllowRelaxedSyntax`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDPrefSetAllowRelaxedSyntax) #### PDPrefGetAllowStringRetrievalFailingDecryption ```cpp ASBool PDPrefGetAllowStringRetrievalFailingDecryption(void) ``` Header: `DLExtrasProcs.h:881` Returns the current value of the AllowStringRetrievalFailingDecryption flag setting. **Parameters** - (unnamed) (`void`) **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) **See also:** [`PDPrefSetAllowStringRetrievalFailingDecryption`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDPrefSetAllowStringRetrievalFailingDecryption) #### PDPrefGetDefaultIntentToProfile ```cpp ASBool PDPrefGetDefaultIntentToProfile(void) ``` Header: `DLExtrasProcs.h:476` This function returns the current status of the default source intent used in a color profile. **Parameters** - (unnamed) (`void`) **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) If true, the intent to be used shall be the intent specified in the profile; otherwise AC_RelColorimetric will be assumed. **See also:** [`PDPrefSetDefaultIntentToProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDPrefSetDefaultIntentToProfile) #### PDPrefGetNeverUseOutputIntent ```cpp ASBool PDPrefGetNeverUseOutputIntent(void) ``` Header: `DLExtrasProcs.h:586` This function returns whether that the output intent should be completely ignored when rendering a document. **Note:** This setting defaults to false. **Parameters** - (unnamed) (`void`) **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) If true, the OutputIntent will not be used when rendering even for PDF/A, PDF/E, or PDF/X documents. **See also:** [`PDPrefSetPrintUsingWorkingSpaces`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDPrefSetPrintUsingWorkingSpaces), [`PDPrefGetUseOutputIntents`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPrefGetUseOutputIntents) #### PDPrefGetPrintUsingWorkingSpaces ```cpp ASBool PDPrefGetPrintUsingWorkingSpaces(void) ``` Header: `DLExtrasProcs.h:534` This function returns whether the device spaces are treated as calibrated when rendering. **Note:** This setting is only effective when the document is being rendered to memory, or a window, and kPDPageIsPrinting is true. **Parameters** - (unnamed) (`void`) **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) if true, treats device spaces as calibrated to the associated working space profile. Otherwise, treats device spaces as uncalibrated **See also:** [`PDPrefSetPrintUsingWorkingSpaces`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDPrefSetPrintUsingWorkingSpaces) #### PDPrefGetStrictFormEmission ```cpp ASBool PDPrefGetStrictFormEmission(void) ``` Header: `DLExtrasProcs.h:1033` Returns the current value of the PDPrefGetStrictFormEmission flag setting. **Parameters** - (unnamed) (`void`) **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) **See also:** [`PDPrefGetStrictFormEmission`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDPrefGetStrictFormEmission) #### PDPrefSetAllowOpeningXFA ```cpp void PDPrefSetAllowOpeningXFA(ASBool flag) ``` Header: `DLExtrasProcs.h:285` Routine to allow APDFL to open XFA PDF documents, which as of 9.1P2f is disallowed. **Parameters** - `flag` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): True will allow APDFL to open XFA PDF documents. **Returns:** `void` **See also:** [`PDPrefGetAllowOpeningXFA`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDPrefGetAllowOpeningXFA) #### PDPrefSetAllowRelaxedSyntax ```cpp void PDPrefSetAllowRelaxedSyntax(ASBool flag) ``` Header: `DLExtrasProcs.h:487` This call, with a True flag value, allows callers to ask Adobe PDF Library to attempt to ignore minor PDF syntax errors. For example, the Library may correct FontDescriptor entries with missing values by adding defaults, add a missing Supplement for Adobe Identity, or add a missing /FirstChar or /LastChar entry if the other of the pair is present, along with a valid Widths table). **Parameters** - `flag` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): When true, this will tell the PDF Library to ignore certain minor PDF document errors. **Returns:** `void` **See also:** [`PDPrefGetAllowRelaxedSyntax`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDPrefGetAllowRelaxedSyntax) #### PDPrefSetAllowStringRetrievalFailingDecryption ```cpp void PDPrefSetAllowStringRetrievalFailingDecryption(ASBool allowStringRetrievalFailingDecryption) ``` Header: `DLExtrasProcs.h:872` This call is used to retrive the value of String objects using an Encryption that's not supported by the Library in order to still retrieve the String's value. This is useful to Advanced Users who know how to interpret the String data when advanced Encryption is in use. **Parameters** - `allowStringRetrievalFailingDecryption` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)) **Returns:** `void` **See also:** [`PDPrefGetAllowStringRetrievalFailingDecryption`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDPrefGetAllowStringRetrievalFailingDecryption) #### PDPrefSetDefaultIntentToProfile ```cpp void PDPrefSetDefaultIntentToProfile(ASBool flag) ``` Header: `DLExtrasProcs.h:468` When this preference is set to true, the intent used (when no other intent is explicitly specified) will be the intent specified in the profile. Otherwise AC_RelColorimetric will be assumed by default. **Parameters** - `flag` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): If true, use intent specified in the profile. **Returns:** `void` **See also:** [`PDPrefGetDefaultIntentToProfile`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDPrefGetDefaultIntentToProfile) #### PDPrefSetNeverUseOutputIntent ```cpp void PDPrefSetNeverUseOutputIntent(ASBool value) ``` Header: `DLExtrasProcs.h:596` This function sets a flag to specify that the output intent should not be considered when rendering a document. This overrides the default behavior of the preference set with PDPrefSetUseOutputIntents. The PDPrefSetUseOutputIntents may still use the OutputIntent in spite of being set to false, if the document purports to be PDF/A, PDF/E, or PDF/X. **Note:** This setting defaults to false. **Parameters** - `value` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): if true, the OutputIntent will not be used when rendering even for PDF/A, PDF/E, or PDF/X documents. **Returns:** `void` **See also:** [`PDPrefGetPrintUsingWorkingSpaces`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDPrefGetPrintUsingWorkingSpaces), [`PDPrefSetUseOutputIntents`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDPrefSetUseOutputIntents) #### PDPrefSetPrintUsingWorkingSpaces ```cpp void PDPrefSetPrintUsingWorkingSpaces(ASBool flag) ``` Header: `DLExtrasProcs.h:525` This function sets a flag to treat the device spaces as calibrated when rendering. **Note:** This setting is only effective when the document is being rendered to memory, or a window, and kPDPageIsPrinting is true. **Parameters** - `flag` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): if true, treats device spaces as calibrated to the associated working space profile. Otherwise, treats device spaces as uncalibrated **Returns:** `void` **See also:** [`PDPrefGetPrintUsingWorkingSpaces`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDPrefGetPrintUsingWorkingSpaces) #### PDPrefSetStrictFormEmission ```cpp void PDPrefSetStrictFormEmission(ASBool strictFormEmission) ``` Header: `DLExtrasProcs.h:1024` This call is used to allow user to set strictFormEmission. **Parameters** - `strictFormEmission` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)) **Returns:** `void` **See also:** [`PDPrefSetStrictFormEmission`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDPrefSetStrictFormEmission) #### PDPrefSuppressDefaultCMYKCalibration ```cpp void PDPrefSuppressDefaultCMYKCalibration(ASBool flag) ``` Header: `DLExtrasProcs.h:264` Routine to suppress the Adobe-defined default color profile used for DeviceCMYK specified object. If a default color space is defined in the document resources, or via PDEContentSetDefault, it will still be used. **Parameters** - `flag` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): True will suppress the Adobe-defined default color profile. **Returns:** `void` **See also:** [`PDPrefSuppressDefaultGrayCalibration`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDPrefSuppressDefaultGrayCalibration), [`PDPrefSuppressDefaultRGBCalibration`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDPrefSuppressDefaultRGBCalibration) #### PDPrefSuppressDefaultGrayCalibration ```cpp void PDPrefSuppressDefaultGrayCalibration(ASBool flag) ``` Header: `DLExtrasProcs.h:276` Routine to suppress the Adobe-defined default color profile used for DeviceGray specified object. If a default color space is defined in the document resources, or via PDEContentSetDefault, it will still be used. **Parameters** - `flag` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): True will suppress the Adobe-defined default color profile. **Returns:** `void` **See also:** [`PDPrefSuppressDefaultCMYKCalibration`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDPrefSuppressDefaultCMYKCalibration), [`PDPrefSuppressDefaultRGBCalibration`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDPrefSuppressDefaultRGBCalibration) #### PDPrefSuppressDefaultRGBCalibration ```cpp void PDPrefSuppressDefaultRGBCalibration(ASBool flag) ``` Header: `DLExtrasProcs.h:252` Routine to suppress the Adobe-defined default color profile used for DeviceRGB specified object. If a default color space is defined in the document resources, or via PDEContentSetDefault, it will still be used. **Parameters** - `flag` ([`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool)): True will suppress the Adobe Defined Default Color Profile. **Returns:** `void` **See also:** `PDPrefSuppressDefaultYKCalibration`, [`PDPrefSuppressDefaultGrayCalibration`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/dlextras.md#PDPrefSuppressDefaultGrayCalibration) ## PDSysFont ### Functions (1) #### PDSysFontGetFullName ```cpp ASText PDSysFontGetFullName(PDSysFont sysFont) ``` Header: `DLExtrasProcs.h:861` This method retrieves the full font name of a system font. Note: This method only returns a meaningful result for TrueType-based technology fonts. **Parameters** - `sysFont` (`PDSysFont`) **Returns:** [`ASText`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASText) ### Enums (1) #### PDSysFontMatchFlagsEx Header: `DLExtrasExpT.h:576` Font matching flags for PDFindSysFont(). **Values** - `kPDSysFontMatchNameAndCharSetEx = 0x0001`: Match the font name and character set. - `kPDSysFontMatchFontTypeEx = 0x0002`: Match the font type. - `kPDSysFontMatchWritingModeEx = 0x0004`: Match the writing mode (horizontal or vertical). - `kPDSysFontDontUseNameAsPrefixEx = 0x0008`: The Legacy behavior of System Font Matching is when all conventional attempts have failed to yield a match to treat the entire font name as a prefix to match with available fonts. This behavior worked well for names with illegal characters or Unicode where matching is difficult, the user could provide the well-known part of the font name. However this prefix matching behavior isn't always desirable, using this flag will disable it ## PDWord ### Functions (3) #### PDWordGetCharPoint ```cpp ASBool PDWordGetCharPoint(PDWord word, ASInt16 byteIdx, ASFixedPoint *point) ``` Header: `DLExtrasProcs.h:106` Gets the placement point of the character at a given index position in the word. If the specified character is constructed with multiple bytes, only the first byte returns a valid quad. Otherwise, this method returns false. The placement point is specified in user space coordinates. **Parameters** - `word` ([`PDWord`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWord)): The word whose character placement point is obtained. - `byteIdx` ([`ASInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16)): The byte index within the word of the character whose placement point is obtained. Valid values are 0 to PDWordGetLength(word)-1. - `point` (`ASFixedPoint *`): (Filled by the method) Pointer to the character's placement point, specified in user-space coordinates. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) Returns true if the word has an nth quad, false otherwise. **See also:** [`PDWordGetCharQuad`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordGetCharQuad) #### PDWordGetNthQuadPoint ```cpp ASBool PDWordGetNthQuadPoint(PDWord word, ASInt16 nTh, ASFixedPoint *point) ``` Header: `DLExtrasProcs.h:86` Gets the specified word's nth quad placement point, specified in user space coordinates. **Parameters** - `word` ([`PDWord`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWord)): The word whose nth quad is obtained. - `nTh` ([`ASInt16`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/aslayer.md#ASInt16)): The quad placement point to obtain. A word's first quad has an index of zero. - `point` (`ASFixedPoint *`): (Filled by the method) Pointer to the word's nth quad placement point, specified in user-space coordinates. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) Returns true if the word has an nth quad, false otherwise. **See also:** [`PDWordGetNumQuads`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWordGetNumQuads) #### PDWordIsLastWordInRegion ```cpp ASBool PDWordIsLastWordInRegion(PDWord word) ``` Header: `DLExtrasProcs.h:116` Routine to check if a word is the last word in a region as determined by the WordFinder. **Parameters** - `word` ([`PDWord`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/pdlayer.md#PDWord)): The word to check. **Returns:** [`ASBool`](https://docs.datalogics.com/apdfl21/AdobeCPlusCPlus/APDFL21.0.0PlusP1e/plugins.md#ASBool) Returns true if the given PDWord is the last word in a region, false otherwise.