Layer

COS Layer

12 components137 items
109 Functions 7 Definitions 19 Typedefs 1 Structures 1 Enums

CosArray

9 items

Functions(9)

CosArrayInsert

CosProcs.h:844

Inserts an object into an array. An exception is raised if the object to insert is a direct object that is already contained in another object, or if the object to insert belongs to another document. It is not safe to callduring a call toon that same array (for example, from within the callback procedure).

Parameters
array: CosObj

The array into which the object is inserted.

pos: ASTArraySize

The location in the array to insert the object. The object is inserted before the specified location. The first element in an array has a pos of zero. If,is added at the end of the array. The length of the array always increases by.

obj: CosObj

The object to insert.

Returns
void

CosArrayPut

void CosArrayPut(CosObj array, ASTArraySize index, CosObj obj)
CosProcs.h:818

Puts the specified object into the specified location in an array. The array is extended as much as necessary andobjects are stored in empty slots. It sets theflag (see) flag of theobject's CosDoc ifis indirect or is a direct object with an indirect composite object at the root of its container chain. It is not safe to callduring a call toon that same array (for example, from within the callback procedure), if doing so would extend the length of the array. An exception is raised if the object to insert is a direct object that is already contained in another object, or if the object to insert belongs to another document.

Parameters
array: CosObj

The array in whichis stored.

index: ASTArraySize

The location into store. The first element of an array has an index of zero.

obj: CosObj

The Cos object to insert into.

Returns
void

CosArrayRemove

void CosArrayRemove(CosObj array, CosObj obj)
CosProcs.h:865

Finds the first element, if any, equal to the specified object and removes it from the array.is used to determine whether an array element is equal to the specified object. The array is compressed after removing the element. The compression is accomplished by moving each element following the deleted element to the slot with the next smaller index and decrementing the array's length by. It is not safe to callduring a call toon that same dictionary (for example, from within the callback procedure).

Parameters
array: CosObj

The array from whichis removed.

obj: CosObj

The object to remove.

Returns
void
See Also

CosArrayRemoveNth

CosProcs.h:1344

Checks whether the position is within the array bounds, removes it from the array, moves each subsequent element to the slot with the next smaller index, and decrements the array's length by. It sets theflag of theobject's.

Parameters
array: CosObj

IN/OUT Thefrom which to remove the member.

pos: ASTArraySize

IN/OUT The index for the array member to remove. Array indices start at.

Returns
void
See Also

CosArraySetWeakReference

CosProcs.h:2099

Establishes or removes a weak reference from an array. For a description of weak references, see.

Parameters
array: CosObj

An array.

n: ASInt32

The index of the element that is the weak reference. Note that the weak referencewith the element; that is, if an item is marked as a weak reference, and an item is subsequently inserted before that item, the weak reference applies to the same element as it did previously.

isWeak: ASBool

Sets a weak reference for an array.

Returns
void

CosNewArray

CosObj CosNewArray(CosDoc dP, ASBool indirect, ASTArraySize nElements)
CosProcs.h:255

Creates and returns a new array Cos object.

Parameters
dP: CosDoc

The document in which the array is used.

indirect: ASBool

If, it creates the array as an indirect Cos object, and sets the document'sflag (see). If, it creates the array as a direct object.

nElements: ASTArraySize

The number of elements that will be in the array.is only a hint; Cos arrays grow dynamically as needed.

Returns
CosObj

The newly created array Cos object.

CosBoolean

2 items

Functions(2)

CosNewBoolean

CosObj CosNewBoolean(CosDoc dP, ASBool indirect, ASBool value)
CosProcs.h:194

Creates a new boolean object associated with the specified document and having the specified value.

Parameters
dP: CosDoc

IN The document in which the boolean is used.

indirect: ASBool

IN If, it creates the boolean object as an indirect object, and sets the document () object'sflag (see). If, it creates the boolean object as a direct object.

value: ASBool

IN The value the new boolean object will have.

Returns
CosObj

A Cos boolean object.

CosCrypt

7 items

Functions(5)

CosDecryptData

void CosDecryptData(void *src, ASTArraySize len, void *dst, char *cryptData, ASTArraySize cryptDataLen)
CosProcs.h:1005

Decrypts data in a buffer using the specified encryption key. The standard Acrobat viewer encryption/decryption algorithm (RC4 from RSA Data Security, Inc.) is used. An exception is raised if encryption encounters an internal error.

Parameters
src: void *

The buffer containing the data to decrypt.

len: ASTArraySize

The number of bytes in.

dst: void *

(Filled by the method) The buffer into which the decrypted data will be placed. This may point to the same location as.

cryptData: char *

The encryption key.

cryptDataLen: ASTArraySize

The length of the encryption key in bytes. It cannot be greater than.

Returns
void
See Also

CosDecryptGetMaxKeyBytes

CosProcs.h:1406

Gets the maximum number of the decryption key length, in bytes, for the specified.

Parameters
cryptVersion: ASTVersion

IN/OUT The Cos crypt version, which is the version
of the algorithm that is used to encrypt and decrypt document
data.equal tois treated asequal toto maintain backward compatibility.

Returns
CosByteMax

The maximum number of key length, in bytes, for the specified. Ifis not currently supported, it returns.

CosEncryptData

void CosEncryptData(void *src, ASTArraySize len, void *dst, char *cryptData, ASTArraySize cryptDataLen)
CosProcs.h:1027

Encrypts data in a buffer using the specified encryption key. The standard Acrobat viewer encryption/decryption algorithm (RC4 from RSA Data Security, Inc.) is used. An exception is raised if encryption encounters an internal error.

Parameters
src: void *

The buffer containing the data to encrypt.

len: ASTArraySize

The number of bytes in.

dst: void *

(Filled by the method) The buffer into which the encrypted data will be placed. This may point to the same location as.

cryptData: char *

The encryption key.

cryptDataLen: ASTArraySize

Length of the encryption key, in bytes. It cannot be greater than.

Returns
void
See Also

CosEncryptGetMaxKeyBytes

CosProcs.h:1422

Gets the maximum number of the encryption key length, in bytes, for the specified.

Parameters
cryptVersion: ASTVersion

IN/OUT The Cos crypt version, which is the version
of the algorithm that is used to encrypt and decrypt document
data.equal tois treated asequal toto maintain backward compatibility.

Returns
CosByteMax

The maximum number of key length, in bytes, for the specified. Ifis not currently supported, it returns.

Typedefs(2)

CosDict

15 items

Functions(15)

CosDictGet

CosProcs.h:633

Gets the value of the specified key in the specified dictionary. If it is called with a stream object instead of a dictionary object, this method gets the value of the specified key from the stream's attributes dictionary. @note Use CosObjEnum() to list all key-value pairs in a dictionary. @since

Parameters
dict: CosObj

The dictionary or stream from which a value
is obtained.

key: ASAtom

The key whose value is obtained, repesented as an ASAtom.
See the description of "Dictionary Objects" in ISO 32000-1:2008,
Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.3.7, page 18.
You can find this document on the web store of the International Standards Organization (ISO).
Here you will find the names of keys in dictionary objects
that are part of standard PDF, such as annotations or page
objects (for example,).

Note that strings can be used directly as keys, by calling(for example, CosDictGetKeyString(dict, "Length")
). This method is preferred, because it avoids the creation of new ASAtom objects.

Even though key names in a PDF file are written with
a leading slash (e.g.,), the slash is omitted
when creating anto be used as a key, or when using the
string directly as a key, as in the examples above.

Cos name objects can also be used as keys, by calling.
This method will also avoid the creation of newobjects and is often
more convenient than usingobjects or strings.is
not present or if its value is(which is equivalent), it returns
aCos object (a Cos object of type.)

Returns

CosDictGetKey

CosProcs.h:1917

Gets the value of the specified key in the specified dictionary. For more details, see.

Parameters
dict: CosObj

The dictionary or stream from which a value is obtained.

key: CosObj

The key whose value is obtained, represented as a Cos name object.

Returns
CosObj

The object associated with the specified key. Ifis not present, it returns aCos object.

CosDictGetKeyString

CosObj CosDictGetKeyString(CosObj dict, const char *key)
CosProcs.h:1981

Gets the value of the specified key in the specified dictionary. For more details, see.

Parameters
dict: CosObj

The dictionary or stream from which a value is obtained.

key: const char *

The key whose value is obtained, represented as a string.

Returns
CosObj

The object associated with the specified key. If key is not present, returns aCos object.

CosDictIsWeakReference

ASBool CosDictIsWeakReference(CosObj dict, const char *key)
CosProcs.h:2084

Gets the state of a weak reference. For details, see.

Parameters
dict: CosObj

A dictionary.

key: const char *

The name of a key.

Returns
ASBool

Returns the value of theparameter in the most recent call to CosDictSetWeakReference() with these parameters, orif there has been no such call.

CosDictKnown

CosProcs.h:775

Tests whether a specific key is found in the specified dictionary. Calling this method is equivalent to checking if the value returned fromis aCos object. If it is called with a stream object instead of a dictionary object, this method tests whether the specified key is found in the stream's attributes dictionary. You can find this document on the web store of the International Standards Organization (ISO). Here you will find the names of keys in dictionary objects that are part of standard PDF, such as annotations or page objects (seefor). Note that strings can be used directly as keys, by calling(for example,). This method is preferred, because it avoids the creation of newobjects. Cos name objects can also be used as keys, by calling. This method will also avoid the creation of newobjects and is often more convenient than usingobjects or strings.

Parameters
dict: CosObj

The dictionary or stream in which to look for.

key: ASAtom

The key to find. See the description of "Dictionary Objects" in ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.3.7, page 18.

Returns
ASBool

if the value of a key is known (exists and is not) in,otherwise.

CosDictKnownKey

CosProcs.h:1933

Tests whether a specific key is found in the specified dictionary. Calling this method is equivalent to checking if the value returned fromis aCos object. For more details, see CosDictKnown().

Parameters
dict: CosObj

The dictionary or stream in which to look for.

key: CosObj

The key to find, represented as a Cos name object.

Returns
ASBool

if the value of a key is known (exists and is not) in,otherwise.

CosDictKnownKeyString

ASBool CosDictKnownKeyString(CosObj dict, const char *key)
CosProcs.h:1997

Tests whether a specific key is found in the specified dictionary. Calling this method is equivalent to checking if the value returned fromis aCos object. For more details, see.

Parameters
dict: CosObj

The dictionary or stream in which to look for key.

key: const char *

The key to find, represented as a string.

Returns
ASBool

if the value of a key is known (exists and is not) in,otherwise.

CosDictPut

void CosDictPut(CosObj dict, ASAtom key, CosObj val)
CosProcs.h:688

Sets the value of a dictionary key, adding the key to the dictionary if it is not already present. Sets theflag (see) of theobject'sifis indirect or is a direct object with an indirect composite object at the root of its container chain. This method can also be used with a stream object. In that case, the key-value pair is added to the stream's attributes dictionary. It is not safe to callduring a call toon that same dictionary (for example, from within the callback procedure). An exception is raised ifis a direct non-scalar object that is already contained in another dictionary, array, or stream, or ifandbelong to different documents. @note A dictionary entry whose value isis equivalent to an absent entry; usingto put avalue in a dictionary has the same effect as callingto remove it from the dictionary. @since

Parameters
dict: CosObj

The dictionary or stream in which a value
is set.

key: ASAtom

The key whose value is set, represented as an.
See the description of "Dictionary Objects" in ISO 32000-1:2008,
Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.3.7, page 18.
You can find this document on the web store of the International Standards Organization (ISO).
Here you will find the names of keys in dictionary objects that are part of
standard PDF, such as annotations or page objects (seefor)

Note that strings can be used directly as keys, by calling(for example,).
This method is preferred, because it avoids the creation of newobjects.

Cos name objects can also be used as keys, by calling.
This method will also avoid the creation of newobjects and is often
more convenient than using ASAtom objects or strings.

val: CosObj

The value to set.

Returns
void

CosDictPutKey

void CosDictPutKey(CosObj dict, CosObj key, CosObj val)
CosProcs.h:1955

Sets the value of a dictionary key, adding the key to the dictionary if it is not already present. For more details, see. It is not safe to callduring a call toon that same dictionary (for example, from within the callback procedure) An exception is raised ifis a direct non-scalar object that is already contained in another dictionary, array, or stream, or ifandbelong to different documents. @since

Parameters
dict: CosObj

The dictionary or stream in which a value is set.

key: CosObj

The key whose value is set, represented as a Cos name object.

val: CosObj

The value to set.

Returns
void

CosDictPutKeyString

void CosDictPutKeyString(CosObj dict, const char *key, CosObj val)
CosProcs.h:2018

Sets the value of a dictionary key, adding the key to the dictionary if it is not already present. For more details, see. It is not safe to callduring a call toon that same dictionary (for example, from within the callback procedure). An exception is raised ifis a direct non-scalar object that is already contained in another dictionary, array, or stream, or ifandbelong to different documents. @since

Parameters
dict: CosObj

The dictionary or stream in which a value is set.

key: const char *

The key whose value is set, represented as a string.

val: CosObj

The value to set.

Returns
void

CosDictRemove

void CosDictRemove(CosObj dict, ASAtom key)
CosProcs.h:735

Removes a key-value pair from a dictionary. Sets theflag (see) of theobject'sif the dictionary is indirect or has an indirect composite object at the root of its container chain. If it is called with a stream object instead of a dictionary object, this method removes the value of the specified key from the stream's attributes dictionary. It is not safe to callduring a call toon that same dictionary (for example, from within the callback procedure). If the key is not present in the dictionary,has no effect. You can find this document on the web store of the International Standards Organization (ISO). Here you will find the names of keys in dictionary objects that are part of standard PDF, such as annotations or page objects (seefor). Note that strings can be used directly as keys, by calling CosDictRemoveString() (for example,). This method is preferred, because it avoids the creation of newobjects. Cos name objects can also be used as keys, by calling. This method will also avoid the creation of newobjects and is often more convenient than usingobjects or strings.

Parameters
dict: CosObj

The dictionary from which the key-value pair is removed.

key: ASAtom

The key to remove, represented as an ASAtom. See the description of "Dictionary Objects" in ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.3.7, page 18.

Returns
void

CosDictSetWeakReference

void CosDictSetWeakReference(CosObj dict, const char *key, ASBool isWeak)
CosProcs.h:2073

andreferences. When a Cos document is saved in full-save mode, objects that are not accessible from the root of the document are destroyed. This process uses a mark-and-sweep garbage collector: the root is marked, and then every object to which it refers is marked, and so on. At the end of this marking phase, objects that are not marked are destroyed. A so-called weak reference changes this policy: during the marking phase, a reference that has been declared to be weak will not be marked. For example, when a dictionary is marked, all its keys and values are normally also marked. But if a certain key has been set as a weak reference, then the corresponding value will not be marked. Consequently, if there are no other references to that value, it will be destroyed. A so-called strong reference also changes this policy, but in the opposite direction. An object for which there is a strong reference will be marked (and therefore will not be garbage-collected), even if there is no path to the object from the root of the document, and even if a weak reference exists for it. establishes or removes a weak reference from a dictionary. It is not an error if there is no such value at the time of garbage collection or at the time of the call to this function. Ifis(the default condition), then there is no such behavior, and the value, if any, will be marked in the normal manner. The case whereis specified asis intended primarily to reverse the effect of a previous call in whichwas.

Parameters
dict: CosObj

The dictionary containing the weak reference.

key: const char *

The name of a key in the dictionary.

isWeak: ASBool

If, the object stored inunderat the time of every subsequent full-save garbage collection will not be marked as a component of the dictionary. If there is no other path to that object from the root of the document, then it will be garbage- collected (destroyed) by garbage collection.

Returns
void

CosNewDict

CosObj CosNewDict(CosDoc dP, ASBool indirect, ASTArraySize nEntries)
CosProcs.h:283

Creates a new dictionary. For information on dictionary objects in standard PDF files, such as annotations or page objects, see the description of "Dictionary Objects" in ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.3.7, page 18. You can find this document on the web store of the International Standards Organization (ISO).

Parameters
dP: CosDoc

The document in which the dictionary is used.

indirect: ASBool

If, it creates the dictionary as an
indirect Cos object, and sets theobject'sflag
(see). If, it creates the dictionary as a direct object.

nEntries: ASTArraySize

The number of entries in the dictionary. This value is only a hint; Cos dictionaries grow dynamically as needed.

Returns
CosObj

The newly created dictionary Cos object.

CosDoc

33 items

Functions(21)

CosDocClose

void CosDocClose(CosDoc cosDoc)
CosProcs.h:1074

Closes a Cos document. You should only call this method with a document obtained viato release resources used by the Cos document.

Parameters
cosDoc: CosDoc

IN/OUT The document to close.

Returns
void

CosDocCreate

CosProcs.h:1085

Creates an empty Cos document.

Parameters
createFlags: ASFlagBits

An inclusive OR of bit flags that specify the attributes of a CosDoc when created by. The only flag currently defined is, which creates an Info dictionary for the document.

Returns
CosDoc

An empty Cos document.

CosDocEnumEOFs

ASBool CosDocEnumEOFs(CosDoc cosDoc, CosDocEnumEOFsProc proc, void *clientData)
CosProcs.h:1274

Calls the specified procedure for each EOF in a given, where the EOF is a position in a PDF file after akeyword that marks the end of either a main cross-reference section, or an update cross-reference section that corresponds to an incremental save. Not everykeyword fits these criteria. For example, the firstin a linearized (optimized for the web) file does not, so its position is not be passed to. Ifwas created in memory (using CosDocCreate()), or if it was damaged and needed to be repaired, the procedure is not called at all. @returnif all of the calls toreturn.as soon as a call toreturns.

Parameters
cosDoc: CosDoc

Thein which the EOF's are enumerated.

proc: CosDocEnumEOFsProc

Theto call for each EOF.

clientData: void *

A pointer to user-supplied data to pass
toeach time it is called.

Returns

CosDocEnumEOFs64

ASBool CosDocEnumEOFs64(CosDoc cosDoc, CosDocEnumEOFsProc64 proc, void *clientData)
CosProcs.h:2210

Calls the specified procedure for each EOF in a given. For details, see. This is the same as, except that the callback proc takes a 64-bit file position instead of a 32-bit file position.

Parameters
cosDoc: CosDoc

Thein which the EOF's are enumerated.

proc: CosDocEnumEOFsProc64

Theto call for each EOF.

clientData: void *

A pointer to user-supplied data to pass toeach time it is called.

Returns
ASBool

if all of the calls toreturn,as soon as a call toreturns.

CosDocEnumIndirect

ASBool CosDocEnumIndirect(CosDoc dP, CosObjEnumProc proc, void *clientData)
CosProcs.h:1378

Enumerates all the indirect objects of a given. The objects are enumerated in no particular order. Successive enumerations of the same Cos document are not guaranteed to enumerate objects in the same order. This method does not enumerate invalid objects, which include objects that are defined as, objects that are not defined at all (those having no cross-reference entry), and objects that are on the free list. See the description of "Indirect Objects" in section 7.3.10 in ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.11.2, page 21. You can find this document on the web store of the International Standards Organization (ISO). This re-raises any exception thatraises.

Parameters
dP: CosDoc

Thewhose indirect objects are enumerated.

proc: CosObjEnumProc

A user-supplied callback to call for each indirect object in. Enumeration ends whenreturnsor all indirect objects have been enumerated. The value parameter returned inis always theCos object.

clientData: void *

A pointer to user-supplied data to pass toeach time it is called.

Returns
ASBool

if all of the calls toreturned. It returnsas soon as a call toreturns.

See Also

CosDocGetAdobeExtensionLevel

CosProcs.h:2442

Tests whether the suppliedcontains the Adobe Extensions Dictionary for the ISO 32000 standard, and if so, returns the BaseVersion and ExtensionLevel When the Extensions Dictionary is added to a PDF document, it allows PDF features provided in Adobe Acrobat after PDF version 1.7 to be used with that document. The version of the PDF file is drawn from the Extensions Dictionary instead of from the file header. See When the Extensions Dictionary is added to a PDF document, it allows PDF features provided in Adobe Acrobat after PDF version 1.7 to be used with that document. The version of the PDF file is drawn from the Extensions Dictionary instead of from the file header. See

Parameters
dP: CosDoc

IN The Cos document to test.

baseVersion: CosObj *

OUT The PDF version on which the extensions are based (will be of type).

extension: ASUns32 *

OUT The level of the extension expressed as a monotonically increasing integer.

Returns
ASBool

if the file contains the Adobe Extensions dictionary for the ISO 32000 standard,otherwise.

CosDocGetID

ASBool CosDocGetID(CosDoc dP, CosByte **pInstanceID, CosByte **pPermaID, ASTCount *instIDLength, ASTCount *permIDLength)
CosProcs.h:1506

Returns two ID byte arrays identifying the CosDoc. The client should copy these arrays before making the next call to Acrobat.

Parameters
dP: CosDoc

IN/OUT The CosDoc whose ID byte arrays are returned.

pInstanceID: CosByte **

IN/OUT (Filled by the method) The instance ID.

pPermaID: CosByte **

IN/OUT (Filled by the method) The permanent ID.

instIDLength: ASTCount *

IN/OUT The length ofin bytes.

permIDLength: ASTCount *

IN/OUT The length ofin bytes.

Returns
ASBool

if the ID is returned,otherwise.

CosDocGetObjByID

CosProcs.h:1200

Gets the indirectwith the latest generation number.

Parameters
dP: CosDoc

Theto search for the matching Cos object.

objNum: CosID

The local master index for the indirect Cos object to return.

Returns
CosObj

Thewith the latest generation number whose ID (object number) equals, or theobject if there is no object with this ID.

See Also

CosDocGetRoot

CosProcs.h:967

Gets the(the root object) for the specified document. See the description of the Document Catalog in "Common Data Structures" in ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.7.2, page 71. You can find this document on the web store of the International Standards Organization (ISO).

Parameters
dP: CosDoc

IN/OUT The document whoseis obtained.

Returns
CosObj

The document'sdictionary Cos object.

CosDocHasFullCompression

CosProcs.h:1798

Tests whether the Cos document is fully compressed. In a fully compressed document, most objects are stored in object streams, which are normally Flate-encoded to reduce the size of the PDF file. Cross-reference information for these objects is stored in cross-reference streams, which are also normally Flate-encoded. See the description of "Cross-Reference Streams" in ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.5.8, page 49. You can find this document on the web store of the International Standards Organization (ISO).

Parameters
doc: CosDoc

The document whose compression is checked.

Returns
ASBool

if the document is fully compressed,otherwise.

CosDocHasISOExtensions

CosProcs.h:2420

Tests whether the suppliedcontains the Adobe Extensions Dictionary for the ISO 32000 standard. When the Extensions Dictionary is added to a PDF document, it allows PDF features provided in Adobe Acrobat after PDF version 1.7 to be used with that document. The version of the PDF file is drawn from the Extensions Dictionary instead of from the file header. See When the Extensions Dictionary is added to a PDF document, it allows PDF features provided in Adobe Acrobat after PDF version 1.7 to be used with that document. The version of the PDF file is drawn from the Extensions Dictionary instead of from the file header. See

Parameters
dP: CosDoc

The Cos document to test.

Returns
ASBool

if the file contains the Adobe Extensions dictionary for the ISO 32000 standard,otherwise.

CosDocHasPartialCompression

CosProcs.h:1828

Tests whether the Cos document is partially compressed. In a partially compressed file, the size of the logical structure information is reduced. Current PDF viewers have full access to the structure information. In a partially compressed document, objects related to logical structure are stored in object streams, which are normally Flate-encoded to compress the document. Their cross-reference information is stored twice: in a cross-reference stream, to which there is a reference in the trailer of an update section, and in the main cross-reference table, which indicates that the objects are on the free list. See the description of "Cross-Reference Streams" in section 7.5.8 in ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, page 49. You can find this document on the web store of the International Standards Organization (ISO). See also the decription of the "Cross-Reference Table" in section 7.5.3, page 40.

Parameters
doc: CosDoc

The document whose compression is checked.

Returns
ASBool

if the document is partially compressed,otherwise.

CosDocObjIsWithinRange

ASBool CosDocObjIsWithinRange(CosObj obj, ASInt32 byteRanges[], ASInt32 numEntries)
CosProcs.h:1577

Tests whether the definition of a specified Cos object, in the file associated with the object's CosDoc, begins within any of a set of byte ranges. The test is inclusive; that is the object may begin at the first or last byte of a range. An exception is raised ifis a direct object oris an odd number.

Parameters
obj: CosObj

The Cos object (must be indirect).

byteRanges: ASInt32

An array containing pairs of byte offsets within the document. Each pair is a start and end offset from the beginning of the document.

numEntries: ASInt32

The number of byte offsets (not pairs) in thearray.

Returns
ASBool

if the object begins within any of the given ranges and has not been modified,otherwise.

CosDocObjIsWithinRange64

CosProcs.h:2263

Tests whether the definition of a specified Cos object, in the file associated with the object's, begins within any of a set of byte ranges. For details, see. This is the same as, except that the byte ranges are 64-bit file positions instead of a 32-bit file positions. An exception is raised ifis a direct object oris an odd number.

Parameters
obj: CosObj

The Cos object (must be indirect).

byteRanges: ASFilePos64

An array containing pairs of byte offsets within the document. Each pair is a start and end offset from the beginning of the document.

numEntries: ASInt32

The number of byte offsets (not pairs) in thearray.

Returns
ASBool

if the object begins within any of the given ranges and has not been modified,otherwise.

CosDocOpenWithParams

CosDoc CosDocOpenWithParams(CosDocOpenParams params)
CosProcs.h:1064

Opens a Cos document. The document does not need to be a PDF document. In, the client specifies a file system and path name from which to open the document. The client may also specify a header string other than. For example, a client might want to open a private file type, such as. Various exceptions may be raised. Opening non-Cos docs with this API is unsupported and may lock the file after an open attempt. If theflag is set in the open flags, a minimal document can be opened. A minimal document contains the header string and a trailer dictionary. It may contain indirect objects before the trailer dictionary, and the trailer dictionary can refer to those objects, as shown in the following example:

Parameters
params: CosDocOpenParams

Specifies how to open the document.

Returns
CosDoc

A Cos document.

See Also

CosDocSaveToFile

void CosDocSaveToFile(CosDoc cosDoc, ASFile asFile, CosDocSaveFlags saveFlags, CosDocSaveParams saveParams)
CosProcs.h:1131

Saves a Cos document to a file handle.will not generate an cross-reference table in the saved file. If you want the cross-reference to be generated, then you have to use, which generates the cross-reference table by default. Saves a Cos document to a file.will not generate a cross-reference index (table or stream) in the saved file. If you want the index to be generated, then you must use, which generates it by default.

Parameters
cosDoc: CosDoc

The document to save.

asFile: ASFile

The file to which the document is written; it must be open in write mode. This file is not necessarily position-able.

saveFlags: CosDocSaveFlags

Anof thebit flag values specifying how to save the document.

saveParams: CosDocSaveParams

Optional parameters for use when saving a document, as described in.

Returns
void
Since
Saves a Cos document to a file. CosDocSaveToFile() will not generate a cross-reference index (table or stream) in the saved file. If you want the index to be generated, then you must use CosDocSaveWithParams() , which generates it by default.

CosDocSaveWithParams

void CosDocSaveWithParams(CosDoc cosDoc, ASFile asFile, CosDocSaveFlags saveFlags, CosDocSaveParams saveParams)
CosProcs.h:1245

Saves a Cos document, optionally to a new file handle. It generates an cross-reference table by default. Saves a Cos document, optionally to a new file. It generates a cross-reference index (table or stream) by default.

Parameters
cosDoc: CosDoc

Thefor the document to save.

asFile: ASFile

The file to which the document will be written. This file must already be open in write mode. If you pass,is saved to the file with which it was originally associated.

saveFlags: CosDocSaveFlags

Anof thebit flag values specifying how to save the document.

saveParams: CosDocSaveParams

parameters for use when saving thedocument.

Returns
void
Since
Saves a Cos document, optionally to a new file. It generates a cross-reference index (table or stream) by default.

CosDocSetAdobeExtensionLevel

void CosDocSetAdobeExtensionLevel(CosDoc dP, CosObj baseVersion, ASUns32 extension)
CosProcs.h:2460

Adds the necessary data structures to the suppliedto identify it as containing the Adobe Extensions Dictionary for the ISO 32000 standard. When the Extensions Dictionary is added to a PDF document, it allows PDF features provided in Adobe Acrobat after PDF version 1.7 to be used with that document. The version of the PDF file is drawn from the Extensions Dictionary instead of from the file header. See

Parameters
dP: CosDoc

The Cos document to set.

baseVersion: CosObj

The PDF version on which the extensions are based (will be of type).

extension: ASUns32

The level of the extension expressed as a monotonically increasing integer.

Returns
void

CosSetMaxDocStorage

CosProcs.h:1553

Puts a limit on the amount of memory (RAM) that can be used to store Cos objects per doc. The default, minimum and maximum values of this limit are 30 MB, 512 KB and 40 MB respectively. This method can be used to increase or decrease the amount of memory reserved for Cos objects within this limit. Beyond the limit, Cos objects may be stored on disk.

Parameters
maxMemory: ASInt32

The maximum amount of RAM (in bytes) that will be used to store fixed-size Cos objects.

Returns
void

Typedefs(4)

CosDocEnumEOFsProc

typedef ASBool(* CosDocEnumEOFsProc) (CosDoc cosDoc, ASFileOffset fileOffset, void *clientData))(CosDoc cosDoc, ASFileOffset fileOffset, void *clientData)
CosExpT.h:273

A callback for CosDocEnumEOFs(). It is called once for each position in a CosDoc after akeyword that marks the end of either a main cross-reference section, or an update cross-reference section that corresponds to an incremental save. See CosDocEnumEOFs() for more details. The precise value passed to the procedure is not defined. It is at least one byte past thekeyword, but may include one or more white space characters. When the procedure is called only once, there is no guarantee thatis the same as the length of the file.

CosDocEnumEOFsProc64

typedef ASBool(* CosDocEnumEOFsProc64) (CosDoc cosDoc, ASFileOffset64 fileOffset, void *clientData))(CosDoc cosDoc, ASFileOffset64 fileOffset, void *clientData)
CosExpT.h:292

A callback for CosDocEnumEOFs64(). It is called once for each position in a CosDoc after akeyword that marks the end of either a main cross-reference section, or an update cross-reference section that corresponds to an incremental save. See CosDocEnumEOFs() for more details. This is similar to CosDocEnumEOFsProc(), except that theparameter is a 64-bit value instead of a 31-bit value.

Structures(1)

Definitions(7)

cosSaveBinaryOK

CosExpT.h:208
Value:0x08

It is ok to store binary data in the file.

cosSaveConcealObjStreams

CosExpT.h:213
Value:0x10

If there are any object streams, write them in a way that is hidden from PDF 1.4 (and earlier) viewers. This is used for hybrid files, for example.

cosSaveCopy

CosExpT.h:206
Value:0x04

Do NOT use the newly saved file as new store, stay with the current one

CosName

4 items

Functions(4)

CosCopyNameStringValue

CosProcs.h:2190

Returns a newly allocated buffer containing a copy of the Cos object's name as a-terminated string. Upon return,contains the number of bytes in the string.never returns; it raises an exception if the allocation fails. The client is responsible for freeing the result by calling. Unlike Cos strings, the strings corresponding to Cos names are-terminated. This routine will avoid creating ancorresponding to the object's name and is generally more efficient than copying the value returned by. (objects consume global memory that is not deallocated.) An out-of-memory exception is raised if insufficient memory is available.

Parameters
obj: CosObj

IN A Cos name object.

nBytes: ASTCount *

OUT The length of the name of the Cos object, and therefore the length of the returned string.may beif you do not care how many bytes are in the name.

Returns
char *

A copy of the Cos object's name, as a-terminated string.

CosNameValue

CosProcs.h:547

Gets the value of a name object. An exception is raised ifhas the wrong type, if storage is exhausted, or if file access fails.

Parameters
obj: CosObj

The object of typewhose value is obtained.

Returns
ASAtom

Thecorresponding to the specified name object. Ancan be converted to a string using. Note thatcan be used to obtain the name as a string, without creating an(objects consume global memory that is not deallocated).

CosNewName

CosObj CosNewName(CosDoc dP, ASBool indirect, ASAtom name)
CosProcs.h:215

Creates a new name object associated with the specified document and having the specified value.

Parameters
dP: CosDoc

The document in which the new name is used.

indirect: ASBool

If, it creates the name as an indirect object, and sets the document'sflag (see) flag. If, it creates the name as a direct object.

name: ASAtom

Thecorresponding to the name to create. A C string can be converted to anusing. Note that a name object can be created directly from a C string, without creating an, by using.

Returns
CosObj

The newly created name Cos object.

CosNewNameFromString

CosObj CosNewNameFromString(CosDoc dP, ASBool indirect, const char *namestring)
CosProcs.h:2159

Creates a new name object associated with the specified document and having the specified value.

Parameters
dP: CosDoc

The document in which the new name is used.

indirect: ASBool

If, it creates the name as an indirect object, and sets the document'sflag (see) flag. If, it creates the name as a direct object.

namestring: const char *

The name to create. This routine will not create ancorresponding toand is generally more efficient than. (objects consume global memory that is not deallocated.)

Returns
CosObj

The newly created name Cos object.

CosNumber

13 items

Functions(13)

CosDoubleValue

CosProcs.h:2401

Gets the value ofas a double-precision floating-point real number. An exception is raised if the given object has the wrong Cos type.

Parameters
obj: CosObj

The object whose value is obtained. It must
have typeor(). The
result is undefined if the real value is outside the range of floating-point numbers.

Returns
double

The numeric value of, represented as a floating-point number.

CosFloatValue

CosProcs.h:1904

Gets the value ofas a single-precision floating-point real number. An exception is raised if the given object has the wrong Cos type.

Parameters
obj: CosObj

The object whose value is obtained. It must
have typeor(). The
result is undefined if the real value is outside the range of floating-point numbers.

Returns
float

The numeric value of, represented as a floating-point number.

CosInteger64Value

CosProcs.h:1868

Gets the 64-bit integer value of a specified number object. An exception is raised if the given object has the wrong Cos type.

Parameters
obj: CosObj

The object whose integer value is obtained.
It must have typeor().
If it is, its value is rounded to the nearest integer. The result is undefined if the real value is outside the range ofnumbers.

Returns
ASInt64

The 64-bit integer value of.

CosIntegerValue

CosProcs.h:504

Gets the 32-bit integer value of a specified number object. An exception is raised if the given object has the wrong Cos type.

Parameters
obj: CosObj

The object whose integer value is obtained. It must have typeor(). If it is, its value is rounded to the nearest integer. The result is undefined if the real value is outside the range ofnumbers.

Returns
ASInt32

The 32-bit integer value of.

CosNewDouble

CosObj CosNewDouble(CosDoc dP, ASBool indirect, double value)
CosProcs.h:2359

Creates a new real-number object from a double-precision floating-point number associated with the specified document.

Parameters
dP: CosDoc

The document in which the number is used.

indirect: ASBool

If, it creates the real-number object
as an indirect object, and sets the documentobject'sflag (see). If, it creates the number as a direct object.

value: double

The real number, represented as a double-precision floating-point number.

Returns
CosObj

A Cos object of type().

CosNewDoubleEx

CosObj CosNewDoubleEx(CosDoc dP, ASBool indirect, double value, ASUns8 numSigDigs)
CosProcs.h:2382

Creates a new real-number object from a double-precision floating-point number associated with the specified document.

Parameters
dP: CosDoc

The document in which the number is used.

indirect: ASBool

If, it creates the real-number object
as an indirect object, and sets the documentobject'sflag (see). If, it creates the number as a direct object.

value: double

The maximum number of significant digits to use when this object is written to a file. Legal values are 6-13 for direct objects, 6-16 for indirect objects

numSigDigs: ASUns8
Returns
CosObj

A Cos object of type().

CosNewFixed

CosObj CosNewFixed(CosDoc dP, ASBool indirect, ASFixed value)
CosProcs.h:178

Creates a new real-number object from a fixed-point number associated with the specified document.

Parameters
dP: CosDoc

The document in which the number is used.

indirect: ASBool

If, it creates the real-number object
as an indirect object, and sets the document () object'sflag (see). If, it creates the number as a direct object.

value: ASFixed

The real number, represented as a fixed-point number.

Returns
CosObj

A Cos object of type().

CosNewFloat

CosObj CosNewFloat(CosDoc dP, ASBool indirect, float value)
CosProcs.h:1887

Creates a new real-number object from a single-precision floating-point number associated with the specified document.

Parameters
dP: CosDoc

The document in which the number is used.

indirect: ASBool

If, it creates the real-number object
as an indirect object, and sets the documentobject'sflag (see). If, it creates the number as a direct object.

value: float

The real number, represented as a single-precision floating-point number.

Returns
CosObj

A Cos object of type().

CosNewInteger

CosProcs.h:159

Creates a new 32-bit integer object associated with the specified document and having the specified value.

Parameters
dP: CosDoc

IN The document in which the integer is used.

indirect: ASBool

IN If, it creates the integer object as
an indirect object, and sets the documentobject'sflag (see PDDocFlags). If, it creates the integer as a direct object.

value: ASInt32

IN The value, represented as a 32-bit integer.

Returns
CosObj

An object of type CosInteger.

CosNewInteger64

CosProcs.h:1850

Acrobat 7 additions Creates a new 64-bit integer object associated with the specified document and having the specified value.

Parameters
dP: CosDoc

IN The document in which the integer is used.

indirect: ASBool

IN If, it creates the integer object as an indirect object, and sets the documentobject'sflag (see PDDocFlags). If, it creates the integer as a direct object.

value: ASInt64

IN The value, represented as a 64-bit integer.

Returns
CosObj

An object of type CosInteger.

CosNumberIsWithinASFixedRange

CosProcs.h:2242

Tests whether the value of a Cos number is inside the range ofnumbers,. If so, thevalue may be obtained by calling CosFixedValue(). If not, the floating-point value may be obtained by calling CosFloatValue(). It raises an exception ifis not a number (or).

Parameters
obj: CosObj

A Cos integer or real number.

Returns
ASBool

if the value of the number is in the range of,otherwise.

CosNumberIsWithinASInt32Range

CosProcs.h:2226

Tests whether the value of a Cos number is inside the range of 32-bit integers,. If so, the 32-bit value may be obtained by calling. If not, the 64-bit value may be obtained by calling. It raises an exception ifis not a number (or).

Parameters
obj: CosObj

A Cos integer or real number.

Returns
ASBool

if the value of the number is in the range of 32-bit integers,otherwise.

CosObj

27 items

Functions(18)

CosNewNull

CosProcs.h:141

Returns a direct object of type CosNull. Thisobject is said to be invalid. You can compare an object tousing either of the following methods (the second is more efficient): In general, use CosNewNull() only to initialize a local variable or pass a parameter.objects may be stored as array elements, but not as dictionary values. The following statements are equivalent:

Parameters
: void
Returns
CosObj

ACos object.

See Also

CosObjAcquire

CosProcs.h:2124

Create a strong reference for an object. For a description of strong references, see. For indirect objects and direct nonscalars,increments an internal reference count for. The reference count is used by the garbage collector, which is invoked during a full-save of the document. If the reference count is positive at the time of garbage collection (it is initially), then the object will not be garbage-collected, regardless of whether the object is accessible from the root of the document.

Parameters
obj: CosObj

A Cos object.

Returns
void

CosObjCmp

CosProcs.h:1541

Compares the twoobjects. The result isonly ifis. Otherwise, the result is eitheror. The result is useful for ordering or sorting Cos objects. No other significance should be attached to the result. In particular, a nonzero result indicates nothing about the type of either object. The result is valid only within a single instance of the document. That is, if CosObjCmp() returns a nonzero value and the document is closed and then reopened, there is no guarantee that it will return the same nonzero value for those same objects. The following conditions apply: If, then. If, then. If, then. Ifand, then. Ifand, then. Ifand, then.

Parameters
obj1: CosObj

The firstto compare.

obj2: CosObj

The secondto compare.

Returns
ASInt32

Returns zero if the two objects are equal,ifis less than,ifis greater than.

See Also

CosObjCopy

CosObj CosObjCopy(CosObj srcObj, CosDoc destDoc, ASBool copyIndirect)
CosProcs.h:1330

Copies afrom one document to another (or the same document).

Parameters
srcObj: CosObj

Theto copy.

destDoc: CosDoc

Thefor the document into which theis copied.

copyIndirect: ASBool

if all indirectly referenced objects fromare copied to,otherwise.

Returns
CosObj

Thewhich has been copied to the destination document.

See Also

CosObjEnum

ASBool CosObjEnum(CosObj obj, CosObjEnumProc proc, void *clientData)
CosProcs.h:106

Enumerates the elements of a Cos object by calling a user-supplied procedure for each component of the object.

Parameters
obj: CosObj

The object whose elements are enumerated.

  • For scalars or strings, the proc is not called, and CosObjEnum()
    returns true.

  • For dictionaries, proc is called for each key-value pair. The order in
    which the key-value pairs are enumerated is undefined.

  • For arrays, proc is called with each element as the first paramater to, and theobject as the second parameter. Array elements are enumerated in ascending order of index. For streams,is called once, with the stream's dictionary as the first parameter to theand theobject as the second parameter.
  • proc: CosObjEnumProc

    A user-supplied callback to call for each element of. Neithernor any routine called bymay modify. Doing so can produce undefined results or errors. For example, ifis an array,must not call CosArrayRemove(); ifis a dictionary,must not call CosDictPut().

    clientData: void *

    A pointer to user-supplied data to pass toeach time it is called.

    Returns
    ASBool

    Returnsif every call toreturned. As soon as any call toreturns, the enumeration stops and CosObjEnum() returns.

    CosObjEqual

    CosProcs.h:55

    Tests whether two Cos objects are equal. Cos objects are equal when all of the following conditions are true: They are either both direct or both indirect. They have the same type. If they are indirect, they have the same generation number. If they are scalars, they have the same value. (Twoobjects are equal.) If they are non-scalar, they reference the same value. The last condition implies that the comparison is. For example: In this case,is, butis.

    Parameters
    obj1: CosObj

    An object to compare with.

    obj2: CosObj

    An object to compare with.

    Returns
    ASBool

    ifandare equal,otherwise.

    See Also

    CosObjGetGeneration

    CosProcs.h:1185

    Gets the generation number of an indirect Cos object. See the description of the Indirect Objects in "Objects," in ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.3.1, page 21. You can find this document on the web store of the International Standards Organization (ISO).

    Parameters
    obj: CosObj

    IN/OUT The indirectfor which the generation number is obtained. Acan be determined to be indirect using.

    Returns
    CosGeneration

    The generation number of.

    CosObjHash

    CosProcs.h:1315

    Gets a 32-bit hash code for the given. Twoobjects with equal hash codes are not necessarily equal, however. Useto determine the equality of Cos objects.

    Parameters
    obj: CosObj

    Thefor which to obtain a hash code.

    Returns
    CosHashCode

    32-bit hash code for the given, orif there is no object with this ID.

    See Also

    CosObjRefreshAfterLinearizedSave

    CosProcs.h:1776

    In Acrobat 6.0, this method updates an indirect Cos object after a linearized save operation. Linearizing renumbers all indirect objects; this function returns the new renumbered Cos object, which should be used from this point on. This call is only valid from within notification callbacks responding to the PDDocDidSave() notification. If called from outside this context, or if the passed Cos object is direct, the function does not modify the object. In Acrobat 7.0 and later, linearizing does not renumber objects, and this method has no effect.

    Parameters
    obj: CosObj *

    A pointer to the object to refresh. The object is updated by the method.

    doc: CosDoc

    The document that was saved.

    Returns
    void

    CosObjRelease

    CosProcs.h:2138

    Removes a strong reference for an object. For a description of strong references, see. For indirect objects and direct nonscalars,decrements an internal reference count for. The reference count is used by the garbage collector, which is invoked during a full-save of the document. If the reference count is positive at the time of garbage collection (it is initially), then the object will not be garbage-collected, regardless of whether the object is accessible from the root of the document.

    Parameters
    obj: CosObj

    A Cos object.

    Returns
    void

    CosObjSetCompressibility

    void CosObjSetCompressibility(CosObj obj, ASBool compressible)
    CosProcs.h:1686

    Controls whether a Cos object can be compressed. A compressible object can be added to a CosObjCollection. If you set the compressibility to, callingon that object has no effect. If the object is already compressed, it is removed from the object collection to which it belongs and then marked as incompressible. This method does nothing if applied to a direct object, a stream, or an object whose generation number is not zero. Objects of these types are never compressible.

    Parameters
    obj: CosObj

    The object whose compressibility is set.

    compressible: ASBool

    if the object can be made part of a,otherwise.

    Returns
    void

    ifis marked as compressible,otherwise.

    Typedefs(9)

    CosObjEnumProc

    typedef ASBool(* CosObjEnumProc) (CosObj obj, CosObj value, void *clientData))(CosObj obj, CosObj value, void *clientData)
    CosExpT.h:132

    A callback for CosObjEnum(), CosDocEnumIndirect(), and PDDocEnumOCGs(). It is called once for each component of a composite Cos object (dictionary, array, and stream). Value DescriptionA key.An array element.The stream's dictionary (the whole thing, not one key at a time). Value DescriptionThe value associated with the Key.ACos object.ACos object. For CosDocEnumIndirect() and PDDocEnumOCGs(), this is always theCos object.

    CosObjSetCallbackFlagProc

    typedef ASBool(* CosObjSetCallbackFlagProc) (CosObj obj, ASBool set))(CosObj obj, ASBool set)
    CosExpT.h:326

    A callback in PDDocPreSaveInfo(), which is used by the PDDocPreSaveProc() callback. Use this callback to set a flag in each CosObj that you care about, so that your callback will be called back during the PDDoc's save and will be given the Cos object's offset and length. After a PDF file is saved, the Cos objects previously obtained are no longer valid.

    CosObjCollection

    9 items

    Functions(8)

    CosNewObjCollection

    CosProcs.h:1601

    Creates a new object collection for objects in a document.

    Parameters
    dP: CosDoc

    The document whose objects are collected, orto create acollection (acollection
    is not associated with a document and cannot store objects; it is generally used only as an initial value for a variable of type CosObjCollection).

    Returns
    CosObjCollection

    The newly created Cos object collection.

    CosObjAddToCollection

    CosProcs.h:1647

    Adds a Cos object to a collection; seefor requirements of these collections. This method sets the dirty flag of the collection's Cos document. An exception is raised if the collection and the object belong to different Cos documents.

    Parameters
    coll: CosObjCollection

    The Cos object collection.

    item: CosObj

    The object to add.

    Returns
    ASBool

    ifwas successfully added to the collection,otherwise.

    CosObjCollectionEnum

    CosProcs.h:1756

    Enumerates the members of a Cos object collection, calling a user-supplied procedure for each member object. The order in which the objects are enumerated is undefined.

    Parameters
    coll: CosObjCollection

    The object collection whose members are enumerated.

    proc: CosObjEnumProc

    A user-supplied callback to call for each member object of. Enumeration ends ifreturns. The callback must not modify the collection (for example, by adding or removing objects). Doing so produces undefined results or errors.

    clientData: void *

    A pointer to user-supplied data to pass toeach time it is called.

    Returns
    ASBool

    Returns the value thatreturned (meaning that it returnsif all the member objects were enumerated,if enumeration was terminated at the request of).

    CosObjCollectionEqual

    CosProcs.h:1735

    Tests whether two Cos object collections are the same collection. Twocollections are always equal (acollection is not associated with a document and cannot store objects; it is generally used only as an initial value for a variable of type).

    Parameters
    c1: CosObjCollection

    An object collection to compare.

    c2: CosObjCollection

    An object collection to compare.

    Returns
    ASBool

    ifandare the same collection,otherwise.

    Typedefs(1)

    CosStream

    11 items

    Functions(8)

    CosNewStream

    CosObj CosNewStream(CosDoc dP, ASBool indirect, ASStm stm, CosStreamStartAndCode sourceStart, ASBool encodeTheSourceData, CosObj attributesDict, CosObj encodeParms, CosByteMax sourceLength)
    CosProcs.h:465

    Creates a new Cos stream, using data from an existing. The data is copied, so the source stream may be closed after CosNewStream returns. This method creates a Cos stream object by writing its PDF representation to an intermediate file in this format: See the description of the Stream Objects in "Objects," in ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.3.8, page 19. You can find this document on the web store of the International Standards Organization (ISO). This occurs in four steps: Ifis a valid Cos dictionary, the method writes that dictionary to the intermediate file. Otherwise, it creates a new direct dictionary, determining akey according to thevalue: Ifis negative, or if the source data is to be encoded (see below), the value of thekey is a reference to a new indirect object, whose value will be set in. Otherwise,is a direct scalar representing. The dictionary that is written becomes the new stream's attribute dictionary. determines where in the source stream to begin reading, and whether the source is seekable. Ifis a negative number, the source is assumed to be non-seekable but positioned at the point where reading should start. Otherwise, the source is assumed to be seekable, and reading starts at the position indicated by. Ifis zero, data is read from the beginning of the source stream. Positive values formay be used, for instance, to skip over initial data in the stream. Ifis a valid Cos dictionary, it contains akey, andis, the method encodes the data after reading it from the source stream and before writing it to the intermediate file. Theis used as the new stream's dictionary. Theentry in this dictionary indicates how the data in the resulting Cos stream object will be subsequently decoded; the value may be the name of a decoding filter or an array of such names. Specify multiple filters in the order they should be applied to decode the data (if parameters are needed to decode the data, they are specified as the value of thekey in. See the description of the DecodeParms attribute in Table 5 in ISO 32000-1:2008, Document Management-Portable Document Format- Part 1: PDF 1.7, section 7.3.8.2, page 20. You can find this document on the web store of the International Standards Organization (ISO). For each decoding filter, there is a corresponding encoding filter, which the method applies to the source data during this step. If parameters are needed to encode the data, they must be specified in the call by(the encoding parameters are often different from the decoding parameters). Theparameter is optional for all encoding filters exceptand. See thefield of. If an array of filters is supplied, and at least one of them requires encoding parameters, then a corresponding array of encoding parameters is also required. Use theobject to represent default parameters for filters that have defaults. In any other case, the method copies the source data directly into the Cos stream with no encoding. Ifis negative, it reads bytes until the source reaches its EOF. Otherwise,indicates how many bytes to read from the source, and an exception is raised if the source reaches EOF before that. After the data is written, if the value of thekey in the attributes dictionary was an indirect reference (either because it was supplied that way in, or because it was created that way in, the value of that indirect object is set to the number of bytes actually written (that is, the encoded length if the data was encoded). An indirectkey is useful for one-pass writing, when the size of the written data is not known in advance, either because the data was to be encoded, or because there was no way to know how much data there would be before the source reached its EOF. An exception is raised ifis neither theobject nor a direct Cos dictionary,is nonnegative but the source is not seekable, or ifis nonnegative but the source stream reaches EOF before that many bytes have been read. For attributeDict, see the description of Stream Objects in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 9.9, page 288. You can find this document on the web store of the International Standards Organization (ISO). See the encoding step in the description above. You can find this document on the web store of the International Standards Organization (ISO). See the encoding step in the description above. If no encoding parameters are needed, this value is ignored. CosNewStream() sets the documentflag (see PDDocFlags). You cannot callon a stream created withuntil the file has been saved.

    Parameters
    dP: CosDoc

    The Cos document in which the newly created stream will be used.

    indirect: ASBool

    Must always be, specifying that the Cos stream is created as an indirect object (all streams are indirect). This also sets the document'sflag (see).

    stm: ASStm

    The source stream containing the data to copy into the new stream. The caller is responsible for closingafterreturns. The source stream can be any readable. Typical sources are: Files () or memory (). These streams are always seekable.
    Arbitrary procedures (or), or other Cos streams (). These streams are always non-seekable.

    sourceStart: CosStreamStartAndCode

    The byte offset intofrom which data reading starts for a seekable stream. If the value is negative, it specifies that the stream is not seekable.

    encodeTheSourceData: ASBool

    Determines whether the data inshould be encoded using filters specified inbefore it is written to the Cos stream. See the description of the encoding step above. Ifis aobject or if the dictionary has nokey, this value is ignored.

    attributesDict: CosObj

    Either theCos object, or a direct Cos dictionary containing stream attributes, such as the length of the Cos stream data and a list of decoding filters and parameters to apply to the data. See the description of the Stream Objects in "Objects" in ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.3.8, page 19.

    encodeParms: CosObj

    The parameters to be used by the filters if the source data is encoded before it is written to the file. The parameters follow the structure for the value of thestream attribute. See the description of the DecodeParms attribute in Table 5 in ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.3.8.2, page 20.

    sourceLength: CosByteMax

    The amount of data to be read from the source. If negative (typically), data is read from the source until it reaches its EOF. Seein the description above.

    Returns
    CosObj

    The newly created stream Cos object.

    CosNewStream64

    CosObj CosNewStream64(CosDoc dP, ASBool indirect, ASStm stm, ASInt64 stmStartPos, ASBool stmDataIsDecoded, CosObj attributesDict, CosObj encodeParms, ASInt64 sourceLength, ASBool allowDelayedRead)
    CosProcs.h:2302

    Creates a new Cos stream, using data from an existing. For details, see. This is the same as, except thatis a 64-bit value instead of a 32-bit value, andenables the implementation to avoid making an intermediate copy of the stream data. This is useful when creating very large streams of data. In this case, the caller must not closeuntil it is established, through some independent mechanism, that the data will not be read again (seefor further details on this feature). Ifis, the source data is copied during this call, so the source stream may be closed afterreturns.

    Parameters
    dP: CosDoc

    The Cos document in which the newly created stream will be used.

    indirect: ASBool

    Must always be, specifying that the Cos stream is created as an indirect object.

    stm: ASStm

    The source stream containing the data to copy into the new stream.

    stmStartPos: ASInt64

    Starting position for the stream. Its default is.

    stmDataIsDecoded: ASBool

    A boolean value indicating whether the data inshould be encoded using filters specified in.

    attributesDict: CosObj

    Either theCos object, or a direct Cos dictionary containing stream attributes.

    encodeParms: CosObj

    The parameters to be used by the filters if the source data is to be encoded.

    sourceLength: ASInt64

    The amount of data to be read from the source.

    allowDelayedRead: ASBool

    If this isandpermits seek operations, then the data fromwill not be read during this call, but rather at a subsequent time, and it may be read more than once.

    Returns
    CosObj

    The newly created stream Cos object.

    CosStreamLength

    CosProcs.h:896

    Gets the length of a Cos stream from thekey in the stream's attributes dictionary. This specifies the length of the undecoded data, which is the number of bytes in the stream before the(if any) is applied. This has the same effect as calling. An exception is raised if thekey is not found in the attributes dictionary, if its value is not an integer, or if its value is outside the range of 32-bit integers.

    Parameters
    stream: CosObj

    The stream whose length is obtained.

    Returns
    ASTArraySize

    The length of the stream.

    CosStreamLength64

    CosProcs.h:2322

    Gets the length of a Cos stream from thekey in the stream's attributes dictionary. Seefor details. This is the same as, except that the return value is a 64-bit integer instead of a 32-bit integer. This has the same effect as calling An exception is raised if the Length key is not found in the attributes dictionary, or if its value is not an integer.

    Parameters
    stream: CosObj

    The stream whose length is obtained.

    Returns
    ASInt64

    The length of the stream.

    CosStreamOpenStm

    CosProcs.h:926

    Creates a new, non-seekablefor reading data from a Cos stream. The data in the Cos stream may be filtered and encrypted. After opening the Cos stream, data can be read from it into memory using. When reading is completed, close the stream using.

    Parameters
    stream: CosObj

    The Cos stream object for which anis opened.

    mode: CosStreamOpenMode

    This must be one of thevalues.

    Returns
    ASStm

    The newly-opened.

    CosStreamPos

    CosProcs.h:953

    Gets the byte offset of the start of a Cos stream's data in the PDF file (which is the byte offset of the beginning of the line following thetoken). Use this method to obtain the file location of any private data in a stream that you need to read directly rather than letting it pass through the normal Cos mechanisms. For example, this could apply to a QuickTime video embedded in a PDF file.is only valid when called on a stream that is already stored in a PDF document. If the stream was created using, the new stream is stored in the document's temp file, and you cannot invokeon it. After the file has been saved, you can useon the stream.

    Parameters
    stream: CosObj

    The stream whose current position is obtained.

    Returns
    Exceptions
    cosErrInvalidObj
    —

    is raised if the stream object has not yet
    been saved to the PDF file. In other words, before you can callon a newly created stream, you must first save the PDF file.

    CosStreamPos64

    CosProcs.h:2338

    Gets the byte offset of the start of a Cos stream's data in the PDF file. For details, see. This is the same as, except that the return value is a 64-bit file position instead of a 32-bit file position.

    Parameters
    stream: CosObj

    The stream whose current position is obtained.

    Returns
    ASFilePos64

    The byte offset of the start of the Cos stream's data in the PDF file.

    Typedefs(3)

    CosString

    6 items

    Functions(6)

    CosCopyStringValue

    char * CosCopyStringValue(CosObj obj, ASTCount *nBytes)
    CosProcs.h:1459

    Returns a newly allocated buffer containing a copy of the Cos object's string value. Upon return,contains the number of bytes in the original Cos string.never returns; it raises an exception if the allocation fails. The client is responsible for freeing the result by calling.allocates extra memory past the end of the string and writes zeros into these extra bytes to ensure that the string is-terminated whether viewed as a UTF-16 (Unicode) string or as a C string (these bytes are not included in the number returned in). If the Cos string haslength,will be, and a pointer to newly allocated memory containing some zero bytes is returned (that is,still returns a-terminated string but with zero length). An out-of-memory exception is raised if insufficient memory is available. It can also raise any exception that CosStringValue() can raise. @note In general, the returned value is not a-terminated C string. Cos string objects are binary and can contain arbitrary byte sequences, includingcharacters. Standard C string handling functions may not work as expected. @since

    Parameters
    obj: CosObj

    IN The Cos object whose string value is copied
    and returned.

    nBytes: ASTCount *

    OUT (Filled by the method) The length of the
    original Cos string in bytes. It can beif you do not care
    how many bytes were in the original string.

    Returns
    char *

    CosNewString

    CosObj CosNewString(CosDoc dP, ASBool indirect, const char *str, ASTArraySize nBytes)
    CosProcs.h:234

    Creates and returns a new Cos string object. @since

    Parameters
    dP: CosDoc

    The document in which the string is used.

    indirect: ASBool

    If, it creates the string as an indirect
    object, and sets the document () object'sflag
    (see). If, it creates the string as a direct object.

    str: const char *

    The value that the new string will have. It
    is not a C string, since Cos strings can containcharacters.
    The data inis copied; that is, ifwas dynamically
    allocated, it can be freed after this call.

    nBytes: ASTArraySize

    The length of.

    Returns

    CosStringValue

    char * CosStringValue(CosObj obj, ASTCount *nBytes)
    CosProcs.h:586

    Gets the value of a string Cos object, and the string's length. An exception is raised if the type ofis not a. The pointer returned from this method is not guaranteed to remain valid ifis called again. It is recommended that you useorinstead; these methods place the string into a user-allocated buffer. The caller must immediately copy the returned string. The memory pointed to be the return value may become invalid if any memory-allocating calls are made. In particular, consider the sequence: In this case, the contents ofmay be invalid by the time the second CosStringValue() call returns. The returned value is not a C-style string. Cos string objects can containbytes. Standard C string-handling functions may not work as expected.

    Parameters
    obj: CosObj

    IN The object whose value is obtained.

    nBytes: ASTCount *

    OUT (Filled by the method) The length of the string, in bytes. It must be a non-pointer.

    Returns
    char *

    The value of.

    CosStringValueSafe

    char * CosStringValueSafe(CosObj obj, char *buffer, ASTArraySize bufferSize, ASTCount *nBytes)
    CosProcs.h:1488

    Copies at mostbytes from theparameter's string value into, and stores the actual length of the Cos string in. Ifis greater than the length of the Cos string, the remaining bytes inhave undefined values upon return. A bad-parameter exception is raised ifis less thanoris. It can also raise any exception thatcan raise. In general, the returned value is not a-terminated C string. Cos string objects are binary data and can contain any arbitrary byte sequence, including embeddedcharacters. Standard C string handling functions may not work as expected.

    Parameters
    obj: CosObj

    The Cos object whose string value is copied.

    buffer: char *

    The buffer into which the Cos string value is copied, or.

    bufferSize: ASTArraySize

    The length ofor.

    nBytes: ASTCount *

    (Filled by the method) The length of the original Cos string in bytes (which may be more than). It must be a non-pointer.

    Returns
    char *

    A copy of the Cos string value or an exception. It will never return.

    PDDoc

    1 items

    Enums(1)

    AdobePDFVersion

    CosExpT.h:339
    Values
    kNullPDFVersion
    —
    kMinPDFVersion
    —
    kAdobeAcrobat4Version
    —
    kAdobeAcrobat5Version
    —
    kAdobeAcrobat6Version
    —
    kAdobeAcrobat7Version
    —
    kAdobeAcrobat8Version
    —
    kAdobeAcrobat9Version
    —
    kAdobeAcrobat9_1Version
    —
    kAdobeAcrobat10Version
    —
    kAdobeAcrobat11Version
    —
    kMinSaveVersion
    —
    kMinXRefStreamVersion
    —
    kDefaultPDFVersion
    —
    kLastAdobe1XVersionWithoutExt
    —
    kLastAdobe1XVersionWithExt
    —
    kMinPDFNextVersion
    —
    kCurrentPDFVersion
    —