Layer | COS_Layer |
Object | CosDoc |
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 | ||
---|---|---|
CosDocEnumEOFs64 | ||
CosDocGetAdobeExtensionLevel | ||
CosDocHasISOExtensions | ||
CosDocObjIsWithinRange64 | ||
CosDocSetAdobeExtensionLevel | ||
kCosDocOpenDoRepair |
Typedef | ||
---|---|---|
CosDoc | ||
CosDocOpenParams | ||
CosDocOpenParamsRec | ||
CosDocSaveFlags | ||
CosDocSaveParams | ||
CosDocSaveParamsRec |
Structure | ||
---|---|---|
_t_CosDocOpenParams
Parameters used when saving a file using CosDocOpenWithParams().
|
||
_t_CosDocSaveParams
Parameters used when saving a file using CosDocSaveToFile() and CosDocSaveWithParams().
|
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 | ||
---|---|---|
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.
|
||
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.
|
||
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.
|
||
Enumerates all the indirect objects of a given CosDoc.
|
||
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.
|
||
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.
|
||
Gets the indirect CosObj with the latest generation number.
|
||
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.
|
||
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.
|
||
ASBool CosDocHasISOExtensions(CosDoc dP)
Tests whether the supplied CosDoc contains as extensions to ISO 32000 (aka ISO PDF)
|
||
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.
|
||
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.
|
||
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.
|
||
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-".
|
||
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.
|
||
Adds the necessary data structures to the supplied CosDoc to identify it as containing Adobe extensions to ISO 32000 (aka ISO PDF)
|
||
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.
|
CosDocEnumEOFs64 |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
#define CosDocEnumEOFs64 CosCallMacro(CosDocEnumEOFs64, 7)
File: CosCalls.h |
Line: 457 |
CosDocGetAdobeExtensionLevel |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
#define CosDocGetAdobeExtensionLevel CosCallMacro(CosDocGetAdobeExtensionLevel, 9)
File: CosCalls.h |
Line: 476 |
CosDocHasISOExtensions |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
#define CosDocHasISOExtensions CosCallMacro(CosDocHasISOExtensions, 9)
File: CosCalls.h |
Line: 478 |
CosDocObjIsWithinRange64 |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
#define CosDocObjIsWithinRange64 CosCallMacro(CosDocObjIsWithinRange64, 7)
File: CosCalls.h |
Line: 463 |
CosDocSetAdobeExtensionLevel |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
#define CosDocSetAdobeExtensionLevel CosCallMacro(CosDocSetAdobeExtensionLevel, 9)
File: CosCalls.h |
Line: 477 |
kCosDocOpenDoRepair |
Product availability: All |
Platform availability: All |
#define kCosDocOpenDoRepair 0x0001
File: CosExpT.h |
Line: 161 |
CosDoc |
Product availability: All |
Platform availability: All |
typedef struct _t_CosDoc* CosDoc;
File: CosExpT.h |
Line: 83 |
CosDocOpenParams |
Product availability: All |
Platform availability: All |
typedef _t_CosDocOpenParams CosDocOpenParams;
File: CosExpT.h |
Line: 182 |
CosDocOpenParamsRec |
Product availability: All |
Platform availability: All |
typedef _t_CosDocOpenParams CosDocOpenParamsRec;
File: CosExpT.h |
Line: 182 |
CosDocSaveFlags |
Product availability: All |
Platform availability: All |
typedef ASFlagBits CosDocSaveFlags;
File: CosExpT.h |
Line: 203 |
CosDocSaveParams |
Product availability: All |
Platform availability: All |
typedef _t_CosDocSaveParams CosDocSaveParams;
File: CosExpT.h |
Line: 235 |
CosDocSaveParamsRec |
Product availability: All |
Platform availability: All |
typedef _t_CosDocSaveParams CosDocSaveParamsRec;
File: CosExpT.h |
Line: 235 |
_t_CosDocOpenParams |
Product availability: All |
Platform availability: All |
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 |
size | The size of this |
|
openFlags | A bitfield of kCosDocOpen flags. |
|
fileSys | May be |
|
pathName | Must be provided. |
|
headerString | An expected header string (for example, |
_t_CosDocSaveParams |
Product availability: All |
Platform availability: All |
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 |
size | The size of this |
|
header | A complete header string, such as |
|
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 |
|
cryptVersion | The Cos cryptographic version - the version of the algorithm that is used to encrypt and decrypt document data. |
CosDocEnumEOFsProc |
Product availability: All |
Platform availability: All |
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 |
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 |
CosDocClose | () |
Product availability: All |
Platform availability: All |
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
File: CosProcs.h |
Line: 1047 |
CosDocCreate | () |
Product availability: All |
Platform availability: All |
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 |
An empty Cos document. |
See Also
Since
File: CosProcs.h |
Line: 1058 |
CosDocEnumEOFs | () |
Product availability: All |
Platform availability: All |
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 |
|
proc — | The |
|
clientData — | A pointer to user-supplied data to pass to |
|
See Also
Since
File: CosProcs.h |
Line: 1244 |
CosDocEnumEOFs64 | () |
Product availability: All |
Platform availability: All |
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 |
|
proc — | The |
|
clientData — | A pointer to user-supplied data to pass to |
|
See Also
Since
File: CosProcs.h |
Line: 2175 |
CosDocEnumIndirect | () |
Product availability: All |
Platform availability: All |
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 |
|
proc — | A user-supplied callback to call for each indirect object in |
|
clientData — | A pointer to user-supplied data to pass to |
|
See Also
Since
File: CosProcs.h |
Line: 1344 |
CosDocGetAdobeExtensionLevel | () |
Product availability: All |
Platform availability: All |
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 |
|
extension — | OUT The level of the extension expressed as a monotonically increasing integer. |
|
See Also
Since
File: CosProcs.h |
Line: 2403 |
CosDocGetID | () |
Product availability: All |
Platform availability: All |
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 |
|
permIDLength — | IN/OUT The length of |
|
Since
File: CosProcs.h |
Line: 1474 |
CosDocGetInfoDict | () |
Product availability: All |
Platform availability: All |
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 |
The document's |
See Also
Since
File: CosProcs.h |
Line: 954 |
CosDocGetObjByID | () |
Product availability: All |
Platform availability: All |
Gets the indirect CosObj
with the latest generation number.
Parameters
dP — | The |
|
objNum — | The local master index for the indirect Cos object to return. |
The |
See Also
Since
File: CosProcs.h |
Line: 1170 |
CosDocGetRoot | () |
Product availability: All |
Platform availability: All |
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 |
The document's |
See Also
Since
File: CosProcs.h |
Line: 940 |
CosDocHasFullCompression | () |
Product availability: All |
Platform availability: All |
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. |
|
See Also
Since
File: CosProcs.h |
Line: 1765 |
CosDocHasISOExtensions | () |
Product availability: All |
Platform availability: All |
Tests whether the supplied CosDoc
contains as extensions to ISO 32000 (aka ISO PDF)
Parameters
dP — | The Cos document to test. |
|
See Also
Since
File: CosProcs.h |
Line: 2389 |
CosDocHasPartialCompression | () |
Product availability: All |
Platform availability: All |
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. |
|
See Also
Since
File: CosProcs.h |
Line: 1789 |
CosDocObjIsWithinRange | () |
Product availability: All |
Platform availability: All |
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 |
|
Since
File: CosProcs.h |
Line: 1546 |
CosDocObjIsWithinRange64 | () |
Product availability: All |
Platform availability: All |
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 |
|
Since
File: CosProcs.h |
Line: 2233 |
CosDocOpenWithParams | () |
Product availability: All |
Platform availability: All |
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. |
A Cos document. |
See Also
Since
File: CosProcs.h |
Line: 1037 |
CosDocSaveToFile | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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 |
|
saveParams — | IN/OUT Optional parameters for use when saving a document, as described in CosDocSaveParams(). |
See Also
Exceptions
Since
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. File: CosProcs.h |
Line: 1104 |
CosDocSaveWithParams | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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 |
|
asFile — | IN/OUT (Optional) If saving to the same file, do not pass in an |
|
saveFlags — | IN/OUT A bit field composed of the |
|
saveParams — | IN/OUT (Optional) |
See Also
Exceptions
Since
File: CosProcs.h |
Line: 1215 |
CosDocSetAdobeExtensionLevel | () |
Product availability: All |
Platform availability: All |
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 |
|
extension — | The level of the extension expressed as a monotonically increasing integer. |
See Also
Since
File: CosProcs.h |
Line: 2416 |
CosDocSetDirty | () |
Product availability: All |
Platform availability: All |
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 |
|
isDirty — |
|
See Also
Since
File: CosProcs.h |
Line: 1119 |