LayerCOS_Layer
ObjectCosDoc

A CosDoc object is the Cos layer representation of an entire PDF file. See the PDF Reference for an overview of PDF document structure. See Section 3.6.1, "Document Catalog", in the PDF Reference, for a description of the catalog dictionary.



Define Summary
 Define
 CosDocEnumEOFs64
 CosDocGetAdobeExtensionLevel
 CosDocHasISOExtensions
 CosDocObjIsWithinRange64
 CosDocSetAdobeExtensionLevel
 kCosDocOpenDoRepair
Typedef Summary
 Typedef
 CosDoc
 CosDocOpenParams
 CosDocOpenParamsRec
 CosDocSaveFlags
 CosDocSaveParams
 CosDocSaveParamsRec
Structure Summary
 Structure
 _t_CosDocOpenParams
Parameters used when saving a file using CosDocOpenWithParams().
 _t_CosDocSaveParams
Parameters used when saving a file using CosDocSaveToFile() and CosDocSaveWithParams().
Callback Summary
 Callback
 CosDocEnumEOFsProc
A callback for CosDocEnumEOFs(). It is called once for each position in a CosDoc after a %EOF keyword that marks the end of either a main cross-reference section, or an update cross-reference section that corresponds to an incremental save. See CosDocEnumEOFs() for more details.
 CosDocEnumEOFsProc64
A callback for CosDocEnumEOFs64(). It is called once for each position in a CosDoc after a %EOF keyword that marks the end of either a main cross-reference section, or an update cross-reference section that corresponds to an incremental save. See CosDocEnumEOFs() for more details. This is similar to CosDocEnumEOFsProc(), except that the fileOffset parameter is a 64-bit value instead of a 31-bit value.
Method Summary
 Method
 
void CosDocClose(CosDoc cosDoc)
Closes a Cos document. You should only call this method with a document obtained via CosDocOpenWithParams() to release resources used by the Cos document.
 
CosDoc CosDocCreate(ASFlagBits createFlags)
Creates an empty Cos document.
 
ASBool CosDocEnumEOFs(CosDoc cosDoc, CosDocEnumEOFsProc proc, void* clientData)
Calls the specified procedure for each EOF in a given CosDoc, where the EOF is a position in a PDF file after a %EOF keyword that marks the end of either a main cross-reference section, or an update cross-reference section that corresponds to an incremental save. Not every %EOF keyword fits these criteria. For example, the first %EOF in a linearized (optimized for the web) file does not, so its position is not be passed to proc.
 
ASBool CosDocEnumEOFs64(CosDoc cosDoc, CosDocEnumEOFsProc64 proc, void* clientData)
Calls the specified procedure for each EOF in a given CosDoc. For details, see CosDocEnumEOFs() . This is the same as CosDocEnumEOFs() , except that the callback proc takes a 64-bit file position instead of a 32-bit file position.
 
ASBool CosDocEnumIndirect(CosDoc dP, CosObjEnumProc proc, void* clientData)
Enumerates all the indirect objects of a given CosDoc.
 
ASBool CosDocGetAdobeExtensionLevel(CosDoc dP, CosObj* baseVersion, ASUns32* extension)
Tests whether the supplied CosDoc contains Adobe extensions to ISO 32000 (aka ISO PDF), and if so, returns the BaseVersion and ExtensionLevel
 
ASBool CosDocGetID(CosDoc dP, CosByte** pInstanceID, CosByte** pPermaID, ASTCount* instIDLength, ASTCount* permIDLength)
Returns two ID byte arrays identifying the CosDoc. The client should copy these arrays before making the next call to Acrobat.
 
Gets the specified document's Info dictionary. In general, access the document's Info dictionary using PDDocGetInfo() and PDDocSetInfo() wherever possible.
 
CosObj CosDocGetObjByID(CosDoc dP, CosID objNum)
Gets the indirect CosObj with the latest generation number.
 
Gets the Catalog (the root object) for the specified document. See Section 3.6.1 in the PDF Reference for a description of the Catalog.
 
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 PDF Reference.
 
Tests whether the supplied CosDoc contains as extensions to ISO 32000 (aka ISO PDF)
 
Tests whether the Cos document is partially compressed. In a partially compressed file, the size of the logical structure information is reduced; however, this information is unavailable to pre-PDF 1.5 viewers, while the document can still be viewed and printed. PDF 1.5 viewers (such as Acrobat 6 and later) have full access to the structure information.
 
ASBool CosDocObjIsWithinRange(CosObj obj, ASInt32 byteRanges, ASInt32 numEntries)
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.
 
ASBool CosDocObjIsWithinRange64(CosObj obj, ASFilePos64 byteRanges, ASInt32 numEntries)
Tests whether the definition of a specified Cos object, in the file associated with the object's CosDoc, begins within any of a set of byte ranges. For details, see CosDocObjIsWithinRange() . This is the same as CosDocObjIsWithinRange() , except that the byte ranges are 64-bit file positions instead of a 32-bit file positions.
 
Opens a Cos document. The document does not need to be a PDF document. In params, the client specifies a file system and path name from which to open the document. The client may also specify a header string other than "%PDF-". For example, a client might want to open a private file type, such as "%FDF-".
 
void CosDocSaveToFile(CosDoc cosDoc, ASFile asFile, CosDocSaveFlags saveFlags, CosDocSaveParams saveParams)
Saves a Cos document to a file handle. CosDocSaveToFile() will not generate an cross-reference table in the saved file. If you want the cross-reference to be generated, then you have to use CosDocSaveWithParams() , which generates the cross-reference table by default.
 
void CosDocSaveWithParams(CosDoc cosDoc, ASFile asFile, CosDocSaveFlags saveFlags, CosDocSaveParams saveParams)
Saves a Cos document, optionally to a new file handle. It generates an cross-reference table by default.
 
void CosDocSetAdobeExtensionLevel(CosDoc dP, CosObj baseVersion, ASUns32 extension)
Adds the necessary data structures to the supplied CosDoc to identify it as containing Adobe extensions to ISO 32000 (aka ISO PDF)
 
void CosDocSetDirty(CosDoc cosDoc, ASBool isDirty)
Sets a Cos document's dirty flag to a given boolean value. If this flag is true when the document is closed, it indicates that the document must be saved to preserve changes.
Defines Detail
CosDocEnumEOFs64 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

#define CosDocEnumEOFs64 CosCallMacro(CosDocEnumEOFs64, 7)

File: CosCalls.h
Line: 457
CosDocGetAdobeExtensionLevel 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

#define CosDocGetAdobeExtensionLevel CosCallMacro(CosDocGetAdobeExtensionLevel, 9)

File: CosCalls.h
Line: 476
CosDocHasISOExtensions 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

#define CosDocHasISOExtensions CosCallMacro(CosDocHasISOExtensions, 9)

File: CosCalls.h
Line: 478
CosDocObjIsWithinRange64 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

#define CosDocObjIsWithinRange64 CosCallMacro(CosDocObjIsWithinRange64, 7)

File: CosCalls.h
Line: 463
CosDocSetAdobeExtensionLevel 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

#define CosDocSetAdobeExtensionLevel CosCallMacro(CosDocSetAdobeExtensionLevel, 9)

File: CosCalls.h
Line: 477
kCosDocOpenDoRepair 
Product availability: All
Platform availability: All

Syntax

#define kCosDocOpenDoRepair 0x0001

File: CosExpT.h
Line: 161

Typedefs Detail
CosDoc 
Product availability: All
Platform availability: All

Syntax

typedef struct _t_CosDoc* CosDoc;

File: CosExpT.h
Line: 83
CosDocOpenParams 
Product availability: All
Platform availability: All

Syntax

typedef _t_CosDocOpenParams CosDocOpenParams;

File: CosExpT.h
Line: 182
CosDocOpenParamsRec 
Product availability: All
Platform availability: All

Syntax

typedef _t_CosDocOpenParams CosDocOpenParamsRec;

File: CosExpT.h
Line: 182
CosDocSaveFlags 
Product availability: All
Platform availability: All

Syntax

typedef ASFlagBits CosDocSaveFlags;

File: CosExpT.h
Line: 203
CosDocSaveParams 
Product availability: All
Platform availability: All

Syntax

typedef _t_CosDocSaveParams CosDocSaveParams;

File: CosExpT.h
Line: 235
CosDocSaveParamsRec 
Product availability: All
Platform availability: All

Syntax

typedef _t_CosDocSaveParams CosDocSaveParamsRec;

File: CosExpT.h
Line: 235


Structure Detail
_t_CosDocOpenParams
Product availability: All
Platform availability: All

Syntax

struct _t_CosDocOpenParams {
 ASSize_t size; 
 
 ASFlagBits openFlags; 
 
 ASFileSys fileSys; 
 
 ASPathName pathName; 
 
 const char* headerString; 
}

Parameters used when saving a file using CosDocOpenWithParams().

See Also


File: CosExpT.h
Line: 171

Elements
size  

The size of this struct.

 
openFlags  

A bitfield of kCosDocOpen flags.

 
fileSys  

May be NULL if using the default file system.

 
pathName  

Must be provided.

 
headerString  

An expected header string (for example, "%ADF-"). If it is NULL, "%PDF-" is the assumed value.

_t_CosDocSaveParams 
Product availability: All
Platform availability: All

Syntax

struct _t_CosDocSaveParams {
 ASSize_t size; 
 
 const char* header; 
 
 char* cryptData; 
 
 ASTArraySize cryptDataLen; 
 
 ASProgressMonitor mon; 
 
 void* monClientData; 
 
 CosCryptVersion cryptVersion; 
}

Parameters used when saving a file using CosDocSaveToFile() and CosDocSaveWithParams().

See Also


File: CosExpT.h
Line: 213

Elements
size  

The size of this struct.

 
header  

A complete header string, such as "%ADF-1.0".

 
cryptData  

The encryption key to pass into the PDCryptHandler if security has been set on the document.

 
cryptDataLen  

The length of the encryption key in bytes. Cannot be greater than 5.

 
mon  

The progress monitor. Use AVAppGetDocProgressMonitor() to obtain the default progress monitor.

 
monClientData  

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

 
cryptVersion  

The Cos cryptographic version - the version of the algorithm that is used to encrypt and decrypt document data. cryptVersion equal to 0 is treated as cryptVersion equal to 1, to maintain backward compatibility.

Callbacks Detail
CosDocEnumEOFsProc 
Product availability: All
Platform availability: All

Syntax

ASBool (*CosDocEnumEOFsProc)(CosDoc cosDoc, ASFileOffset fileOffset, void *clientData)

A callback for CosDocEnumEOFs(). It is called once for each position in a CosDoc after a %EOF keyword that marks the end of either a main cross-reference section, or an update cross-reference section that corresponds to an incremental save. See CosDocEnumEOFs() for more details.

See Also


File: CosExpT.h
Line: 263
CosDocEnumEOFsProc64 
Product availability: All
Platform availability: All

Syntax

ASBool (*CosDocEnumEOFsProc64)(CosDoc cosDoc, ASFileOffset64 fileOffset, void *clientData)

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

See Also


File: CosExpT.h
Line: 283

Method Detail
CosDocClose()
Product availability: All
Platform availability: All

Syntax

void CosDocClose(CosDoc cosDoc)

Closes a Cos document. You should only call this method with a document obtained via CosDocOpenWithParams() to release resources used by the Cos document.

Parameters

cosDoc — 

IN/OUT The document to close.

See Also

Since

PI_COS_VERSION >= 0x00020002

File: CosProcs.h
Line: 1047
CosDocCreate() 
Product availability: All
Platform availability: All

Syntax

CosDoc CosDocCreate(ASFlagBits createFlags)

Creates an empty Cos document.

Parameters

createFlags — 

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

Returns

An empty Cos document.

See Also

Since

PI_COS_VERSION >= 0x00020002

File: CosProcs.h
Line: 1058
CosDocEnumEOFs() 
Product availability: All
Platform availability: All

Syntax

ASBool CosDocEnumEOFs(CosDoc cosDoc, CosDocEnumEOFsProc proc, void* clientData)

Calls the specified procedure for each EOF in a given CosDoc, where the EOF is a position in a PDF file after a %EOF keyword that marks the end of either a main cross-reference section, or an update cross-reference section that corresponds to an incremental save. Not every %EOF keyword fits these criteria. For example, the first %EOF in a linearized (optimized for the web) file does not, so its position is not be passed to proc.

If cosDoc was created in memory (using CosDocCreate()), or if it was damaged and needed to be repaired, the procedure is not called at all.

Parameters

cosDoc — 

The CosDoc in which the EOF's are enumerated.

 
proc — 

The CosDocEnumEOFsProc() to call for each EOF.

 
clientData — 

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

Returns

true if all of the calls to proc return true. false as soon as a call to proc returns false.

See Also

Since

PI_COS_VERSION >= 0x00040000

File: CosProcs.h
Line: 1244
CosDocEnumEOFs64() 
Product availability: All
Platform availability: All

Syntax

ASBool CosDocEnumEOFs64(CosDoc cosDoc, CosDocEnumEOFsProc64 proc, void* clientData)

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

Parameters

cosDoc — 

The CosDoc in which the EOF's are enumerated.

 
proc — 

The CosDocEnumEOFsProc64() to call for each EOF.

 
clientData — 

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

Returns

true if all of the calls to proc return true, false as soon as a call to proc returns false.

See Also

Since

PI_COS_VERSION >= 0x00070000

File: CosProcs.h
Line: 2175
CosDocEnumIndirect() 
Product availability: All
Platform availability: All

Syntax

ASBool CosDocEnumIndirect(CosDoc dP, CosObjEnumProc proc, void* clientData)

Enumerates all the indirect objects of a given CosDoc.

The objects are enumerated in no particular order. Successive enumerations of the same Cos document are not guaranteed to enumerate objects in the same order.

This method does not enumerate invalid objects, which include objects that are defined as NULL, objects that are not defined at all (those having no cross-reference entry), and objects that are on the free list (see the PDF Reference).

This re-raises any exception that proc raises.

Parameters

dP — 

The CosDoc whose indirect objects are enumerated.

 
proc — 

A user-supplied callback to call for each indirect object in dP. Enumeration ends when proc returns false or all indirect objects have been enumerated. The value parameter returned in proc is always the NULL Cos object.

 
clientData — 

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

Returns

true if all of the calls to proc returned true. It returns false as soon as a call to proc returns false.

See Also

Since

PI_COS_VERSION >= 0x00040000

File: CosProcs.h
Line: 1344
CosDocGetAdobeExtensionLevel() 
Product availability: All
Platform availability: All

Syntax

ASBool CosDocGetAdobeExtensionLevel(CosDoc dP, CosObj* baseVersion, ASUns32* extension)

Tests whether the supplied CosDoc contains Adobe extensions to ISO 32000 (aka ISO PDF), and if so, returns the BaseVersion and ExtensionLevel

Parameters

dP — 

IN The Cos document to test.

 
baseVersion — 

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

 
extension — 

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

Returns

true if the file contains Adobe's ISO 32000 Extensions dictionary, false otherwise.

See Also

Since

PI_COS_VERSION >= 0x00090000

File: CosProcs.h
Line: 2403
CosDocGetID() 
Product availability: All
Platform availability: All

Syntax

ASBool CosDocGetID(CosDoc dP, CosByte** pInstanceID, CosByte** pPermaID, ASTCount* instIDLength, ASTCount* permIDLength)

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

Parameters

dP — 

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

 
pInstanceID — 

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

 
pPermaID — 

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

 
instIDLength — 

IN/OUT The length of pInstanceID in bytes.

 
permIDLength — 

IN/OUT The length of pPermaID in bytes.

Returns

true if the ID is returned, false otherwise.

Since

PI_COS_VERSION >= 0x00050000

File: CosProcs.h
Line: 1474
CosDocGetInfoDict() 
Product availability: All
Platform availability: All

Syntax

CosObj CosDocGetInfoDict(CosDoc dP)

Gets the specified document's Info dictionary. In general, access the document's Info dictionary using PDDocGetInfo() and PDDocSetInfo() wherever possible.

Parameters

dP — 

IN/OUT The document whose Info dictionary is obtained.

Returns

The document's Info dictionary Cos object.

See Also

Since

PI_COS_VERSION >= 0x00020000

File: CosProcs.h
Line: 954
CosDocGetObjByID() 
Product availability: All
Platform availability: All

Syntax

CosObj CosDocGetObjByID(CosDoc dP, CosID objNum)

Gets the indirect CosObj with the latest generation number.

Parameters

dP — 

The CosDoc to search for the matching Cos object.

 
objNum — 

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

Returns

The CosObj with the latest generation number whose ID (object number) equals objNum, or the NULL object if there is no object with this ID.

See Also

Since

PI_COS_VERSION >= 0x00040000

File: CosProcs.h
Line: 1170
CosDocGetRoot() 
Product availability: All
Platform availability: All

Syntax

CosObj CosDocGetRoot(CosDoc dP)

Gets the Catalog (the root object) for the specified document. See Section 3.6.1 in the PDF Reference for a description of the Catalog.

Parameters

dP — 

IN/OUT The document whose Catalog is obtained.

Returns

The document's Catalog dictionary Cos object.

See Also

Since

PI_COS_VERSION >= 0x00020000

File: CosProcs.h
Line: 940
CosDocHasFullCompression() 
Product availability: All
Platform availability: All

Syntax

ASBool CosDocHasFullCompression(CosDoc doc)

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

Parameters

doc — 

The document whose compression is checked.

Returns

true if the document is fully compressed, false otherwise.

See Also

Since

PI_COS_VERSION >= 0x00060000

File: CosProcs.h
Line: 1765
CosDocHasISOExtensions() 
Product availability: All
Platform availability: All

Syntax

ASBool CosDocHasISOExtensions(CosDoc dP)

Tests whether the supplied CosDoc contains as extensions to ISO 32000 (aka ISO PDF)

Parameters

dP — 

The Cos document to test.

Returns

true if the file contains an ISO 32000 Extensions dictionary, false otherwise.

See Also

Since

PI_COS_VERSION >= 0x00090000

File: CosProcs.h
Line: 2389
CosDocHasPartialCompression() 
Product availability: All
Platform availability: All

Syntax

ASBool CosDocHasPartialCompression(CosDoc doc)

Tests whether the Cos document is partially compressed. In a partially compressed file, the size of the logical structure information is reduced; however, this information is unavailable to pre-PDF 1.5 viewers, while the document can still be viewed and printed. PDF 1.5 viewers (such as Acrobat 6 and later) 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 PDF Reference.

Parameters

doc — 

The document whose compression is checked.

Returns

true if the document is partially compressed, false otherwise.

See Also

Since

PI_COS_VERSION >= 0x00060000

File: CosProcs.h
Line: 1789
CosDocObjIsWithinRange() 
Product availability: All
Platform availability: All

Syntax

ASBool CosDocObjIsWithinRange(CosObj obj, ASInt32 byteRanges, ASInt32 numEntries)

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

An exception is raised if obj is a direct object or numEntries is an odd number.

Parameters

obj — 

The Cos object (must be indirect).

 
byteRanges — 

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 — 

The number of byte offsets (not pairs) in the byteRanges array.

Returns

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

Since

PI_COS_VERSION >= 0x00060000

File: CosProcs.h
Line: 1546
CosDocObjIsWithinRange64() 
Product availability: All
Platform availability: All

Syntax

ASBool CosDocObjIsWithinRange64(CosObj obj, ASFilePos64 byteRanges, ASInt32 numEntries)

Tests whether the definition of a specified Cos object, in the file associated with the object's CosDoc, begins within any of a set of byte ranges. For details, see CosDocObjIsWithinRange() . This is the same as CosDocObjIsWithinRange() , except that the byte ranges are 64-bit file positions instead of a 32-bit file positions.

An exception is raised if obj is a direct object or numEntries is an odd number.

Parameters

obj — 

The Cos object (must be indirect).

 
byteRanges — 

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 — 

The number of byte offsets (not pairs) in the byteRanges array.

Returns

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

Since

PI_COS_VERSION >= 0x00070000

File: CosProcs.h
Line: 2233
CosDocOpenWithParams() 
Product availability: All
Platform availability: All

Syntax

CosDoc CosDocOpenWithParams(CosDocOpenParams params)

Opens a Cos document. The document does not need to be a PDF document. In params, the client specifies a file system and path name from which to open the document. The client may also specify a header string other than "%PDF-". For example, a client might want to open a private file type, such as "%FDF-".

Various exceptions may be raised. Opening non-Cos docs with this API is unsupported and may lock the file after an open attempt.

If the doRepair flag is set in the open flags, a minimal document can be opened. A minimal document contains the header string and a trailer dictionary. It may contain indirect objects before the trailer dictionary, and the trailer dictionary can refer to those objects, as shown in the following example:

FDF-1.0

1 0 obj

<< /Version /1.5

/FDF << /F 20 0 R /JavaScript 5 0 R >>

>>

trailer

<<

/Root 1 0 R

>>

Parameters

params — 

Specifies how to open the document.

Returns

A Cos document.

See Also

Since

PI_COS_VERSION >= 0x00020002

File: CosProcs.h
Line: 1037
CosDocSaveToFile() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

void CosDocSaveToFile(CosDoc cosDoc, ASFile asFile, CosDocSaveFlags saveFlags, CosDocSaveParams saveParams)

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

Parameters

cosDoc — 

IN/OUT The document to save.

 
asFile — 

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

 
saveFlags — 

IN/OUT An OR of the values listed in CosDocSave Flags specifying how to save the document.

 
saveParams — 

IN/OUT Optional parameters for use when saving a document, as described in CosDocSaveParams().

See Also

Exceptions

Since

PI_COS_VERSION >= 0x00020002 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.
PI_COS_VERSION >= 0x00020002

File: CosProcs.h
Line: 1104
CosDocSaveWithParams() 
Product availability: Acrobat, PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

void CosDocSaveWithParams(CosDoc cosDoc, ASFile asFile, CosDocSaveFlags saveFlags, CosDocSaveParams saveParams)

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

Parameters

cosDoc — 

IN/OUT The CosDoc for the document to save.

 
asFile — 

IN/OUT (Optional) If saving to the same file, do not pass in an ASFile. If saving to a different file, specify the file to which the document is written; it must be open in write mode. If NULL, this method saves to the ASFile originally associated with the CosDoc.

 
saveFlags — 

IN/OUT A bit field composed of the CosDocSaveFlags specifying how to save the document.

 
saveParams — 

IN/OUT (Optional) CosDocSaveParams parameters for use when saving the CosDoc document.

See Also

Exceptions

Since

PI_COS_VERSION >= 0x00040000 Saves a Cos document, optionally to a new file. It generates a cross-reference index (table or stream) by default.
PI_COS_VERSION >= 0x00040000

File: CosProcs.h
Line: 1215
CosDocSetAdobeExtensionLevel() 
Product availability: All
Platform availability: All

Syntax

void CosDocSetAdobeExtensionLevel(CosDoc dP, CosObj baseVersion, ASUns32 extension)

Adds the necessary data structures to the supplied CosDoc to identify it as containing Adobe extensions to ISO 32000 (aka ISO PDF)

Parameters

dP — 

The Cos document to set.

 
baseVersion — 

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

 
extension — 

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

See Also

Since

PI_COS_VERSION >= 0x00090000

File: CosProcs.h
Line: 2416
CosDocSetDirty() 
Product availability: All
Platform availability: All

Syntax

void CosDocSetDirty(CosDoc cosDoc, ASBool isDirty)

Sets a Cos document's dirty flag to a given boolean value. If this flag is true when the document is closed, it indicates that the document must be saved to preserve changes.

Parameters

cosDoc — 

The Cos document whose dirty flag is set.

 
isDirty — 

true if dirty, false otherwise.

See Also

Since

PI_COS_VERSION >= 0x00020002

File: CosProcs.h
Line: 1119