When you save a Photoshop doc as a PDF it generates some XML elements which I assume are used by Photoshop for editing later. Anyway, a portion of these nodes look like this:
<rdf:li rdf:parseType="Resource">
<photoshop:LayerName>Item 1</photoshop:LayerName>
<photoshop:LayerText>Item 1</photoshop:LayerText>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<photoshop:LayerName>Item 2</photoshop:LayerName>
<photoshop:LayerText>Item 2</photoshop:LayerText>
</rdf:li>
Obviously it’s easy to replace some of the text in the nodes, but what I’m wondering is if there is someway (a tool, library, anything) that would “refresh” or re-compile the PDF using the new data in the nodes on the server; preferably in PHP.
I need to replace some placeholder text dynamically. That’s the goal.
If I’m on the wrong track, is there any way for this to be accomplished?
I’m willing to try to edit any file (good enough for print) like this whether it’s a psd, pdf, indesign, ai, anything.
Thanks!
What you’re posting as example is probably not XML as such but part of the XMP information in the file. XMP is a metadata format designed to be put inside of many file formats (PDF, image file formats, you name it).
The cool thing about XMP is that it was designed to be able to read it and even write it from and to file formats without actually understanding the file format. Meaning that you can scan a document and find all XMP packets without actually having to use a PDF library to parse the complete PDF file for example.
All information about XMP is here on the Adobe web site. They have an SDK for it too and if I remember correctly they even have a free library to read and write XMP for a number of languages (but it’s been a while since I’ve used that).
http://www.adobe.com/products/xmp/