Page 1 of 1

Embed XML Metadata into PDF

Posted: Fri Jul 05, 2024 4:02 pm
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!

Re: Embed XML Metadata into PDF

Posted: Sat Jul 06, 2024 1:15 pm
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

Re: Embed XML Metadata into PDF

Posted: Mon Jul 08, 2024 5:35 pm
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