com.adobe.livecycle.xmputility
Interface XMPUtilityService


public interface XMPUtilityService

Enables the creation of a Java object that invokes operations that belong to the XMP Utility service. Using this object, you can perform tasks such as retrieving metadata from a PDF document or replacing a PDF document's metadata. XMP provides a standard format for creating, processing, and interchanging metadata for a wide variety of applications. XMP provides a model by which metadata is represented. XMP metadata is encoded as XML-formatted text that uses the W3C standard Resource Description Framework (RDF).

In XMP, metadata consists of a set of properties that are associated with a document. Metadata includes such properties as the author, title, and modification date of a document. In a PDF file, metadata can be stored in two places:

For information, see Working With The XMP Utility Service.


Method Summary
 XMPUtilityMetadata exportMetadata(Document inPDFDoc)
          Returns the metadata located within a PDF document as an XMPUtilityMetadata object.
 Document exportXMP(Document inPDFDoc)
          Returns the metadata located within a PDF document as an XMP document.
 java.lang.String getVersion()
          Returns the version of the XMP Utility service.
 Document importMetadata(Document inPDFDoc, XMPUtilityMetadata metadata)
          Replaces the metadata located within a PDF document with new metadata.
 Document importXMP(Document inPDFDoc, Document xmp)
          Replaces the metadata located in a PDF document with newer metadata.
 

Method Detail

getVersion

java.lang.String getVersion()
Returns the version of the XMP Utility service.

Returns:
A string value that specifies the version of the XMP Utility service, including the build number.

importXMP

Document importXMP(Document inPDFDoc,
                   Document xmp)
                   throws XMPUtilityException
Replaces the metadata located in a PDF document with newer metadata.

Parameters:
inPDFDoc - A Document object that represents the PDF document for which metadata is replaced.
xmp - A Document object that represents XMP metadata.
Returns:
A Document object that represents the PDF document that contains new metadata.
Throws:
XMPUtilityException - if an error occurs during this operation.

exportXMP

Document exportXMP(Document inPDFDoc)
                   throws XMPUtilityException
Returns the metadata located within a PDF document as an XMP document.

Parameters:
inPDFDoc - A Document object that represents the PDF document for which metadata is returned.
Returns:
A Document object that represents XMP metadata. Data located within this object can be written to an XML file.
Throws:
XMPUtilityException - if an error occurs during this operation.

importMetadata

Document importMetadata(Document inPDFDoc,
                        XMPUtilityMetadata metadata)
                        throws XMPUtilityException
Replaces the metadata located within a PDF document with new metadata. Any null values in the supplied XMPUtilityMetadata object removes entries from the metadata. Also, as a fix for a bug, keywords supplied in the keywords list of the metadata object supplied will have leading and trailing whitespace removed, whitespace being defined by Java's trim operation on strings.

Parameters:
inPDFDoc - A Document object that represents the PDF document for which metadata is replaced.
metadata - A XMPUtilityMetadata object that contains metadata values that are used to replace existing metadata.
Returns:
A Document object that represents the PDF document that contains new metadata.
Throws:
XMPUtilityException - if an error occurs during this operation.

exportMetadata

XMPUtilityMetadata exportMetadata(Document inPDFDoc)
                                  throws XMPUtilityException
Returns the metadata located within a PDF document as an XMPUtilityMetadata object.

Parameters:
inPDFDoc - A Document object that represents the PDF document for which metadata is returned.
Returns:
An XMPUtilityMetadata object that represents XMP metadata.
Throws:
XMPUtilityException - if an error occurs during this operation.