typedef ASUns16 CosGeneration;
0 is not valid. typedef ASUns32 CosHashCode;
typedef ASUns32 CosID;
typedef OPAQUE_64_BITS CosObj;
typedef ASInt32 CosType;
ASBool CosObjEnumProc(CosObj obj, CosObj value, void *clientData);
obj | Possible values:
| ||||||||
value | Possible values:
For CosDocEnumIndirect() and PDDocEnumOCGs(), this is always the | ||||||||
clientData | User-supplied data that was passed in the call to CosObjEnum(), CosDocEnumIndirect(), or PDDocEnumOCGs().
|
void CosObjOffsetProc(CosObj obj, ASFilePos fileOffset, ASArraySize length, void *clientData);
obj | IN/OUT The CosObj found.
|
fileOffset | IN/OUT The offset of
obj into the PDF file. |
length | IN/OUT The length of
obj. |
clientData | IN/OUT A pointer to user-supplied data passed in the
offsetProcClientData parameter of the PDDocSaveParams structure. |
void CosObjOffsetProc64(CosObj obj, ASFilePos64 fileOffset, ASUns64 length, void *clientData);
ASBool CosObjSetCallbackFlagProc(CosObj obj, ASBool set);
obj | IN/OUT The CosObj marked.
|
set |
Returns a direct object of type CosNull. This NULL object is said to be invalid. You can compare an object to NULL using either of the following methods (the second is more efficient):
CosObjEqual(obj, CosNewNull());
CosObjGetType(obj) == CosNull;
In general, use CosNewNull() only to initialize a local variable or pass a parameter. NULL objects may be stored as array elements, but not as dictionary values. The following statements are equivalent:
CosDictPut(dict, key, CosNewNull());
CosDictRemove(dict, key);
CosObj CosNewNull(void);
NULL Cos object. Create a strong reference for an object. For a description of strong references, see CosDictSetWeakReference().
For indirect objects and direct nonscalars, CosObjAcquire() increments an internal reference count for obj. The reference count is used by the garbage collector, which is invoked during a full-save of the document. If the reference count is positive at the time of garbage collection (it is initially 0), then the object will not be garbage-collected, regardless of whether the object is accessible from the root of the document.
void CosObjAcquire(CosObj obj);
obj | A Cos object.
|
Compares the two CosObj objects. The result is 0 only if CosObjEqual(obj1, obj2) is true. Otherwise, the result is either-1 or 1. The result is useful for ordering or sorting Cos objects. No other significance should be attached to the result. In particular, a nonzero result indicates nothing about the type of either object.
The result is valid only within a single instance of the document. That is, if CosObjCmp() returns a nonzero value and the document is closed and then reopened, there is no guarantee that it will return the same nonzero value for those same objects.
The following conditions apply:
CosObjCmp(a, b) == 0, then CosObjCmp(b, a) == 0.CosObjCmp(a, b) > 0, then CosObjCmp(b, a) < 0.CosObjCmp(a, b) < 0, then CosObjCmp(b, a) > 0.CosObjCmp(a, b) == 0 and CosObjCmp(b, c) == 0, then CosObjCmp ( a, c) == 0.CosObjCmp(a, b) > 0 and CosObjCmp(b, c) > 0, then CosObjCmp (a, c) > 0.CosObjCmp(a, b) < 0 and CosObjCmp(b, c) < 0, then CosObjCmp(a, c) < 0.ASInt32 CosObjCmp(CosObj obj1, CosObj obj2);
obj1 | The first
CosObj to compare. |
obj2 | The second
CosObj to compare. |
-1 if obj1 is less than obj2, 1 if obj1 is greater than obj2. CosObj from one document to another (or the same document). CosObj CosObjCopy(CosObj srcObj, CosDoc destDoc, ASBool copyIndirect);
srcObj | The
CosObj to copy. |
destDoc | |
copyIndirect |
CosObj which has been copied to the destination document. Destroys a Cos object. This method does nothing if obj is a direct scalar object, such as the NULL object.
If a composite object (an array, dictionary or stream) is destroyed:
void CosObjDestroy(CosObj obj);
obj | The object to destroy.
|
ASBool CosObjEnum(CosObj obj, CosObjEnumProc proc, void *clientData);
obj |
|
proc | A user-supplied callback to call for each element of
obj. Neither proc nor any routine called by proc may modify obj. Doing so can produce undefined results or errors. For example, if obj is an array, proc must not call CosArrayRemove(); if obj is a dictionary, proc must not call CosDictPut(). |
clientData | A pointer to user-supplied data to pass to
proc each time it is called. |
true if every call to proc returned true. As soon as any call to proc returns false, the enumeration stops and CosObjEnum() returns false. NULL objects are equal.)
The last condition implies that the comparison is shallow. For example:
CosObj a, b, c; a = CosNewString (doc, "XYZ"); b = CosNewString(doc, "XYZ"); c = b;
In this case, CosObjEqual(a,b) is false, but CosObjEqual(b,c) is true.
ASBool CosObjEqual(CosObj obj1, CosObj obj2);
obj1 | An object to compare with
obj2. |
obj2 | An object to compare with
obj1. |
Tests whether an object is compressible. A compressible object can be added to a CosObjCollection.
An object is compressible only if all of the following conditions are true:
CosObjSetCompressibility().ASBool CosObjGetCompressibility(CosObj obj);
obj | The object to test.
|
CosDoc CosObjGetDoc(CosObj obj);
obj | The object whose CosDoc is obtained.
|
is raised if the object is a direct scalar object.
|
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).
CosGeneration CosObjGetGeneration(CosObj obj);
obj | IN/OUT The indirect
CosObj for which the generation number is obtained. A CosObj can be determined to be indirect using CosObjIsIndirect(). |
cosObj. is raised if the object is not valid or is not indirect.
|
CosID CosObjGetID(CosObj obj);
obj | IN/OUT The indirect
CosObj for which the ID is obtained. A CosObj can be determined to be indirect using CosObjIsIndirect(). |
obj. is raised if the object is not valid or is not indirect.
|
CosType CosObjGetType(CosObj obj);
obj | The object whose type is obtained.
|
Gets a 32-bit hash code for the given CosObj.
Two CosObj objects with equal hash codes are not necessarily equal, however. Use CosObjEqual() to determine the equality of Cos objects.
CosHashCode CosObjHash(CosObj obj);
obj | The
CosObj for which to obtain a hash code. |
ASBool CosObjIsCompressed(CosObj obj);
obj | The object to test.
|
ASBool CosObjIsIndirect(CosObj obj);
obj | The object to test.
|
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.
void CosObjRefreshAfterLinearizedSave(CosObj *obj, CosDoc doc);
obj | A pointer to the object to refresh. The object is updated by the method.
|
doc | The document that was saved.
|
Removes a strong reference for an object. For a description of strong references, see CosDictSetWeakReference().
For indirect objects and direct nonscalars, CosObjRelease() decrements an internal reference count for obj. The reference count is used by the garbage collector, which is invoked during a full-save of the document. If the reference count is positive at the time of garbage collection (it is initially 0), then the object will not be garbage-collected, regardless of whether the object is accessible from the root of the document.
void CosObjRelease(CosObj obj);
obj | A Cos object.
|
Controls whether a Cos object can be compressed. A compressible object can be added to a CosObjCollection.
If you set the compressibility to false, calling CosObjAddToCollection() on that object has no effect. If the object is already compressed, it is removed from the object collection to which it belongs and then marked as incompressible.
This method does nothing if applied to a direct object, a stream, or an object whose generation number is not zero. Objects of these types are never compressible.
void CosObjSetCompressibility(CosObj obj, ASBool compressible);
obj | The object whose compressibility is set.
|
compressible |