Embed XML Metadata into PDF

Post Reply
User avatar
Soul Forge
Member
Posts: 63
Joined: Wed Jul 12, 2023 5:25 pm

Embed XML Metadata into PDF

Post by Soul Forge »

Hello!

Do you guys know if there is a way to actually embed XML Metadata into the PDF?

My goal is to create a bunch of variables inside the Switch and transform it to XML. Then embed it in the PDF, so the next time I process it I don't have to do all the checks again!
jan_suhr
Advanced member
Posts: 688
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: Embed XML Metadata into PDF

Post by jan_suhr »

You can try this tool, it will run as a CLI with Execute command.

https://exiftool.org/

And what you can with PDF files and this tool
https://exiftool.org/TagNames/PDF.html
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps
freddyp
Advanced member
Posts: 1135
Joined: Thu Feb 09, 2012 3:53 pm

Re: Embed XML Metadata into PDF

Post by freddyp »

Another approach is to inject XMP into a PDF. Attached is a flow with a sample XMP file. In order to make it work for you, you will have to modify the XMP file of course.

Code: Select all

<x:xmpmeta xmlns:x="adobe:ns:meta/">
   <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
      <rdf:Description rdf:about="Example of XMP injection" xmlns:enfocus="http://www.enfocus.com/xmp/1.0/">
         <enfocus:FirstName></enfocus:FirstName>
         <enfocus:LastName></enfocus:LastName>
         <enfocus:Company></enfocus:Company>
         <enfocus:Mail></enfocus:Mail>
      </rdf:Description>
   </rdf:RDF>
</x:xmpmeta>
Change xmlns:enfocus to something that is meaningful to you. Also change the definition of the namespace. It is a convention to use a URL, but the URL does not have to exist. IMPORTANT: for XMP the namespace definition MUST end with / or #.

Anything you put in there is afterwards accessible as embedded metadata.
XMP inject.zip
ZIP with flow and XMP file
(22.66 KiB) Downloaded 440 times
Post Reply