DL Logo

Metadata Callback Signatures

CosDictXAPMetadataDidChangeProc

Header: PDMetadataExpT.h:70

Description

Receives the notification that the XMP metadata describing an object represented by a Cos dictionary or stream has changed.

Syntax

void CosDictXAPMetadataDidChangeProc(CosObj dict, ASText newMetadata, void *data);

Parameters

dict
The Cos dictionary or stream representing an object whose describing XMP metadata has changed.
newMetadata
A serialized representation of the new describing XMP metadata You do not own this.
data
Notification data provided at notification registration time.

PDDocXAPMetadataDidChangeProc

Header: PDMetadataExpT.h:57

Description

Receives the notification that the XMP metadata describing a document as a whole has changed.

Syntax

void PDDocXAPMetadataDidChangeProc(PDDoc pdDoc, ASText newMetadata, void *data);

Parameters

pdDoc
The PDDoc whose describing XMP metadata has changed.
newMetadata
A serialized representation of the new describing XMP metadata. You do not own this.
data
Notification data provided at notification registration time.

PDEContainerXAPMetadataDidChangeProc

Header: PDMetadataExpT.h:84

Description

Receives the notification that the XMP metadata describing a marked content sequence has changed.

Syntax

void PDEContainerXAPMetadataDidChangeProc(PDEContainer container, ASText newMetadata, void *data);

Parameters

container
The PDEContainer representing a marked content sequence whose describing XMP metadata has changed.
newMetadata
A serialized representation of the new describing XMP metadata You do not own this.
data
Notification data provided at notification registration time.

Metadata Functions

CosDictGetXAPMetadata

Header: PDMetadataProcs.h:226

Description

Gets the XMP metadata associated with a Cos dictionary or stream. If there is XMP metadata, it is returned as an ASText in the output parameter metadataASText. The ASText returned becomes the property of the client, which is free to alter or destroy it.

Note: The term XAP refers to an early internal code name for Adobe's Extensible Metadata Platform (XMP). For more information on this protocol, see the Adobe XMP specification.

Related Methods

Syntax

ASBool CosDictGetXAPMetadata(IN CosObj obj, OUT ASText *metadataASText);

Parameters

obj
A dictionary or stream CosObj.
metadataASText
(Filled by the method) The ASText object from which the XMP metadata will be obtained.

Returns

true if obj has associated XMP metadata, false if it does not. It also returns false if obj is not a dictionary or stream. It returns true exactly when the Cos object obj has XMP metadata.

Exceptions

CosDictSetXAPMetadata

Header: PDMetadataProcs.h:263

Description

Sets the XMP metadata associated with a Cos dictionary or stream. It replaces the XMP metadata associated with the Cos object obj with the XMP metadata stored in metadataASText.

The contents of metadataASText must be well-formed XML and Resource Description Format (RDF), as defined by the W3C (see http://www.w3.org/RDF), that also forms valid XMP. CosDictSetXAPMetadtata() will not destroy metadataASText or alter its text.

Note: CosDictSetXAPMetadtata() will raise an exception if the user does not have permission to change the document.

Note: The term XAP refers to an early internal code name for Adobe's Extensible Metadata Platform (XMP). For more information on this protocol, see the Adobe XMP specification.

Related Methods

Syntax

void CosDictSetXAPMetadata(IN CosObj obj, IN ASText metadataASText);

Parameters

obj
The dictionary or stream Cos object whose associated XMP metadata is to be set.
metadataASText
The ASText object containing the metadata to be associated with obj.

Exceptions

PDDocCountXAPMetadataArrayItems

Header: PDMetadataProcs.h:543

Description

Returns the number of array items in a property array associated with a PDDoc.

Note: XMP properties can have an XML substructure; this method can only set a value for simple textual properties.

Note: The term XAP refers to an early internal code name for Adobe's Extensible Metadata Platform (XMP). For more information on this protocol, see the Adobe XMP specification.

Syntax

ASInt32 PDDocCountXAPMetadataArrayItems(PDDoc pdDoc, ASText namespaceName, ASText path);

Parameters

pdDoc
The document containing the metadata.
namespaceName
The XML namespace URI for the schema in which the property is to be found.
path
The name of the simple property to be modified.

Returns

An ASInt32 which is the number of array items in the property array.

Exceptions

PDDocGetInfo

Header: PDProcs.h:2330

Description

Gets the value of a key in a document's Info dictionary, or the value of this same key in the XMP metadata, whichever is later. However, it is preferable to use PDDocGetXAPMetadataProperty(), because it also allows accessing XMP properties that are not duplicated in the Info dictionary.

See the description of the Document Information Dictionary in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 14.3.3, page 549.

You can find this document on the web store of the International Standards Organization (ISO).

All values in the Info dictionary should be strings; other data types such as numbers and booleans should not be used as values in the Info dictionary.

Users may define their own Info dictionary entries. In this case, it is strongly recommended that the key have the developer's prefix assigned by the Adobe Solutions Network.

Note: This text is stored in either PDFDocEncoding or in Unicode. If it is stored in Unicode, a valid Byte Order Mark must be present.

Syntax

ASInt32 PDDocGetInfo(PDDoc doc, const char *infoKey, char *buffer, ASInt32 bufSize);

Parameters

doc
The document whose Info dictionary key is obtained.
infoKey
The name of the Info dictionary key whose value is obtained.
buffer
(Filled by the method) The buffer containing the value associated with infoKey. If buffer is NULL, the method will just return the number of bytes required.
bufSize
The maximum number of bytes that can be written into buffer.

Returns

If buffer is NULL, it returns the number of bytes in the specified key's value. If buffer is not NULL, it returns the number of bytes copied into buffer, excluding the terminating NULL. You must pass at least the length + 1 as the buffer size since the routine adds a '\\0' terminator to the data, even though the data is not a C string (it can contain embedded '\\0' values).

PDDocGetInfoASText

Header: PDProcs.h:11562

Description

Gets the value of a key in a document's Info dictionary, or the value of this same key in the XMP metadata, whichever is latest as an ASText object.

Syntax

void PDDocGetInfoASText(PDDoc doc, const ASText key, ASText value);

Parameters

doc
The document whose Info dictionary key is obtained.
key
The name of the Info dictionary key whose value is obtained.
value
(Filled by the method) The text object containing the value associated with key. The client must pass a valid ASText object value. The routine does not allocate it.

PDDocGetMergedXAPKeywords

Header: PDMetadataProcs.h:430

Description

Yields an ASText containing a semicolon-separated list of fields. The first such field is the entire contents of the pdf:Keywords property of the document XMP; the remaining fields are the contents of successive items in the xmp:Keywords bag of keyword items.

The document's metadata is not modified as a result of this call.

Note: The term XAP refers to an early internal code name for Adobe's Extensible Metadata Platform (XMP). For more information on this protocol, see the Adobe XMP specification.

Syntax

ASText PDDocGetMergedXAPKeywords(PDDoc pdDoc);

Parameters

pdDoc
The document containing the metadata from which to extract the merged list of keywords.

Returns

An ASText containing the textual representation of the merged list of keywords. The ASText returned becomes the sole property of the caller.

PDDocGetXAPMetadata

Header: PDMetadataProcs.h:140

Description

Gets the XMP metadata associated with a document. It returns an ASText whose text is the XML text of the XMP metadata associated with the document pdDoc. The ASText becomes the property of the client, which is free to alter or destroy it.

The XMP metadata returned always represents all the properties in the pdDoc object's Info dictionary, and can also contain properties not present in the Info dictionary. This call is preferred to PDDocGetInfo(), which only returns properties that are in the Info dictionary (although the older function is supported for compatibility).

Note: The term XAP refers to an early internal code name for Adobe's Extensible Metadata Platform (XMP). For more information on this protocol, see the Adobe XMP specification.

Syntax

ASText PDDocGetXAPMetadata(IN PDDoc pdDoc);

Parameters

pdDoc
The document containing the metadata.

Returns

An ASText object containing the XMP metadata associated with the document pdDoc.

Exceptions

PDDocGetXAPMetadataArrayItem

Header: PDMetadataProcs.h:489

Description

Gets the value of an XMP metadata array item, associated with a document, based on an index. It returns an ASText object containing the XML text of the value of the specified property in the XMP metadata array associated with the document pdDoc. The ASText object becomes the property of the client, which is free to alter or destroy it.

Note: XMP properties can have an XML substructure; this method can only retrieve values from simple textual properties.

Note: The term XAP refers to an early internal code name for Adobe's Extensible Metadata Platform (XMP). For more information on this protocol, see the Adobe XMP specification.

Syntax

ASText PDDocGetXAPMetadataArrayItem(PDDoc pdDoc, ASText namespaceName, ASText path, ASInt32 index);

Parameters

pdDoc
The document containing the metadata.
namespaceName
The XML namespace URI for the schema in which the property is to be found.
path
The name of the desired simple property.
index
The index in the metadata property array associated with the property.

Returns

An ASText object containing the XML text of the value of the specified property in the XMP metadata associated with the document pdDoc, or an empty ASText object if no such property is found.

Exceptions

PDDocGetXAPMetadataProperty

Header: PDMetadataProcs.h:375

Description

Gets the value of an XMP metadata property associated with a document. It returns an ASText whose text is the XML text of the value of the specified property in the XMP metadata associated with the document pdDoc. The ASText becomes the property of the client, which is free to alter or destroy it.

The XMP metadata can represent all properties in the pdDoc object's Info dictionary, as well as other properties. This call is preferred to PDDocGetInfo(), which only allows access to properties that are in the Info dictionary (although the latter is supported for compatibility).

Note: The term XAP refers to an early internal code name for Adobe's Extensible Metadata Platform (XMP). For more information on this protocol, see the Adobe XMP specification.

Syntax

ASText PDDocGetXAPMetadataProperty(PDDoc pdDoc, ASText namespaceName, ASText path);

Parameters

pdDoc
The document containing the metadata.
namespaceName
The XML namespace URI for the schema in which the property is to be found.
path
The name of the desired simple property. Note that XMP properties can have an XML substructure; this method can only retrieve values from simple textual properties.

Returns

An ASText object containing the XML text of the value of the specified property in the XMP metadata associated with the document pdDoc, or an empty ASText if no such property is found.

Exceptions

PDDocMergeXAPKeywords

Header: PDMetadataProcs.h:452

Description

Causes a string produced as by PDDocGetMergedXAPKeywords() to be stored as the new value of the pdf:Keywords property, and the former value of the pdf:Keywords property to be stored as an item in the xmp:Keywords bag of keyword items.

The algorithm used to compute merged keywords lists detects the case in which the keywords lists have already been merged and makes no changes to the XMP metadata in this case.

Note: The term XAP refers to an early internal code name for Adobe's Extensible Metadata Platform (XMP). For more information on this protocol, see the Adobe XMP specification.

Syntax

void PDDocMergeXAPKeywords(PDDoc pdDoc);

Parameters

pdDoc
The document containing the metadata that is to be modified to make the pdf:Keywords and xmp:Keywords properties conform.

PDDocSetInfo

Header: PDProcs.h:2366

Description

Sets the value of a key in a document's Info dictionary. However, it is preferable to use PDDocSetXAPMetadataProperty(), because it also allows accessing XMP properties that are not duplicated in the Info dictionary.

See the description of the Document Information Dictionary in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 14.3.3, page 549.

You can find this document on the web store of the International Standards Organization (ISO).

All values in the Info dictionary should be strings; other data types such as numbers and Boolean values should not be used as values in the Info dictionary. If an Info dictionary key is specified that is not currently in the Info dictionary, it is added to the dictionary.

Users may define their own Info dictionary entries. In this case, it is strongly recommended that the key have the developer's prefix assigned by the Adobe Developers Association.

Note: This text is stored in either PDFDocEncoding or in Unicode. If it is stored in Unicode, a valid Byte Order Mark must be present.

Syntax

void PDDocSetInfo(PDDoc doc, const char *infoKey, const char *buffer, ASInt32 nBytes);

Parameters

doc
The document whose Info dictionary key is set.
infoKey
The name of the Info dictionary key whose value is set.
buffer
The buffer containing the value to associate with infoKey.
nBytes
The number of bytes in buffer.

PDDocSetInfoAsASText

Header: PDProcs.h:11579

Description

Sets the value of a key in a document's Info dictionary.

Syntax

void PDDocSetInfoAsASText(PDDoc doc, const ASText infoKey, const ASText value);

Parameters

doc
The document whose Info dictionary key is set.
infoKey
The name of the Info dictionary key whose value is set.
value
The text object containing the value to associate with infoKey.

PDDocSetXAPMetadata

Header: PDMetadataProcs.h:190

Description

Sets the XMP metadata associated with a document. It replaces the XMP metadata associated with the document pdDoc with the XMP metadata stored in metadataASText.

The contents of metadataASText must be well-formed XML and Resource Description Format (RDF), as defined by the W3C (see http://www.w3.org/RDF), that also forms valid XMP. If metadataASText is ill-formed, an error is raised.

The call does not destroy metadataASText or alter its text. This method copies the textual information it needs, so subsequent alteration or destruction of metadataASText does not affect the document XMP metadata.

Calling PDDocSetXAPMetadata() changes the contents of the pdDoc object's Info dictionary to reflect the values of corresponding metadata properties represented in metadataASText. The XMP metadata can also contain properties that are not reflected in the Info dictionary.

Note: This method raises an exception if the user does not have permission to change the document.

Note: If you use this method to set metadata that does not respect the requirement that aliased metadata items (such as pdf:Title and xap:Title) be equal, then the mechanism that maintains this equality when you set metadata via PDDocSetInfo() is disabled.

Note: The term XAP refers to an early internal code name for Adobe's Extensible Metadata Platform (XMP). For more information on this protocol, see the Adobe XMP specification.

Syntax

void PDDocSetXAPMetadata(IN PDDoc pdDoc, IN ASText metadataASText);

Parameters

pdDoc
The document whose metadata is to be set.
metadataASText
An ASText object containing the metadata to be stored in the document.

Exceptions

is raised if pdDoc is not writable.

PDDocSetXAPMetadataArrayItem

Header: PDMetadataProcs.h:518

Description

Sets the value of an XMP metadata array item, associated with a document, based on an index.

Note: XMP properties can have an XML substructure; this method can only set a value for simple textual properties.

Note: The term XAP refers to an early internal code name for Adobe's Extensible Metadata Platform (XMP). For more information on this protocol, see the Adobe XMP specification.

Syntax

void PDDocSetXAPMetadataArrayItem(PDDoc pdDoc, ASText namespaceName, ASText namespacePrefix, ASText path, ASInt32 index, ASText newValue);

Parameters

pdDoc
The document containing the metadata.
namespaceName
The XML namespace URI for the schema in which the property is to be found.
namespacePrefix
A brief string to be used as an abbreviation when creating the XML representation of the property. This string must not be empty.
path
The name of the simple property to be modified.
index
The index in the metadata property array associated with the property.
newValue
The new XML text value for the property.

Exceptions

PDDocSetXAPMetadataProperty

Header: PDMetadataProcs.h:407

Description

Sets the value of an XMP metadata property associated with a document. The XMP metadata represents all the properties in pdDoc object's Info dictionary, and can also contain properties that are not in the Info dictionary. This call is preferred to PDDocSetInfo(), which only allows access to properties that are in the Info dictionary (although the older function is supported for compatibility).

Note: XMP properties can have an XML substructure; this method can only set a value for simple textual properties.

Note: The term XAP refers to an early internal code name for Adobe's Extensible Metadata Platform (XMP). For more information on this protocol, see the Adobe XMP specification.

Syntax

void PDDocSetXAPMetadataProperty(PDDoc pdDoc, ASText namespaceName, ASText namespacePrefix, ASText path, ASText newValue);

Parameters

pdDoc
The document containing the metadata.
namespaceName
The XML namespace URI for the schema in which the property is to be found.
namespacePrefix
A brief string to be used as an abbreviation when creating the XML representation of the property. This string must not be empty.
path
The name of the simple property to be modified.
newValue
The new XML text value for the property.

Exceptions

PDEContainerGetXAPMetadata

Header: PDMetadataProcs.h:308

Description

Gets the XMP metadata associated with a PDEContainer. If there is XMP metadata, it is returned as an ASText in the output parameter metadataASText. The ASText returned becomes the property of the client, which is free to alter or destroy it.

Note: The term XAP refers to an early internal code name for Adobe's Extensible Metadata Platform (XMP). For more information on this protocol, see the Adobe XMP specification.

Syntax

ASBool PDEContainerGetXAPMetadata(IN PDEContainer pdeContainer, OUT ASText *metadataASText);

Parameters

pdeContainer
The container whose metadata is retrieved.
metadataASText
(Filled by the method) If there is XMP metadata, it is returned as an ASText object in this parameter. The ASText object returned becomes the property of the client, which is free to alter or destroy it.

Returns

true exactly when the pdeContainer has XMP metadata.

Exceptions

PDEContainerSetXAPMetadata

Header: PDMetadataProcs.h:335

Description

Sets the XMP metadata associated with a PDEContainer. Replaces the XMP metadata associated with pdeContainer with the XMP metadata stored in metadataASText. The contents of metadataASText must be well-formed XML and Resource Description Format (RDF), as defined by the W3C (see http://www.w3.org/RDF), that also forms valid XMP. PDEContainerSetXAPMetadtata() will not destroy metadataASText or alter its text.

Note: The term XAP refers to an early internal code name for Adobe's Extensible Metadata Platform (XMP). For more information on this protocol, see the Adobe XMP specification.

Syntax

void PDEContainerSetXAPMetadata(IN PDEContainer pdeContainer, IN PDDoc pdDoc, IN ASText metadataASText);

Parameters

pdeContainer
The container whose metadata is set.
pdDoc
The document containing pdeContainer.
metadataASText
Well-formed XML and RDF that also forms valid XMP.

Exceptions