问题
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?
回答1:
PDF supports XMP metadata. You should append your plug-in specific information as a payload in the XMP portion.
回答2:
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.
回答3:
The easiest way to do that is simply append the information as text to the end of the pdf file.
来源:https://stackoverflow.com/questions/757192/metadata-in-pdf-files