Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

How to get XMP MetaData as an XML String in a process?

Avatar

Level 2

Hi there,

I have a process where I would like to export a documents XMP MetaData, manipulate the XMP MetaData and then import the MetaData again to the document.

I thougt first I will use the service Name "XMPUtilityService" with the Service Operation "Export XMP" to export the XMP MetaData as a document.

Hoewer I am not sure how to manipulate the output document from the Export XMP service.

When I print out the document.toString() in a execute Script Service I get the following:

<document state="active" senderVersion="0" persistent="false" senderPersistent="false" passivated="false" senderPassivated="false" deserialized="false" senderHostId="null" callbackId="0" senderCallbackId="0" callbackRef="null" isLocalizable="true" isTransactionBound="false" defaultDisposalTimeout="600" disposalTimeout="600" maxInlineSize="65536" defaultMaxInlineSize="65536" inlineSize="3440" contentType="null" length="-1"><cacheId/><localBackendId/><globalBackendId/><senderLocalBackendId/><senderGlobalBackendId/><inline><?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="A...</inline><senderPullServantJndiName/><attributes/></document>

Actually I expected something like this:

<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.0-jc006 DEBUG-1.0, 2009 Jun 23 11:07:21-PDT">
   <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
      <rdf:Description rdf:about=""
            xmlns:pdf="http://ns.adobe.com/pdf/1.3/">
         <pdf:Producer>Adobe LiveCycle PDF Generator ES2</pdf:Producer>
      </rdf:Description>
      <rdf:Description rdf:about=""
            xmlns:xmp="http://ns.adobe.com/xap/1.0/">
         <xmp:ModifyDate>2010-04-20T20:43:59+02:00</xmp:ModifyDate>
         <xmp:MetadataDate>2010-04-20T20:43:59+02:00</xmp:MetadataDate>
      </rdf:Description>
      <rdf:Description rdf:about=""
            xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/">
         <xmpMM:DocumentID>uuid:0cf2c6c6-2fba-2b39-5fb6-33ad8ccf58aa</xmpMM:DocumentID>
         <xmpMM:InstanceID>uuid:187bc5a2-acb0-2fa9-711d-33ad8ccf58aa</xmpMM:InstanceID>
      </rdf:Description>
   </rdf:RDF>
</x:xmpmeta>

<?xpacket end="w"?>

What do I need to do to get the XMPMeta data as an XML String from a document within a process?

Thanks in advance!

Paul

4 Replies

Avatar

Level 10

The easiest thing is to change the output of the export metadata operation to "variable" and use the green + button to create a variable.

You'll see that it creates a variable of type XMPUtilityMetadata.

You can manipulate this variable in xPath and reuse it with the import metadata step.

Jasmin

Avatar

Level 2

Hi,

thanks for the answer.

I know that I can retrieve the XMPUtilityMetadata object, but this object provides only access to a few information suche as creator, subject, producer, etc.

However I would like to retrieve the whole XML String of the XMP Metadata.

How is this possible?

Thanks.

Paul

Avatar

Level 10

You can also use Assembler to extract the metadata.

I tried with the following ddx and it gave me more information:

<Metadata result="doc1.xmp"
<PDF source="doc1.pdf"/>
</Metadata>

Jasmin

Avatar

Level 2

Yes, this is good. Sorry for the late response. I have read the answer earlier.

This helps.

Thanks, Jasmin.

Paul