Reputation: 2234
I want to be able to store some plugin-specific data in a PDF so that I can read it back when that PDF is loaded back, without this metadata being visible to the user.
How can I put this metadata into the PDF File?
Upvotes: 3
Views: 1779
Reputation: 111316
PDF supports XMP metadata. You should append your plug-in specific information as a payload in the XMP portion.
Upvotes: 2
Reputation: 10346
Depending on how you are generating and reading your PDFs you can use pdftk to edit your metadata. You can add an invisable tag to the PDF by adding it as a metadata property with a key and value by using pdftk dump_data to write all metadata to a text file, then append the new key and value to the text file, then use pdftk update_info to put back all the metadata, including the new key value pair.
Upvotes: 2
Reputation: 2204
The easiest way to do that is simply append the information as text to the end of the pdf file.
Upvotes: -2