The CP2 data model (part of the metadata module) describes a class that inherits all functions of the XMP data model and all functions of the Dataset class. The following subsections describe the functions specific to the CP2 data model.
Since most Certified PDF 2 information is stored as XMP, the "CP2" data model inherits from the "XMP" data model. Thus any XMP data model function can be invoked on a CP2 dataset as well.
A CP2 dataset is always embedded. It is not possible to create an external dataset with this data model.
A CP2 dataset can either be read-only or writable. When a writable CP2 dataset is finalized, an appropriate Certified PDF 2 signature is written to the backing file - in addition to updating the XMP and CP2 data structures.
A CP2 dataset can be obtained for any PDF file, whether it is a valid Certified PDF 2 file or not. This allows converting a regular PDF file into a Certified PDF 2 file.
A writable CP2 dataset can be "cleared", removing all Certified PDF 2 related information. This allows converting a Certified PDF 2 file into a regular PDF file.
File formats other than PDF are not supported, since Certified PDF 2 is tied to PDF.
Also, in an entry point that obtains a writable CP2 dataset on the incoming PDF file, it is not allowed to invoke an external application that changes that PDF file (or keeps it open for update without actually modifying it). This is because:
Returns true if the backing file for which this dataset was created has a valid Certified PDF 2 signature; returns false if the file has no conforming signature or if the signature is no longer valid because the file was modified.
Returns true if the backing file for which this dataset was created contains a valid Certified PDF 2 data structure with at least one session (not counting any sessions automatically added while obtaining the dataset); returns false otherwise.
If hasValidSignature() returns true, hasPreviousSessions() should return true as well (unless some application has created a corrupt Certified PDF 2 file). However if hasValidSignature() returns false, hasPreviousSessions() may still return true.
If fullSave is false or missing, these changes are affected through incremental save, which means the file will contain the original information and overhead. If fullSave is true, a full save is performed, eliminating any information that is no longer referenced and thus reducing overhead.
After this function was invoked on a dataset, invoking any of the CP2-specific functions on the dataset is a programming error and has unpredictable results.
A session represents the work done to a Certified PDF 2 file between saves.
The function returns true if any certificate was affected, false otherwise.
A certificate class associates additional semantics with a particular type of certificate. Even if the scripting API does not support access to the class properties that may be defined for certain certificate classes, it is important to specify the appropriate class. For example, a preflight certificate may cause a GWG Proof of Preflight ticket to be written in the PDF file, while other certificates do not show this correspondence.
The Certified PDF 2 specification describes two "built-in" classes, as described in the following table:
In many cases these built-in classes provide sufficient functionality. Third-party vendors may agree on other values for classID; it is recommended to register such other values with Enfocus to avoid name collisions.
After completion of this function, the indexes for the remaining certificates may have shifted and references to the removed certificate may have become invalid. Using such invalid references is a programming error and has unpredictable results.
A CP2 dataset can contain zero or more user objects. Each session can reference a user; multiple sessions can share the same user.
Object | Property | Exposure |
---|---|---|
Session | CP2:session_id CP2:start_byte CP2:user_id_ref |
Not exposed |
Session | CP2:start_time CP2:end_time |
Read-only |
Session | CP2:tool_id CP2:tool_version CP2:tool_desc CP2:appl_id CP2:appl_version CP2:appl_desc |
Read-only |
User | CP2:user_id | Not exposed |
Certificate | CP2:session_id_ref | Not exposed |
Certificate | CP2:time | Read-only |