Layer

Acro Support Layer

21 components716 items
292 Functions 223 Definitions 180 Typedefs 18 Structures 3 Enums

ASAtom

5 items

Functions(3)

ASAtomExistsForString

ASBool ASAtomExistsForString(const char *nameStr, ASAtom *atom)
CorProcs.h:130

Tests whether an ASAtom exists for the specified string.

Parameters
nameStr: const char *

The string to test.

atom: 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

true if an ASAtom already exists for nameStr , false otherwise.

ASAtomFromString

ASAtom ASAtomFromString(const char *nameStr)
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

The ASAtom corresponding to nameStr .

Typedefs(1)

Definitions(1)

ASCab

67 items

Functions(56)

ASCabCopy

void ASCabCopy(ASConstCab srcCab, ASCab dstCab)
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

The source cabinet.

dstCab: ASCab

The destination cabinet.

Returns
void
See Also

ASCabDestroy

void ASCabDestroy(ASCab theCab)
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

The cabinet.

Returns
void

ASCabDestroyEmpties

void ASCabDestroyEmpties(ASCab theCab, ASBool recurse)
ASExtraProcs.h:1343

Finds any empty cabinets in theCab , removes their corresponding keys, and destroys them.

Parameters
theCab: ASCab

The cabinet.

recurse: ASBool

true to recurse through all sub-cabinets inside theCab ; false to limit enumeration to key/value pairs directly inside theCab .

Returns
void

ASCabDetachBinary

void * ASCabDetachBinary(ASCab theCab, const char *theKey, ASTArraySize *numBytes)
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

IN/OUT The cabinet.

theKey: const char *

IN/OUT The key name.

numBytes: 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.

ASCabDetachCab

ASCab ASCabDetachCab(ASCab theCab, const char *theKey)
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

IN/OUT The cabinet.

theKey: const char *

IN/OUT The key name.

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

ASCabDetachPathName

void ASCabDetachPathName(ASCab theCab, const char *keyName, ASFileSys *fileSys, ASPathName *pathName)
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().

Parameters
theCab: ASCab
keyName: const char *
fileSys: ASFileSys *
pathName: ASPathName *
Returns
void

ASCabDetachPointerRaw

void * ASCabDetachPointerRaw(ASCab theCab, const char *theKey, const char *expectedType, ASBool *noRefs)
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

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 *

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

ASCabDetachText

ASText ASCabDetachText(ASCab theCab, const char *theKey)
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
theKey: const char *
Returns

ASCabDup

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

The source cabinet.

Returns
ASCab

The newly created ASCab.

See Also

ASCabEnum

void ASCabEnum(ASCab theCab, ASCabEnumProc enumProc, void *clientData)
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. This will RERAISE any exceptions thrown by enumProc .

Parameters
theCab: ASCab

The cabinet.

enumProc: 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
See Also

ASCabFromEntryList

ASCab ASCabFromEntryList(const ASCabEntryRec *entryList)
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

The newly created ASCab.

ASCabGetAtom

ASAtom ASCabGetAtom(ASConstCab theCab, const char *theKey, ASAtom defValue)
ASExtraProcs.h:874

Returns the ASAtom value stored under theKey in theCab .

Parameters
theCab: ASConstCab

IN/OUT The cabinet.

theKey: const char *

IN/OUT The key name.

defValue: ASAtom

IN/OUT The default value.

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

See Also

ASCabGetBinary

const void * ASCabGetBinary(ASConstCab theCab, const char *theKey, ASTArraySize *numBytes)
ASExtraProcs.h:1247

Returns the binary object stored under theKey in theCab .

Parameters
theCab: ASConstCab

IN/OUT The cabinet.

theKey: const char *

IN/OUT The key name.

numBytes: 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.

ASCabGetBinaryCopy

void * ASCabGetBinaryCopy(ASConstCab theCab, const char *theKey, ASTArraySize *numBytes)
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

IN/OUT The cabinet.

theKey: const char *

IN/OUT The key name.

numBytes: 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.

ASCabGetBool

ASBool ASCabGetBool(ASConstCab theCab, const char *theKey, ASBool defValue)
ASExtraProcs.h:822

Returns the ASBool value stored under theKey in theCab .

Parameters
theCab: ASConstCab

IN/OUT The cabinet.

theKey: const char *

IN/OUT The key name.

defValue: ASBool

IN/OUT The default value.

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

See Also

ASCabGetCab

ASCab ASCabGetCab(ASConstCab theCab, const char *theKey)
ASExtraProcs.h:1082

Returns the ASCab stored under theKey in theCab .

Parameters
theCab: ASConstCab

IN/OUT The cabinet.

theKey: const char *

IN/OUT The key name.

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

ASCabGetDouble

double ASCabGetDouble(ASConstCab theCab, const char *theKey, double defValue)
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

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.

See Also

ASCabGetInt

ASInt32 ASCabGetInt(ASConstCab theCab, const char *theKey, ASInt32 defValue)
ASExtraProcs.h:848

Returns the ASInt32 value stored under theKey in theCab .

Parameters
theCab: ASConstCab

IN/OUT The cabinet.

theKey: const char *

IN/OUT The key name.

defValue: ASInt32

IN/OUT The default value.

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

See Also

ASCabGetInt64

ASInt64 ASCabGetInt64(ASConstCab theCab, const char *theKey, ASInt64 defValue)
ASExtraProcs.h:2377

Returns the ASInt64 value stored under theKey in theCab .

Parameters
theCab: ASConstCab

IN/OUT The cabinet.

theKey: const char *

IN/OUT The key name.

defValue: ASInt64

IN/OUT The default value.

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

See Also

ASCabGetPathNameCopy

void ASCabGetPathNameCopy(ASConstCab theCab, const char *keyName, ASFileSys *fileSys, ASPathName *pathName)
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

IN/OUT The cabinet.

keyName: const char *

IN/OUT The key name.

fileSys: ASFileSys *

IN/OUT (Filled by the method) The ASFileSys that pathName was opened through.

pathName: ASPathName *

IN/OUT (Filled by the method) The path name.

Returns
void

ASCabGetPointerDestroyProc

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

IN/OUT The cabinet.

theKey: const char *

IN/OUT The key name.

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

ASCabGetPointerRaw

void * ASCabGetPointerRaw(ASConstCab theCab, const char *theKey, const char *expectedType)
ASExtraProcs.h:970

Returns the pointer value stored under theKey in theCab .

Parameters
theCab: 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.

ASCabGetPointerType

const char * ASCabGetPointerType(ASConstCab theCab, const char *theKey)
ASExtraProcs.h:1047

Returns a string representation of the data type referenced by the pointer stored under theKey in theCab .

Parameters
theCab: 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.

ASCabGetString

const char * ASCabGetString(ASConstCab theCab, const char *theKey)
ASExtraProcs.h:1118

Returns the string stored under theKey in theCab .

Parameters
theCab: 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.

ASCabGetStringCopy

char * ASCabGetStringCopy(ASConstCab theCab, const char *theKey)
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

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.

ASCabGetText

ASText ASCabGetText(ASConstCab theCab, const char *theKey)
ASExtraProcs.h:1192

Returns the ASText object stored under theKey in theCab .

Parameters
theCab: ASConstCab

IN/OUT The cabinet.

theKey: const char *

IN/OUT The key name.

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

ASCabGetUns64

ASUns64 ASCabGetUns64(ASConstCab theCab, const char *theKey, ASUns64 defValue)
ASExtraProcs.h:2403

Returns the ASUns64 value stored under theKey in theCab .

Parameters
theCab: ASConstCab

IN/OUT The cabinet.

theKey: const char *

IN/OUT The key name.

defValue: ASUns64

IN/OUT The default value.

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

See Also

ASCabMakeEmpty

void ASCabMakeEmpty(ASCab theCab)
ASExtraProcs.h:1331

Removes all keys from theCab and destroys all values they point to.

Parameters
theCab: ASCab

IN/OUT The cabinet.

Returns
void

ASCabMunge

void ASCabMunge(ASCab theCab, ASConstCab keyCab, ASCabMungeAction action)
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

IN/OUT The cabinet to be modified.

keyCab: ASConstCab

IN/OUT The cabinet used to modify theCab .

action: ASCabMungeAction

IN/OUT The type of action to be taken.

Returns
void

ASCabNew

ASExtraProcs.h:661

Creates a new, empty cabinet.

Parameters
: void
Returns
ASCab

The newly created cabinet.

ASCabPutAtom

void ASCabPutAtom(ASCab theCab, const char *theKey, ASAtom atomValue)
ASExtraProcs.h:885

Stores an ASAtom value in theCab under theKey .

Parameters
theCab: ASCab

IN/OUT The cabinet.

theKey: const char *

IN/OUT (May be NULL ) The key name.

atomValue: ASAtom

IN/OUT The value to be stored.

Returns
void
See Also

ASCabPutBinary

void ASCabPutBinary(ASCab theCab, const char *theKey, void *theBlob, ASTArraySize blobSize)
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

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

IN/OUT The size of the binary object.

Returns
void

ASCabPutBool

void ASCabPutBool(ASCab theCab, const char *theKey, ASBool theBool)
ASExtraProcs.h:833

Stores an ASBool value in theCab under theKey.

Parameters
theCab: ASCab

IN/OUT The cabinet.

theKey: const char *

IN (May be NULL ) The key name.

theBool: ASBool

IN The value to be stored. Non-zero values are stored as true .

Returns
void
See Also

ASCabPutCab

void ASCabPutCab(ASCab theCab, const char *keyName, ASCab putCab)
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
keyName: const char *
putCab: ASCab
Returns
void

ASCabPutDouble

void ASCabPutDouble(ASCab theCab, const char *theKey, double floatValue)
ASExtraProcs.h:912

Stores a double value in theCab under theKey .

Parameters
theCab: 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
See Also

ASCabPutInt

void ASCabPutInt(ASCab theCab, const char *theKey, ASInt32 theInt)
ASExtraProcs.h:859

Stores an ASInt32 value in theCab under theKey .

Parameters
theCab: ASCab

IN/OUT The cabinet.

theKey: const char *

IN/OUT (May be NULL ) The key name.

theInt: ASInt32

IN/OUT The value to be stored.

Returns
void
See Also

ASCabPutInt64

void ASCabPutInt64(ASCab theCab, const char *theKey, ASInt64 theInt)
ASExtraProcs.h:2388

Stores an ASInt64 value in theCab under theKey .

Parameters
theCab: ASCab

IN/OUT The cabinet.

theKey: const char *

IN/OUT (May be NULL ) The key name.

theInt: ASInt64

IN/OUT The value to be stored.

Returns
void
See Also

ASCabPutNull

void ASCabPutNull(ASCab theCab, const char *theKey)
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

IN/OUT The cabinet.

theKey: const char *

IN/OUT The key name.

Returns
void

ASCabPutPointerRaw

void ASCabPutPointerRaw(ASCab theCab, const char *theKey, const char *theType, void *thePtr, ASCabPointerDestroyProc destroy)
ASExtraProcs.h:1017

Stores a pointer in theCab under theKey . See the ASCab description for more information.

Parameters
theCab: 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

(May be NULL ) A user-supplied callback which is called when the reference count associated with thePtr is zero.

Returns
void

ASCabPutString

void ASCabPutString(ASCab theCab, const char *theKey, const char *theStr)
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
theKey: const char *
theStr: const char *
Returns
void

ASCabPutText

void ASCabPutText(ASCab theCab, const char *theKey, ASText theText)
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
theKey: const char *
theText: ASText
Returns
void

ASCabPutUns

void ASCabPutUns(ASCab theCab, const char *theKey, ASUns32 theUns)
ASExtraProcs.h:1619

Stores the ASUns32 value under theKey in theCab .

Parameters
theCab: ASCab

The cabinet.

theKey: const char *

The key name.

theUns: ASUns32

The value to be stored.

Returns
void
See Also

ASCabPutUns64

void ASCabPutUns64(ASCab theCab, const char *theKey, ASUns64 theInt)
ASExtraProcs.h:2414

Stores an ASUns64 value in theCab under theKey .

Parameters
theCab: ASCab

IN/OUT The cabinet.

theKey: const char *

IN/OUT (May be NULL ) The key name.

theInt: ASUns64

IN/OUT The value to be stored.

Returns
void
See Also

ASCabRemove

void ASCabRemove(ASCab theCab, const char *theKey)
ASExtraProcs.h:807

Removes theKey entry from theCab , destroying the associated value.

Parameters
theCab: ASCab

IN/OUT The cabinet.

theKey: const char *

IN/OUT The key name.

Returns
void

ASCabRename

void ASCabRename(ASCab theCab, const char *oldKeyName, const char *newKeyName)
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

The cabinet.

oldKeyName: const char *

The key name to be changed.

newKeyName: const char *

The new name.

Returns
void

ASCabValueEqual

ASBool ASCabValueEqual(ASConstCab cab1, const char *keyName1, ASConstCab cab2, const char *keyName2)
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

IN/OUT The first cabinet.

keyName1: const char *

IN/OUT The key name.

cab2: ASConstCab

IN/OUT The second cabinet.

keyName2: const char *

IN/OUT The key name.

Returns
ASBool

See above.

See Also

ASConstCabEnum

void ASConstCabEnum(ASConstCab theCab, ASConstCabEnumProc enumProc, void *clientData)
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

The cabinet.

enumProc: 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
See Also

Typedefs(5)

ASCabValueType

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.

Structures(2)

ASCab

typedef struct _t_ASCabinet* ASCab
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.

Definitions(4)

ASCabDetachPointer

ASExtraCalls.h:399
Value:((theType)ASCabDetachPointerRaw((theCab), (theKey), #theType, (noRefs)))

ASCabGetPointer

ASExtraCalls.h:395
Value:((theType)ASCabGetPointerRaw((theCab), (theKey), #theType))

ASCabPutPointer

ASExtraCalls.h:397
Value:ASCabPutPointerRaw((theCab), (theKey), #theType, (thePtr), (destroyProc))

MAX_ASCAB_KEY

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

3 items

Functions(3)

ASCalendarTimeSpanAddWithBase

void ASCalendarTimeSpanAddWithBase(const ASCalendarTimeSpan timeSpan1, const ASCalendarTimeSpan timeSpan2, const ASDate baseDate, ASCalendarTimeSpan result)
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

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

ASCalendarTimeSpanCompare

ASInt32 ASCalendarTimeSpanCompare(const ASCalendarTimeSpan timeSpan1, const ASCalendarTimeSpan timeSpan2, const ASDate baseDate)
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

The base date, or NULL to use Jan 1 1970 00:00:00, the epoch time.

Returns
ASInt32

1 if timeSpan1 > timeSpan2 , 0 if they are equal, and -1 if timeSpan1 < timeSpan2 .

ASCalendarTimeSpanDiff

void ASCalendarTimeSpanDiff(const ASCalendarTimeSpan timeSpan1, const ASCalendarTimeSpan timeSpan2, const ASDate baseDate, ASCalendarTimeSpan result)
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

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

ASCallback

5 items

Functions(2)

ASCallbackCreate

ASCallback ASCallbackCreate(ASExtension extensionID, void *proc)
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 . 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

IN/OUT The gExtensionID extension that calls proc .

proc: void *

IN/OUT The user-supplied procedure for which a callback is created.

Returns
ASCallback

The newly-created callback.

Definitions(3)

ASCryptStm

12 items

Typedefs(7)

Structures(1)

Definitions(4)

ASDate

22 items

Functions(20)

ASDateAddCalendarTimeSpan

void ASDateAddCalendarTimeSpan(ASDate date, const ASCalendarTimeSpan timeSpan)
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. 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

The date.

timeSpan: const ASCalendarTimeSpan

The calendar time span to add.

Returns
void

ASDateCalendarDiff

void ASDateCalendarDiff(const ASDate date1, const ASDate date2, ASCalendarTimeSpan result)
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

The first date.

date2: const ASDate

The second date.

result: ASCalendarTimeSpan

The calendar time span structure in which to store the difference.

Returns
void

ASDateExactDiff

void ASDateExactDiff(const ASDate date1, const ASDate date2, ASTimeSpan result)
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

The first date.

date2: const ASDate

The second date.

result: ASTimeSpan

The time span structure in which to store the difference.

Returns
void

ASDateGetLocalTime

ASTimeRec ASDateGetLocalTime(const ASDate date)
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

The date.

Returns
ASTimeRec

The newly created time record.

ASDateGetTimeString

char * ASDateGetTimeString(const ASDate date, ASDateTimeFormat format)
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

The date object.

format: ASDateTimeFormat

The format of the time string.

Returns
char *

The time string in the specified format.

ASDateSetLocalTimeOffset

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

The date.

Returns
void

ASDateSetTimeFromRec

void ASDateSetTimeFromRec(ASDate date, const ASTimeRec *timeRec)
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

The date object.

timeRec: const ASTimeRec *

The time record.

Returns
void

ASDateSetTimeFromString

void ASDateSetTimeFromString(ASDate date, const char *timeString, ASDateTimeFormat format)
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

The date object.

timeString: const char *

The time string, in the specified format.

format: ASDateTimeFormat

The format of the time string. kASTimeNone and kASTimeUniversalH are not supported.

Returns
void

ASDateSubtractCalendarTimeSpan

void ASDateSubtractCalendarTimeSpan(ASDate date, const ASCalendarTimeSpan timeSpan)
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. 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

The date.

timeSpan: const ASCalendarTimeSpan

The calendar time span to subtract.

Returns
void

Typedefs(1)

Structures(1)

ASDate

typedef struct _t_ASDateRec* ASDate
ASExpT.h:4052

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

ASDouble

7 items

Functions(4)

ASDoubleMatrixConcat

void ASDoubleMatrixConcat(ASDoubleMatrix *result, const ASDoubleMatrix *m1, const ASDoubleMatrix *m2)
ASProcs.h:2955

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

ASDoubleMatrixInvert

void ASDoubleMatrixInvert(ASDoubleMatrix *result, const ASDoubleMatrix *m)
ASProcs.h:2971

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

ASDoubleMatrixTransform

void ASDoubleMatrixTransform(ASDoublePoint *result, const ASDoubleMatrix *m, const ASDoublePoint *p)
ASProcs.h:2988

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

ASDoubleMatrixTransformRect

void ASDoubleMatrixTransformRect(ASDoubleRect *result, const ASDoubleMatrix *m, const ASDoubleRect *rectIn)
ASProcs.h:3006

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

Typedefs(3)

ASReal

typedef float ASReal
ASExpT.h:1189

Definition of ASReal.

ASException

12 items

Functions(8)

ASGetErrorString

const char * ASGetErrorString(ASErrorCode errorCode, char *buffer, ASTArraySize lenBuffer)
ASProcs.h:137

Gets a string describing the specified error/exception.

Parameters
errorCode: ASErrorCode
buffer: char *
lenBuffer: 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.

ASPopExceptionFrame

CorProcs.h:78

Pops an exception frame off the stack. 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
: void
Returns
void

ASPushExceptionFrame

void ASPushExceptionFrame(void *asEnviron, ACRestoreEnvironProc restoreFunc)
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. 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

IN/OUT Should be a function matching the following prototype: ACCB1 void ACCB2 RestorePlugInFrame( void* asEnviron)

Returns
void

ASRaise

void ASRaise(ASErrorCode error)
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

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

ASRegisterErrorString

ASErrorCode ASRegisterErrorString(ASErrSeverity severity, const char *errorString)
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

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

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.

Typedefs(3)

Definitions(1)

ASExtension

8 items

Functions(4)

ASEnumExtensions

ASExtension ASEnumExtensions(ASExtensionEnumProc proc, void *clientData, ASBool onlyLivingExtensions)
CorProcs.h:276

Enumerates all ASExtension objects (valid plug-ins).

Parameters
proc: 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

If true , ASExtension objects that have been unloaded or otherwise deactivated are not enumerated. If false , all ASExtension objects are enumerated.

Returns
ASExtension

If proc returned false , the last ASExtension that was enumerated is returned, NULL otherwise.

ASExtensionMgrGetHFT

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

The name of the HFT to obtain.

version: ASVersion

The version number of the HFT to obtain.

Returns
HFT

The specified HFT, or NULL if the HFT does not exist.

Typedefs(2)

Structures(1)

ASExtension

typedef struct _t_ASExtension* ASExtension
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.

Definitions(1)

ASFile

64 items

Functions(33)

ASFileClose

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

IN/OUT The file to close. The file must have been opened previously using ASFileSysOpenFile().

Returns
ASErrorCode

0 if the operation was successful; some file system or platform-dependent error code is returned otherwise.

ASFileFlush

void ASFileFlush(ASFile aFile)
ASProcs.h:1011

Flushes any buffered data to a file. This method may raise file system or platform-specific exceptions.

Parameters
aFile: ASFile

The file whose data is flushed.

Returns
void
See Also

ASFileGetFileSysByName

ASProcs.h:1249

Gets the file system that was registered with the specified name. "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

Parameters
name: ASAtom
Returns
ASFileSys

The file system, otherwise NULL if no matching file system was found.

ASFileGetMDFile

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

IN/OUT The ASFile for which the information is desired.

pFileID: ASMDFile *

IN/OUT (Filled by the method, may be NULL ) The ASMDFile identifier associated with file.

pFileSys: ASFileSys *

IN/OUT (Filled by the method, may be NULL ) The file system through which this file was opened.

Returns
ASBool

true if the file is an open file, false otherwise.

ASFileGetOpenMode

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

The file in question.

Returns
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:

ASFileGetURL

char * ASFileGetURL(ASFile asf)
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().

Parameters
asf: ASFile
Returns
char *

ASFileHardFlush

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

The file that is flushed.

Returns
ASErrorCode

0 if the operation succeeded, -1 if there was an error.

See Also

ASFileHasOutstandingMReads

ASProcs.h:2464

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

The file in question.

Returns
ASBool

true if the file has outstanding mreads , false otherwise.

ASFileIsSame

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. This method is not guaranteed to work on all file systems.

Parameters
fN: ASFile

IN/OUT The file in question.

pathName: ASPathName

IN/OUT The ASPathName in question.

fileSys: ASFileSys

IN/OUT The file system from which the path was obtained.

Returns
ASBool

false if the comparison fails, true otherwise.

ASFileOpenWithVirtualEOF

ASProcs.h:3027

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

IN The ASFile to base the new file on

virtualEOF: ASFilePos64

IN The new EOF.

newFile: ASFile *

OUT the new ASFile.

Returns
ASInt32

Error code if the newFile could not be created.

ASFilePushData

void ASFilePushData(ASFile aFile, const char *p, ASTFilePos offset, ASTArraySize length)
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

IN/OUT The file to which data is sent.

p: const char *

IN/OUT The data being pushed.

offset: ASTFilePos

IN/OUT A byte offset into the file at which the data should be written.

length: ASTArraySize

IN/OUT The number of bytes held in the buffer.

Returns
void

ASFileRead

ASProcs.h:984

Reads data from a file, beginning at the current seek position.

Parameters
aFile: 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

IN/OUT The number of bytes to read.

Returns
ASTArraySize

The number of bytes actually read from the file.

ASFileRegisterFileSys

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

IN/OUT The gExtensionID of the plug-in registering the fileSys .

fileSys: ASFileSys

IN/OUT The ASFileSys being registered.

Returns
ASBool

true if fileSys is successfully registered, false otherwise.

ASFileReopen

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. The file mode and return types changed in 0x00060000.

Parameters
aFile: ASFile

The file to reopen.

mode: ASFileMode

An open-mode value as specified for ASFileMode.

Returns
ASErrorCode

0 if the operation was successful; some file system or platform-dependent error code is returned otherwise.

ASFileSetEOF

void ASFileSetEOF(ASFile aFile, ASTFilePos newFileSize)
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

The file whose size is changed.

newFileSize: ASTFilePos

The new size of file.

Returns
void

ASFileSetEOF64

void ASFileSetEOF64(ASFile aFile, ASFilePos64 newFileSize)
ASProcs.h:2738

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

IN/OUT The file whose size is changed.

newFileSize: ASFilePos64

IN/OUT The new size of the file.

Returns
void

ASFileSetMode

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

The file for which to get or set the mode.

modeValue: ASFlagBits

The mode flag values to get or set, which are described in ASFileMode Flags.

modeMask: ASFlagBits

The mask for the mode flags to get or set.

Returns
ASFlagBits

The previous value of the mode, or 0 if the file system does not support this operation.

ASFileStmRdOpen

ASProcs.h:1068

Creates a read-only ASStm from a file. The stream supports seek operations.

Parameters
afile: 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

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

The newly created ASStm.

ASFileStmWrOpen

ASProcs.h:1566

Creates a writable ASStm from a file. The stream supports seek operations.

Parameters
afile: 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

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

The newly created ASStm.

ASFileWrite

ASTArraySize ASFileWrite(ASFile aFile, const char *p, ASTArraySize count)
ASProcs.h:1001

Writes data to a file, beginning at the current seek position.

Parameters
aFile: 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

IN/OUT The number of bytes to write.

Returns
ASTArraySize

The number of bytes actually written to the file.

Typedefs(8)

ASFile

typedef void* ASFile
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.

ASMDFile

typedef void* ASMDFile
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.

ASFileCompletionProc

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)
ASExpT.h:1887

Called when an asynchronous read or write request has completed.

Enums(1)

ASFileStatusFlags

ASExpT.h:1946

Values returned by ASFileSysGetStatusProc().

Values
kASFileOkay
—

The MDFile is in a valid state.

kASFileIsTerminating
—

The MDFile is being closed (for example, because the file is being displayed in a web browser's window and the user cancelled downloading).

Definitions(22)

ASFILE_CREATE

ASExpT.h:1501
Value:4

Create the file if it does not exist.

ASFILE_ENCRYPT

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

ASExpT.h:1511
Value:16

A hint indicating that a local copy of the file will be needed.

ASFILE_RANDOMACCESS

ASExpT.h:1516
Value:32

A hint indicating that the file will be primarily accessed randomly.

ASFILE_READ

ASExpT.h:1491
Value:1

Open the file for reading.

ASFILE_SERIAL

ASExpT.h:1506
Value:8

A hint indicating that the file will be primarily accessed sequentially.

ASFILE_TEMPORARY

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.

MDFile

ASExpT.h:1931
Value:ASMDFile

kASFileDialUp

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

ASExpT.h:1555
Value:0x00000008L

Set if the file is to be cached (requires kASFileUseMRead to be set as well).

kASFileHasVirtualEOF

ASExpT.h:1577
Value:0x00000080L

true if the file is built with a Virtual EOF (Acrobat 10).

kASFileNoRequestIfBytesNotReady

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

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

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

ASExpT.h:1537
Value:0x00000001L

Set if the file's data transfer rate is generally slow. @ingroup ASFileFlags

kASFileSuspendIfBytesNotReady

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

ASExpT.h:1550
Value:0x00000004L

Use multi-read commands to access the file.

ASFileSys

180 items

Functions(47)

ASFileSysAcquireFileSysPath

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

IN/OUT (May be NULL ) The file system from which oldPathName was obtained. Pass NULL to use the default file system.

oldPathName: ASPathName

IN/OUT The ASPathname in the current file system.

newFileSys: 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

The ASPathName in newFileSys or NULL if one cannot be made.

ASFileSysAcquireParent

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

IN/OUT (May be NULL ) The file system from which pathName was obtained. Pass NULL to use the default file system.

pathName: ASPathName

IN/OUT The ASPathName.

Returns
ASPathName

The ASPathName associated with the parent folder. The method will return NULL if the parent could not be returned.

ASFileSysAcquirePlatformPath

ASInt32 ASFileSysAcquirePlatformPath(ASFileSys fileSys, ASPathName path, ASAtom platformPathType, ASPlatformPath *platformPath)
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

(May be NULL ) The file system from which pathName was obtained. Pass NULL to use the default file system.

path: ASPathName

The ASPathName in the file system specified by fileSys.

platformPathType: ASAtom

The platform path type, one of the following ASAtom values:

platformPath: ASPlatformPath *

(Filled by the method) The new platform path object. Always free this object with ASFileSysReleasePlatformPath() when done.

Returns
ASInt32

0 if the operation was successful, non-zero error code otherwise.

ASFileSysCanPerformOpOnItem

ASInt32 ASFileSysCanPerformOpOnItem(ASFileSys fileSys, ASPathName pathName, const char *op)
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

(May be NULL ) The file system from which pathName was obtained. Pass NULL to use the default file system.

pathName: 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

asGenErrNoError if the operation can be performed on the item, or an error indicating why the oepration would fail.

ASFileSysConvertCabToItemProps

ASInt32 ASFileSysConvertCabToItemProps(ASFileSysItemProps props, ASCab theCab)
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

Properties describing the object, in cabinet format.

Returns
ASInt32

0 if no error was encountered; otherwise an error code is returned.

ASFileSysConvertItemPropsToCab

ASInt32 ASFileSysConvertItemPropsToCab(ASCab theCab, const ASFileSysItemPropsRec *props)
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 NameType
isThereASBool
typeASInt32
isHiddenASBool
isReadOnlyASBool
creationDatechar* (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

(Filled by the method) Properties describing the object, in cabinet format.

props: const ASFileSysItemPropsRec *

The item properties structure.

Returns
ASInt32

0 if no error was encountered; otherwise an error code is returned.

ASFileSysCopyPath

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

(May be NULL ) The file system from which pathName was obtained. Pass NULL to use the default file system.

pathName: ASPathName

The ASPathName to copy.

Returns
ASPathName

A copy of pathName .

ASFileSysCreateFolder

ASProcs.h:1889

Creates an empty folder at the specified pathName .

Parameters
fileSys: ASFileSys

(May be NULL ) The file system from which pathName was obtained. Pass NULL to use the default file system.

path: ASPathName

The path of the folder to create.

recurse: ASBool

Recursively create the parent folder if necessary.

Returns
ASErrorCode

0 if the operation was successful, a non-zero platform-dependent error code otherwise.

ASFileSysCreatePathName

ASPathName ASFileSysCreatePathName(const ASFileSys fileSys, ASAtom pathSpecType, const void *pathSpec, const void *additionalData)
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. This method does not work for relative POSIX paths on Mac OS; only absolute POSIX paths will work. 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

(May be NULL ) The ASFileSys in which you are trying to create an ASPathName. Pass NULL to use the default file system.

pathSpecType: 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

The newly created path name, or NULL on failure.

ASFileSysDIPathFromPath

char * ASFileSysDIPathFromPath(ASFileSys fileSys, ASPathName path, ASPathName relativeToThisPath)
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(). On Mac OS, if pathName and relativeToThisPath refer to files that are on different volumes, the method returns an absolute path. 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

(May be NULL ) The file system from which pathName was obtained. Pass NULL to use the default file system.

path: ASPathName

The ASPathName to convert.

relativeToThisPath: 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.

ASFileSysDIPathFromPathEx

ASErrorCode ASFileSysDIPathFromPathEx(ASFileSys fileSys, ASPathName path, ASPathName relativeToThisPath, ASText diPathText)
ASProcs.h:2534

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

(May be NULL ) The file system from which pathName was obtained. Pass NULL to use the default file system.

path: ASPathName

The ASPathName to convert.

relativeToThisPath: 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

(Filled by the method) The ASText object to contain the device-independent path. It must be allocated and freed by the client.

Returns
ASErrorCode

0 if the operation was successful, a non-zero platform-dependent error code otherwise.

ASFileSysDestroyFolderIterator

ASProcs.h:1694

Releases the resources associated with folderIter .

Parameters
fileSys: 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

IN/OUT An ASFolderIterator object returned from a previous call to ASFileSysFirstFolderItem().

Returns
void

ASFileSysDisplayASTextFromPath

ASProcs.h:2443

Returns a user-friendly representation of a path as a text object. It calls ASFileSysDisplayASTextFromPathProc(). This method supersedes ASFileSysDisplayStringFromPath().

Parameters
fileSys: ASFileSys

(May be NULL ) The file system from which pathName was obtained. Pass NULL to use the default file system.

path: ASPathName

The ASPathName in question.

displayText: ASText

(Filled by method) The text object containing the display representation of the path.

Returns
ASErrorCode

0 if the operation was successful, a non-zero platform-dependent error code otherwise.

ASFileSysDisplayStringFromPath

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" This method can only be used to get host encoding. For any other encoding, use ASFileSysDisplayASTextFromPath().

Parameters
fileSys: ASFileSys

(May be NULL ) The file system from which pathName was obtained. Pass NULL to use the default file system.

path: 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.

ASFileSysFirstFolderItem

ASFolderIterator ASFileSysFirstFolderItem(ASFileSys fileSys, ASPathName folderPath, ASFileSysItemProps props, ASPathName *itemPath)
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(). 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. If items are added to or removed from a folder during iteration, the results are implementation-dependent.

Parameters
fileSys: ASFileSys

IN/OUT (May be NULL ) The file system from which folderPath was obtained. Pass NULL to use the default file system.

folderPath: 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 *

(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

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.

ASFileSysFlushVolume

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

IN/OUT (May be NULL ) The file system from which pathName was obtained. Pass NULL to use the default file system.

pathName: ASPathName

IN/OUT The ASPathName from which the volume information is obtained.

Returns
ASErrorCode

0 if the operation was successful, a non-zero platform-dependent error code otherwise.

ASFileSysGetFilePosLimit

ASProcs.h:2692

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

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

The maximum file position that can be processed.

ASFileSysGetItemProps

ASErrorCode ASFileSysGetItemProps(ASFileSys fileSys, ASPathName pathName, ASFileSysItemProps props)
ASProcs.h:1608

Populates an ASFileSysItemProps record with a full description of the file system object associated with pathName . It calls ASFileSysGetItemPropsProc(). 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

(May be NULL ) The file system from which pathName was obtained. Pass NULL to use the default file system.

pathName: 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

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 .

ASFileSysGetItemPropsAsCab

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
isThereASBool
typeASInt32
isHiddenASBool
isReadOnlyASBool
creationDatechar* (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
fileSys: ASFileSys
pathName: ASPathName
theCab: ASCab
Returns

ASFileSysGetNameFromPath

ASErrorCode ASFileSysGetNameFromPath(ASFileSys fileSys, ASPathName pathName, char *name, ASTArraySize maxLength)
ASProcs.h:1763

Extracts the file name (including extension) from the path. This method can only be used to get host encoding. For any other encoding, use ASFileSysGetNameFromPathAsASText().

Parameters
fileSys: ASFileSys

(May be NULL ) The file system from which pathName was obtained. Pass NULL to use the default file system.

pathName: 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

Maximum number of bytes that buffer can hold.

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

ASFileSysGetNameFromPathAsASText

ASProcs.h:2424

Extracts the file name (including the extension) from the path as an ASText object. This method supersedes ASFileSysGetNameFromPath().

Parameters
fileSys: ASFileSys

(May be NULL ) The file system from which pathName was obtained. Pass NULL to use the default file system.

pathName: ASPathName

The ASPathName associated with the file in question.

name: ASText

(Filled by the method) The text object containing the file name.

Returns
ASErrorCode

0 if the operation was successful, a non-zero platform-dependent error code otherwise.

ASFileSysGetNameFromPathForDisplay

ASProcs.h:2780

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

(May be NULL ) The file system from which pathName was obtained. Pass NULL to use the default file system.

pathName: ASPathName

The ASPathName associated with the file in question.

nameForDisplay: ASText

(Filled by the method) The text object containing the name used for display.

Returns
ASErrorCode

0 if the operation was successful, a non-zero platform-dependent error code otherwise.

ASFileSysGetStorageFreeSpace

ASProcs.h:1803

Gets the amount of free space on the volume containing pathName .

Parameters
fileSys: ASFileSys

IN/OUT (May be NULL ) The file system from which pathName was obtained. Pass NULL to use the default file system.

pathName: ASPathName

IN/OUT The ASPathName in question.

Returns
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

ASProcs.h:2870

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

IN/OUT (May be NULL ) The file system from which pathName was obtained. Pass NULL to use the default file system.

pathName: ASPathName

IN/OUT The ASPathName.

Returns
ASDiskSpace64

The amount of free space in bytes, 0 otherwise.

ASFileSysGetTempPathName

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.

DLADD mjm 5/17/2021 SF44014 Notify that a call is made to ASFileSysGetTempPath, include fileSys. @notify ASFileSysCalledGetPathName

Parameters
fileSys: ASFileSys
siblingPathName: ASPathName
Returns

ASFileSysGetTypeAndCreator

void ASFileSysGetTypeAndCreator(ASFileSys fileSys, ASPathName path, ASUns32 *type, ASUns32 *creator)
ASProcs.h:2001

Gets the type and creator of the file specified by the path. See Creators and Acrobat Types. Creators AcrobatTypes 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

The file system containing the file for which the type and creator are needed.

path: ASPathName

The path name of the file.

type: ASUns32 *

(Filled by method) The type of the file.

creator: ASUns32 *

(Filled by method) The creator of the file.

Returns
void

ASFileSysOpenFile

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

(May be NULL ) The file system from which pathName was obtained. Pass NULL to use the default file system.

pathName: ASPathName

The path name of the file to open.

mode: ASFileMode

An open-mode value as specified for ASFileMode.

fP: ASFile *

(Filled by the method) The ASFile that was opened.

Returns
ASErrorCode

0 if the operation was successful, a non-zero error code otherwise. The error is platform and file-system specific:

ASFileSysOpenFile64

ASProcs.h:2676

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

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

IN/OUT The path name of the file to open.

mode: ASFileMode

IN/OUT An OR of the ASFile Open Modes.

fP: ASFile *

IN/OUT (Filled by the method) The ASFile that was opened.

Returns
ASErrorCode

0 if the operation was successful, a non-zero error code otherwise. The error is platform and file-system specific:

ASFileSysPathFromDIPath

ASPathName ASFileSysPathFromDIPath(ASFileSys fileSys, const char *diPath, ASPathName relativeToThisPath)
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 . Use ASFileSysPathFromDIPathEx() instead for anything other than host encoding.

Parameters
fileSys: 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

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

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.

ASFileSysPathFromDIPathEx

ASPathName ASFileSysPathFromDIPathEx(ASFileSys fileSys, ASConstText diPathText, ASPathName relativeToThisPath)
ASProcs.h:2578

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
diPathText: ASConstText
relativeToThisPath: 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

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

ASInt32 ASFileSysPerformOpOnItem(ASFileSys fileSys, ASPathName pathName, const char *op, ASCab params)
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

(May be NULL ) The file system from which pathName was obtained. Pass NULL to use the default file system.

pathName: 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

An ASCab object containing parameters to pass to the operation.

Returns
ASInt32

0 if the operation was successful, a nonzero platform-dependent error code otherwise.

ASFileSysReleasePath

void ASFileSysReleasePath(ASFileSys fileSys, ASPathName pathName)
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

(May be NULL ) The file system from which pathName was obtained. Pass NULL to use the default file system.

pathName: ASPathName

The ASPathName to release.

Returns
void

ASFileSysReleasePlatformPath

ASProcs.h:2293

Releases the specified platform path object. Each call to ASFileSysAcquirePlatformPath() should have a corresponding call to this method.

Parameters
fileSys: ASFileSys

(May be NULL ) The file system from which pathName was obtained. Pass NULL to use the default file system.

platformPath: ASPlatformPath

The platform path object to release.

Returns
void

ASFileSysRemoveFile

ASProcs.h:864

Attempts to delete the file referred to by pathName . 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

(May be NULL ) The file system from which pathName was obtained. Pass NULL to use the default file system.

pathName: ASPathName

The file to delete.

Returns
ASErrorCode

0 if the operation was successful, a non-zero platform-dependent error code otherwise.

ASFileSysSetTypeAndCreator

ASProcs.h:1981

Sets the type and creator of a file. See Type/Creator Codes. 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

IN/OUT The file system for which the type and creator are needed.

path: ASPathName

IN/OUT The path name of the file.

type: ASUns32

IN/OUT The type of the file.

creator: ASUns32

IN/OUT The creator of the file.

Returns
void

None.

ASFileSysURLFromPath

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

IN/OUT The file system from which path was obtained. Pass NULL to use the default file system.

path: 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 ' URL style.

ASGetDefaultFileSysForPath

ASFileSys ASGetDefaultFileSysForPath(ASAtom pathSpecType, const void *pathSpec)
ASProcs.h:2844

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
pathSpec: const void *
Returns
ASFileSys

The platform's default or Unicode file system.

Typedefs(74)

ASFileMode

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.

ASFileSysAcquireFileSysPathProc

typedef ASPathName(* ASFileSysAcquireFileSysPathProc) (ASPathName pathName, ASFileSys newFileSys))(ASPathName pathName, ASFileSys newFileSys)
ASExpT.h:2419

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. 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. The ASPathName returned should be released with the ASFileSysReleasePath() method when it is no longer needed.

ASFileSysAcquirePlatformPathProc

typedef ASInt32(* ASFileSysAcquirePlatformPathProc) (ASPathName path, ASAtom platformPathType, ASPlatformPath *platformPath))(ASPathName path, ASAtom platformPathType, ASPlatformPath *platformPath)
ASExpT.h:3077

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.

ASFileSysAsyncReadProc

ASExpT.h:2275

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.

ASFileSysCopyPathNameProc

ASExpT.h:2646

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. The ASPathName returned should be released by the ASFileSysReleasePath() method when it is no longer needed.

ASFileSysCreatePathNameProc

typedef ASPathName(* ASFileSysCreatePathNameProc) (ASAtom pathSpecType, const void *pathSpec, const void *mustBeZero))(ASAtom pathSpecType, const void *pathSpec, const void *mustBeZero)
ASExpT.h:2756

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 . The ASPathName returned should be released by the ASFileSysReleasePath() method when it is no longer needed.

ASFileSysFlushVolumeProc

ASExpT.h:2737

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.

ASFileSysGetFilePositionLimitProc

ASExpT.h:3210

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.

ASFileSysGetItemPropsAsCabProc

typedef ASInt32(* ASFileSysGetItemPropsAsCabProc) (ASPathName pathName, ASCab theCab))(ASPathName pathName, ASCab theCab)
ASExpT.h:3023

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;

ASFileSysGetNameProc

typedef ASErrorCode(* ASFileSysGetNameProc) (ASPathName pathName, char *name, ASTArraySize maxLength))(ASPathName pathName, char *name, ASTArraySize maxLength)
ASExpT.h:2612

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.

ASFileSysMReadRequestProc

typedef ASErrorCode(* ASFileSysMReadRequestProc) (ASMDFile f, ASFile aFile, ASTFilePos *blockPairs, ASTArraySize nBlockPairs))(ASMDFile f, ASFile aFile, ASTFilePos *blockPairs, ASTArraySize nBlockPairs)
ASExpT.h:2368

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.

ASFileSysNextFolderItemProc

typedef ASBool(* ASFileSysNextFolderItemProc) (ASFolderIterator folderIter, ASFileSysItemProps props, ASPathName *itemPath))(ASFolderIterator folderIter, ASFileSysItemProps props, ASPathName *itemPath)
ASExpT.h:2814

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.

ASFileSysPathFromDIPathExProc

typedef ASPathName(* ASFileSysPathFromDIPathExProc) (ASConstText diPathText, ASPathName relativeToThisPath))(ASConstText diPathText, ASPathName relativeToThisPath)
ASExpT.h:3176

A callback for ASFileSysRec that converts a device-independent path name from an ASText object to an ASPathName. It is called by ASFileSysPathFromDIPathEx(). The ASPathName returned should be released by the ASFileSysReleasePath() method when it is no longer needed.

ASFileSysReopenProc

typedef ASMDFile(* ASFileSysReopenProc) (ASMDFile f, ASFileMode newMode, ASErrorCode *error))(ASMDFile f, ASFileMode newMode, ASErrorCode *error)
ASExpT.h:2963

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.

ASFileSysSetModeProc

typedef ASlFileMode(* ASFileSysSetModeProc) (ASMDFile f, ASlFileMode modeValue, ASMaskBits modeMask))(ASMDFile f, ASlFileMode modeValue, ASMaskBits modeMask)
ASExpT.h:2871

ASFileSysSetMode() sets and gets parameters for the specified file.

<b>Mode operations:</b>

OperationCode
Get the current modeASFileSetMode(aFile, 0, 0);
Set the modeASFileSetMode( aFile, kASFileModeDoNotYieldIfBytesNotReady, kASFileModeDoNotYieldIfBytesNotReady );
Clear the modeASFileSetMode( aFile, 0, kASFileModeDoNotYieldIfBytesNotReady );

<b>Setting parameters:</b>

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.

ASFileSysYieldProc

ASExpT.h:2332

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.

ASIODoneProc

typedef void(* ASIODoneProc) (ASIORequest req))(ASIORequest req)
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.

Structures(4)

ASFileSys

typedef struct _t_ASFileSysRec* ASFileSys
ASExpT.h:1840

A data structure containing callbacks that implement a file system.

See Also

ASFolderIterator

typedef struct _t_ASFolderIterator* ASFolderIterator
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().

Definitions(55)

ASFileSysCreatePathFromCFURLRef

ASExpT.h:3835
Value:ASFileSysCreatePathName(asfs, ASAtomFromString("CFURLRef"), (void *)CHECKTYPE(CFURLRef, cfURLRef), NULL);

ASFileSysCreatePathFromCString

ASExpT.h:3811
Value:ASFileSysCreatePathName(asfs, ASAtomFromString("Cstring"), (void *)CHECK_CHARSTR(cPath), NULL);

Helper macro for the ASFileSysCreatePathName() method. 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;

ASFileSysCreatePathFromDIPathText

ASExpT.h:3770
Value:ASFileSysCreatePathName(asfs, ASAtomFromString("DIPathWithASText"), (void *)CHECKTYPE(ASText, tDIPath), \&#10; (void *)CHECKTYPE(ASPathName, aspRelativeTo))

ASFileSysCreatePathFromFSRef

ASExpT.h:3828
Value:ASFileSysCreatePathName(asfs, ASAtomFromString("FSRef"), (void *)CHECKTYPE(FSRef, fsRef), NULL);

ASFileSysCreatePathWithFolderNameWithASText

ASExpT.h:3790
Value:ASFileSysCreatePathName(asfs, ASAtomFromString("FolderPathNameWithASText"), \&#10; (void *)CHECKTYPE(ASPathName, aspFolder), (void *)CHECKTYPE(ASText, tFileName))

KAITypeCode

ASExpT.h:1763
Value:ASFourCharCode('TEXT')

Adobe Illustrator AI file.

kAPFTypeCode

ASExpT.h:1686
Value:ASFourCharCode('APF ')

Acrobat profile format (PPKLite).

kEDNTypeCode

ASExpT.h:1728
Value:ASFourCharCode('fEDN')

eBook EDN activation file.

kEPSTypeCode

ASExpT.h:1768
Value:ASFourCharCode('EPSF')

EPS file.

kETDTypeCode

ASExpT.h:1723
Value:ASFourCharCode('fETD')

eBook Exchange Transfer Data (ETD) file.

kFDFTypeCode

ASExpT.h:1651
Value:ASFourCharCode('FDF ')

Forms data format.

kGIFTypeCode

ASExpT.h:1748
Value:ASFourCharCode('GIFf')

GIF file.

kHTMLCreatorCode

ASExpT.h:1803
Value:ASFourCharCode('MSIE')

Microsoft Internet Explorer.

kPDFTypeCode

ASExpT.h:1646
Value:ASFourCharCode('PDF ')

Portable document format (PDF).

kPDXTypeCode

ASExpT.h:1676
Value:ASFourCharCode('PDX ')

Acrobat catalog index file.

kPICTTypeCode

ASExpT.h:1738
Value:ASFourCharCode('PICT')

Mac OS PICT file.

kPNGTypeCode

ASExpT.h:1758
Value:ASFourCharCode('PNGf')

PNG file.

kPSDTypeCode

ASExpT.h:1733
Value:ASFourCharCode('8BIM')

Adobe Photoshop PSD file.

kPluginNewTypeCode

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.

kPrefsTypeCode

ASExpT.h:1671
Value:ASFourCharCode('PREF')

Preferences file.

kRMFTypeCode

ASExpT.h:1681
Value:ASFourCharCode('RMF ')

Adobe Web Buy rights management file.

kRTFTypeCode

ASExpT.h:1778
Value:ASFourCharCode('RTF ')

Text file.

kWHATypeCode

ASExpT.h:1701
Value:ASFourCharCode('WHA ')

Web-hosted applications file.

kXDPTypeCode

ASExpT.h:1661
Value:ASFourCharCode('XDP ')

XML data package.

kXFDFTypeCode

ASExpT.h:1656
Value:ASFourCharCode('XFDF')

XML forms data format.

kXMLTypeCode

ASExpT.h:1808
Value:ASFourCharCode('TEXT')

XML file.

ASFixed

83 items

Functions(10)

ASFixedMatrixConcat

void ASFixedMatrixConcat(ASFixedMatrixP result, const ASFixedMatrix *m1, const ASFixedMatrix *m2)
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

ASFixedMatrixInvert

void ASFixedMatrixInvert(ASFixedMatrixP result, const ASFixedMatrixP m)
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

ASFixedMatrixTransform

void ASFixedMatrixTransform(ASFixedPointP result, const ASFixedMatrixP m, const ASFixedPointP p)
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

ASFixedMatrixTransformRect

void ASFixedMatrixTransformRect(ASFixedRectP result, const ASFixedMatrixP m, const ASFixedRectP rectIn)
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

ASFixedToCString

void ASFixedToCString(ASFixed f, char *s, os_size_t maxLength, ASSmallCount precision)
ASProcs.h:542

Converts a fixed number to a CString . The precision for Mac OS numbers is valid to 9 significant digits.

Parameters
f: 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

The number of digits to retain in the converted number.

Returns
void

ASFixedToFloat

float ASFixedToFloat(ASFixed inASFixed)
ASProcs.h:2617

Converts an ASFixed to a float .

Parameters
inASFixed: ASFixed

IN The ASFixed value to convert.

Returns
float

The float representation of the ASFixed value.

FloatToASFixed

ASFixed FloatToASFixed(double inFloat)
ASProcs.h:2626

Converts a float to an ASFixed value.

Parameters
inFloat: double

IN The float value to convert.

Returns
ASFixed

The ASFixed representation of the float value.

Typedefs(2)

ASFixed

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 .

Definitions(71)

ASFixedRectIsEmptyRect

ASExpT.h:1147
Value:(((r).left == fixedPositiveInfinity && (r).right == fixedNegativeInfinity && \&#10; (r).bottom == fixedPositiveInfinity && (r).top == fixedNegativeInfinity) || \&#10; ((r).left == emptyFixedRect.left && (r).right == emptyFixedRect.right && \&#10; (r).bottom == emptyFixedRect.bottom && (r).top == emptyFixedRect.top))

ASUns16ToFixed

ASExpT.h:741
Value:(((i) > 32767) ? ASFixedPosInf : ((ASFixed)(i) << 16))

FixedMatrix

CoreExpT.h:254
Value:..Use.ASFixedMatrix.instead..

FixedMatrixP

CoreExpT.h:255
Value:..Use.ASFixedMatrixP.instead..

FixedPointP

CoreExpT.h:250
Value:..Use.ASFixedPointP.instead..

FixedQuad

CoreExpT.h:252
Value:..Use.ASFixedQuad.instead..

FixedQuadP

CoreExpT.h:253
Value:..Use.ASFixedQuadP.instead..

FixedRectP

CoreExpT.h:251
Value:..Use.ASFixedRectP.instead..

FloatIToFixed

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

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

fixedEight

ASExpT.h:989
Value:((ASFixed)0x00080000L)

fixedFifty

ASExpT.h:1024
Value:((ASFixed)0x00320000L)

fixedFive

ASExpT.h:974
Value:((ASFixed)0x00050000L)

fixedFour

ASExpT.h:969
Value:((ASFixed)0x00040000L)

fixedHalf

ASExpT.h:889
Value:((ASFixed)0x00008000L)

fixedNine

ASExpT.h:994
Value:((ASFixed)0x00090000L)

fixedOne

ASExpT.h:919
Value:((ASFixed)0x00010000L)

fixedOne1

ASExpT.h:914
Value:((ASFixed)0x0000ffffL)

fixedPi2

ASExpT.h:949
Value:((ASFixed)0x00019220L)

fixedPi4

ASExpT.h:904
Value:((ASFixed)0x0000c910L)

fixedSeven

ASExpT.h:984
Value:((ASFixed)0x00070000L)

fixedSix

ASExpT.h:979
Value:((ASFixed)0x00060000L)

fixedTen

ASExpT.h:999
Value:((ASFixed)0x000A0000L)

fixedTenth

ASExpT.h:869
Value:((ASFixed)0x00001999L)

fixedThird

ASExpT.h:884
Value:((ASFixed)0x00005555L)

fixedThree

ASExpT.h:964
Value:((ASFixed)0x00030000L)

fixedTwo

ASExpT.h:959
Value:((ASFixed)0x00020000L)

fixedZero

ASExpT.h:849
Value:((ASFixed)0x00000000L)

ASMem

3 items

Functions(3)

ASfree

void ASfree(void *ptr)
ASProcs.h:115

Frees the specified memory block.

Parameters
ptr: void *

IN/OUT The block of memory to free.

Returns
void

ASmalloc

void * ASmalloc(os_size_t nBytes)
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

void * ASrealloc(void *ptr, os_size_t newNBytes)
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

ASPlatformPath

14 items

Functions(7)

ASPathFromPlatformPath

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

The ASPathName corresponding to platformPath .

ASPlatformPathGetCFURLRefRecPtr

ASProcs.h:2389

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(). Do not release the returned value, or any member data of an ASPlatformPath directly; use ASFileSysReleasePlatformPath() when finished with the object.

Parameters
path: ASPlatformPath

The platform path.

Returns
CFURLRefRec_Ptr

A pointer to a structure containing a CFURLRef.

ASPlatformPathGetCstringPtr

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(). Applications should use this as a read-only pointer; modifying the returned buffer can corrupt the ASPlatformPath. Do not free the pointer. Do not release the returned value, or any member data of an ASPlatformPath directly; use ASFileSysReleasePlatformPath() when finished with the object.

Parameters
path: ASPlatformPath

The platform path.

Returns
Cstring_Ptr

A pointer to a C string of a platform-specific path.

ASPlatformPathGetFSRefPtr

ASProcs.h:2354

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(). Do not release the returned value, or any member data of an ASPlatformPath directly; use ASFileSysReleasePlatformPath() when finished with the object.

Parameters
path: ASPlatformPath

The platform path.

Returns
FSRef_Ptr

A pointer to an FSRef.

ASPlatformPathGetFSRefWithCFStringRefRecPtr

ASProcs.h:2373

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(). Do not release the returned value, or any member data of an ASPlatformPath directly; use ASFileSysReleasePlatformPath() when finished with the object.

Parameters
path: ASPlatformPath

The platform path.

Returns
FSRefWithCFStringRefRec_Ptr

A pointer to a structure containing an FSRef and a CFStringRef.

ASPlatformPathGetFSSpecPtr

ASProcs.h:2336

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(). Do not release the returned value, or any member data of an ASPlatformPath directly; use ASFileSysReleasePlatformPath() when finished with the object. Platform: (!MAC_PLATFORM || (MAC_PLATFORM && !AS_ARCH_64BIT))

Parameters
path: ASPlatformPath

The platform path.

Returns
FSSpec_Ptr

A pointer to an FSSpec.

ASPlatformPathGetPOSIXPathPtr

ASProcs.h:2406

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(). Do not release the returned value, or any member data of an ASPlatformPath directly; use ASFileSysReleasePlatformPath() when finished with the object.

Parameters
path: ASPlatformPath

The platform path.

Returns
POSIXPath_Ptr

A pointer to a POSIX path (UTF-8 encoding) as a C string.

Typedefs(4)

Structures(3)

ASPlatformPath

typedef struct _t_ASPlatformPath* ASPlatformPath
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().

ASStm

15 items

Functions(8)

ASProcStmRdOpen

ASStm ASProcStmRdOpen(ASStmProc readProc, void *clientData)
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

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

The newly created ASStm.

ASProcStmRdOpenEx

ASStm ASProcStmRdOpenEx(ASProcStmRdExHandler handler, void *clientData)
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

The newly created ASStm.

ASProcStmWrOpen

ASStm ASProcStmWrOpen(ASStmProc writeProc, ASProcStmDestroyProc destroyProc, void *clientData)
ASProcs.h:1536

Creates an ASStm from an arbitrary data-producing procedure. The stream does not support seek operations.

Parameters
writeProc: ASStmProc

A user-supplied callback that provides the data for the stream.

destroyProc: 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

The newly created ASStm.

ASStmRead

ASTCount ASStmRead(char *ptr, ASTArraySize itemSize, ASTCount nItems, ASStm stm)
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

The number of bytes in a stream item. See the description of nItems for further information.

nItems: 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

The stream from which data is read.

Returns
ASTCount

The number of items (not bytes) read.

See Also

ASStmWrite

ASTCount ASStmWrite(const char *ptr, ASTArraySize itemSize, ASTCount nItems, ASStm stm)
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

The number of bytes in a stream item. See the description of nItems for additional information.

nItems: 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

The stream into which data is written.

Returns
ASTCount

The number of items (not bytes) written.

See Also

Typedefs(5)

ASProcStmGetLength

typedef ASFilePos64(* ASProcStmGetLength) (void *clientData))(void *clientData)
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.

ASProcStmSeekProc

typedef void(* ASProcStmSeekProc) (ASFilePos64 newPos, void *clientData))(ASFilePos64 newPos, void *clientData)
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.

ASStmProc

typedef ASTCount(* ASStmProc) (char *data, ASTArraySize nData, void *clientData))(char *data, ASTArraySize nData, void *clientData)
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.

Structures(2)

ASStm

typedef struct _t_ASStmRec * ASStm
ASExpT.h:305

ASText

68 items

Functions(53)

ASHostMBLen

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

The host encoding type.

byte: ASUns8

The first byte of a multi-byte character.

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

ASIsValidUTF8

ASBool ASIsValidUTF8(const ASUns8 *cIn, ASCount cInLen)
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 *

The string.

cInLen: ASCount

The length of the string in bytes, not including the NULL byte at the end.

Returns
ASBool

true if the bytes in the string conform to the Unicode UTF-8 encoding form, false otherwise.

ASTextCat

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

IN/OUT The encoded text to which from is appended.

from: ASConstText

IN/OUT The encoded text to be appended to to .

Returns
void

ASTextCatMany

void ASTextCatMany(ASText to,...)
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

IN/OUT The ASText object to which the subsequent ASText arguments are concatenated.

: ...
Returns
void

ASTextCmp

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

The first text object.

str2: ASConstText

The second text object.

Returns
ASInt32

A negative number if str1 < str2 , a positive number if str1 > str2 , and 0 if they are equal.

ASTextEval

void ASTextEval(ASText theText, ASCab params)
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

A text object containing percent-quoted expressions to replace.

params: ASCab

The ASCab containing the key/value pairs to use for text replacement.

Returns
void

None.

ASTextFromPDText

ASText ASTextFromPDText(const char *str)
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

An ASText object.

ASTextFromSizedPDText

ASText ASTextFromSizedPDText(const char *str, ASTArraySize length)
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

The length in bytes.

Returns
ASText

An ASText object.

ASTextFromSizedScriptText

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

The length in bytes.

script: ASScript

The specified script.

Returns
ASText

An ASText object.

ASTextFromSizedUnicode

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 *

The Unicode string

format: ASUnicodeFormat

The Unicode format of ucs .

len: ASTArraySize

The length of ucs in bytes.

Returns
ASText

An ASText object.

ASTextGetBestEncoding

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

An ASText string.

preferredEncoding: ASHostEncoding

The preferred encoding. There is no default.

Returns
ASHostEncoding

The text encoding.

ASTextGetBestScript

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

IN/OUT An ASText string.

preferredScript: ASScript

IN/OUT The preferred host script. There is no default.

Returns
ASScript

The best host script.

ASTextGetEncoded

const char * ASTextGetEncoded(ASConstText str, ASHostEncoding encoding)
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

IN/OUT An ASText object.

encoding: ASHostEncoding

IN/OUT The specified host encoding.

Returns
const char *

A pointer to a NULL -terminated string corresponding to the text in str .

ASTextGetPDTextCopy

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

A string.

len: 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

const char * ASTextGetScriptText(ASConstText str, ASScript script)
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

IN/OUT A string.

script: ASScript

IN/OUT The writing script.

Returns
const char *

A string.

ASTextGetScriptTextCopy

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

A string.

script: ASScript

A writing script.

Returns
char *

A string copy. The client owns the resulting information.

ASTextGetUnicode

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

A string.

Returns

ASTextGetUnicodeCopy

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

A string.

format: ASUnicodeFormat

The Unicode format.

Returns
ASUTF16Val *

A string copy. The client owns the resulting information.

ASTextIsEmpty

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

A string.

Returns
ASBool

Returns true if the ASText object contains no text.

ASTextNormalizeEndOfLine

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

An object of type ASText.

Returns
void

ASTextReplace

void ASTextReplace(ASText src, ASConstText toReplace, ASConstText replacement)
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

Source text.

toReplace: ASConstText

Text in source text to replace.

replacement: ASConstText

Text used in replacement.

Returns
void

ASTextReplaceASCII

void ASTextReplaceASCII(ASText src, const char *toReplace, ASConstText replacement)
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

The ASText object containing the text.

toReplace: const char *

The text to replace.

replacement: ASConstText

The replacement text.

Returns
void

ASTextReplaceBadChars

void ASTextReplaceBadChars(ASText str, const char *pszBadCharList, char replaceChar)
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

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

ASTextSetPDText

void ASTextSetPDText(ASText str, const char *text)
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

A string.

text: const char *

A text string.

Returns
void

ASTextSetScriptText

void ASTextSetScriptText(ASText str, const char *text, ASScript script)
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

IN/OUT A string.

text: const char *

IN/OUT A pointer to the text string.

script: ASScript

IN/OUT The writing script.

Returns
void

ASTextSetSizedEncoded

void ASTextSetSizedEncoded(ASText str, const char *text, ASTArraySize len, ASHostEncoding encoding)
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

IN/OUT A string.

text: const char *

IN/OUT A pointer to the text string.

len: ASTArraySize

IN/OUT The length of the text string.

encoding: ASHostEncoding

IN/OUT The host encoding type.

Returns
void

ASTextSetSizedPDText

void ASTextSetSizedPDText(ASText str, const char *text, ASTArraySize length)
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

A string.

text: const char *

A pointer to a text string.

length: ASTArraySize

The length of the text string.

Returns
void
See Also

ASTextSetSizedScriptText

void ASTextSetSizedScriptText(ASText str, const char *text, ASTArraySize len, ASScript script)
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

IN/OUT A string.

text: const char *

IN/OUT A pointer to the text string.

len: ASTArraySize

IN/OUT The length of the text string.

script: ASScript

IN/OUT The writing script.

Returns
void

ASTextSetSizedUnicode

void ASTextSetSizedUnicode(ASText str, const ASUTF16Val *ucsValue, ASUnicodeFormat format, ASTArraySize len)
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

(Filled by the method) A string.

ucsValue: const ASUTF16Val *

A Unicode string.

format: ASUnicodeFormat

The Unicode format.

len: ASTArraySize

The length of the string in bytes.

Returns
void

ASUCS_GetPasswordFromUnicode

void ASUCS_GetPasswordFromUnicode(ASUTF16Val *inPassword, void **outPassword, ASBool useUTF)
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 *

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

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)

ASHostEncoding

ASExpT.h:3874

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.

ASUTF16Val

ASExpT.h:3892

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.

ASUTF8Val

ASExpT.h:3897

An ASUTF8Val holds a single 8-bit value from a UTF-8 encoded Unicode string.

Structures(2)

ASText

typedef struct _t_ASTextRec* ASText
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.

Definitions(1)

ASTextEqual

ASExtraCalls.h:111
Value:(ASTextCmp((a), (b)) == 0)

ASTimeSpan

15 items

Functions(13)

ASGetSecs

ASProcs.h:1963

Returns the number of seconds elapsed since midnight, January 1, 1970, coordinated universal time, up to the current time.

Parameters
: void
Returns
ASCount

See above.

ASTimeSpanDiff

void ASTimeSpanDiff(const ASTimeSpan timeSpan1, const ASTimeSpan timeSpan2, ASTimeSpan result)
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

The first time span.

timeSpan2: const ASTimeSpan

The second time span.

result: ASTimeSpan

The time span object in which to store the difference.

Returns
void

ASTimeSpanSet

void ASTimeSpanSet(ASTimeSpan timeSpan, ASInt32 highBits, ASUns32 lowBits)
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

The time span object.

highBits: ASInt32

The most significant word in the desired 64-bit signed integer value.

lowBits: ASUns32

The least significant word in the desired 64-bit signed integer value.

Returns
void

ASTimeSpanSetFromString

void ASTimeSpanSetFromString(ASTimeSpan timeSpan, const char *numSecondsString)
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

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

Structures(1)

ASTimeSpan

typedef struct _t_ASTimeSpanRec* ASTimeSpan
ASExpT.h:4081

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)

ASUUID

6 items

Functions(5)

ASUUIDFromCString

ASBool ASUUIDFromCString(ASUUID *dst, const char *str)
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

true if the UUID is successfully created, false otherwise.

ASUUIDGenFromName

ASBool ASUUIDGenFromName(ASUUID *dst, const ASUUID *ns, void *name, ASByteCount bytes)
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

The number of bytes in name .

Returns
ASBool

true if the UUID is successfully created, false otherwise.

ASUUIDToCString

void ASUUIDToCString(char *dst, const ASUUID *src)
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

Definitions(1)

ASUUIDMaxStringLen

ASExpT.h:4001
Value:40 /* leave a bit of padding just in case */

A constant for the maximum string length of a unique identifier (UUID).

See Also

General

105 items

Functions(2)

ASGetConfiguration

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

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:

Typedefs(47)

ASEnum16

CoreExpT.h:75

2-byte enumeration with values from 0 to 32,767 , used in data structures.

ASEnum8

typedef ASUns8 ASEnum8
CoreExpT.h:70

1-byte enumeration with values from 0 to 127 , used in data structures.

ASInt16

typedef short int ASInt16
ASNumTypes.h:49

2-byte signed short numeric value.

ASInt32

typedef int ASInt32
ASNumTypes.h:54

4-byte signed long numeric value.

ASInt64

typedef signed long long int ASInt64
ASNumTypes.h:59

8-byte signed long numeric value.

ASInt8

typedef signed char ASInt8
ASNumTypes.h:45

1-byte signed char value.

ASUns16

typedef unsigned short int ASUns16
ASNumTypes.h:86

2-byte unsigned short numeric value.

ASUns32

typedef unsigned int ASUns32
ASNumTypes.h:91

4-byte unsigned long numeric value.

ASUns64

typedef unsigned long long int ASUns64
ASNumTypes.h:96

8-byte unsigned long numeric value.

ASUns8

typedef unsigned char ASUns8
ASNumTypes.h:82

1-byte unsigned char value.

ASCancelProc

typedef ASBool(* ASCancelProc) (void *clientData))(void *clientData)
ASExpT.h:3699

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.

ASReportProc

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

PMBeginOperationProc

typedef void(* PMBeginOperationProc) (void *clientData))(void *clientData)
ASExpT.h:3551

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.

PMEndOperationProc

typedef void(* PMEndOperationProc) (void *clientData))(void *clientData)
ASExpT.h:3563

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.

PMSetCurrValueProc

typedef void(* PMSetCurrValueProc) (ASDuration currValue, void *clientData))(ASDuration currValue, void *clientData)
ASExpT.h:3593

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.

PMSetDurationProc

typedef void(* PMSetDurationProc) (ASDuration duration, void *clientData))(ASDuration duration, void *clientData)
ASExpT.h:3578

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.

PMSetTextProc

typedef void(* PMSetTextProc) (ASText text, void *clientData))(ASText text, void *clientData)
ASExpT.h:3631

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)

Values
kPDFLFlattenProg_EnterInFlattener
—
kPDFLFlattenProg_FindObjectsInvolvedInTransparency
—
kPDFLFlattenProg_TextHeuristics
—
kPDFLFlattenProg_IdentifyingComplexityRegion
—
kPDFLFlattenProg_ComputingComplexityRegionClippath
—
kPDFLFlattenProg_EnterInPlanarMap
—
kPDFLFlattenProg_FlattenAtomicRegions
—
kPDFLFlattenProg_RasterizingComplexityRegion
—
Values
kPDFLRenderProg_Unknown
—
kPDFLRenderProg_Stage1
—
kPDFLRenderProg_Stage2
—
kPDFLRenderProg_Stage3
—
kPDFLRenderProg_Stage4
—
kPDFLRenderProg_Stage5
—
kPDFLRenderProg_Stage6
—
kPDFLRenderProg_Stage7
—
kPDFLRenderProg_Stage8
—
kPDFLRenderProg_Stage9
—

Definitions(54)

ASMAXInt32

ASNumTypes.h:70
Value:((ASInt32)0x7FFFFFFF)

ASMAXInt64

ASNumTypes.h:74
Value:((ASInt64)0x7FFFFFFFFFFFFFFFLL)

ASMAXUns32

ASNumTypes.h:112
Value:((ASUns32)0xFFFFFFFF)

ASMAXUns64

ASNumTypes.h:116
Value:((ASUns64)0xFFFFFFFFFFFFFFFFLL)

ASMAXUns8

ASNumTypes.h:104
Value:((ASUns8)0xFF)

ASMINInt32

ASNumTypes.h:72
Value:((ASInt32)0x80000000)

ASMINInt64

ASNumTypes.h:76
Value:((ASInt64)0x8000000000000000LL)

ASMINUns32

ASNumTypes.h:114
Value:((ASUns32)0x00000000)

ASMINUns64

ASNumTypes.h:118
Value:((ASUns64)0x0000000000000000LL)

ASMINUns8

ASNumTypes.h:106
Value:((ASUns8)0x00)

AS_ARCH_64BIT

ASNumTypes.h:35
Value:1

ASNumTypes.h defines basic integer types.

AS_ARCH_64BIT

ASNumTypes.h:37
Value:0

ASNumTypes.h defines basic integer types.

FALSE

ASNumTypes.h:143
Value:0

HugePtr

CoreExpT.h:129
Value:char HUGEPTRTYPE *

NULL

CoreExpT.h:109
Value:((void *)0)

TRUE

ASNumTypes.h:139
Value:1

UNDEFINED_CONFIGURATION_SELECTOR

CoreExpT.h:204
Value:((void *)-1)

This constant is returned by ASGetConfiguration() when the selector passed in is unknown to the application.

false

ASNumTypes.h:134
Value:0

true

ASNumTypes.h:131
Value:1

HFT

17 items

Functions(9)

HFTDestroy

void HFTDestroy(HFT hft)
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

The HFT to destroy.

Returns
void
See Also

HFTGetReplacedEntry

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

The HFT in which a replaced entry is retrieved. See HFTReplaceEntry() for more information.

sel: Selector

The selector whose previous value is obtained. See HFTReplaceEntry() for more information.

oldEntry: HFTEntry

The HFTEntry for which the previous value is obtained.

Returns
HFTEntry

The entry present prior to being replaced. NULL is returned if the entry has not been replaced.

HFTGetVersion

ASProcs.h:2485

Returns the version of the HFT, if available.

Parameters
hft: HFT

The HFT whose version is obtained.

Returns
ASVersion

The version number if the HFT is valid and the version is available, HFT_ERROR_NO_VERSION otherwise.

See Also

HFTNew

HFT HFTNew(HFTServer hftServer, ASTCount numSelectors)
ASProcs.h:219

Obsolete. See HFTNewEx(). Creates a new HFT by calling the specified HFT server's HFTServerProvideHFTProc().

Parameters
hftServer: HFTServer

The HFT server for the HFT being created. The HFT server must have been created previously using HFTServerNew().

numSelectors: 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

The newly created HFT.

HFTNewEx

HFT HFTNewEx(HFTServer hftServer, HFTData data)
ASProcs.h:2509

Extends HFTNew() with version information in Acrobat 6. Creates a new HFT by calling the specified HFT server's HFTServerProvideHFTProc().

Parameters
hftServer: HFTServer

The HFT server for the HFT being created. The HFT server must have been created previously using HFTServerNew().

data: 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

The newly created HFT.

HFTReplaceEntry

void HFTReplaceEntry(HFT hft, Selector sel, HFTEntry newEntry, ASFlagBits flags)
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. The CALL_REPLACED_PROC macro is available to call the previous HFT entry function that was replaced.

Parameters
hft: 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

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

The function to replace the current one. The function pointer must be converted to an HFTEntry using the ASCallbackCreateReplacement() macro.

flags: ASFlagBits

The new entry's properties. Currently, only HFTEntryReplaceable is defined.

Returns
void

HFTReplaceEntryEx

void HFTReplaceEntryEx(HFT hft, Selector sel, HFTEntry newEntry, ASExtension extension, ASFlagBits flags)
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. The CALL_REPLACED_PROC macro is available to call the previous HFT entry function that was replaced.

Parameters
hft: 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

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

The function to replace the current one. The function pointer must be converted to an HFTEntry using the ASCallbackCreateReplacement() macro.

extension: 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

The new entry's properties. Currently, only HFTEntryReplaceable is defined.

Returns
void

HFTUnreplaceEntry

void HFTUnreplaceEntry(HFT hft, Selector sel, HFTEntry oldEntry, ASExtension extension)
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

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

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

The old function to be replaced. The function pointer must be converted to an HFTEntry using the ASCallbackCreateReplacement() macro.

extension: ASExtension

An object of type ASExtension.

Returns
void

Typedefs(4)

HFT

typedef HFTEntry* HFT
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. 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.

HFTEntry

typedef void* HFTEntry
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

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)

HFTEntryReplaceable

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

HFTServer

5 items

Functions(2)

HFTServerNew

HFTServer HFTServerNew(const char *name, HFTServerProvideHFTProc serverProc, HFTServerDestroyProc destroyProc, void *clientData)
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

(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

(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

The newly created HFT server.

Typedefs(2)

HFTServerProvideHFTProc

typedef HFT(* HFTServerProvideHFTProc) (HFTServer hftServer, ASVersion version, void *rock))(HFTServer hftServer, ASVersion version, void *rock)
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. The version numeric type has changed in Acrobat 6.0.

See Also

Structures(1)

HFTServer

typedef struct _t_HFTServer* HFTServer
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.