Pdftk can take a plain-text file of these same key/value pairs and update a PDF's Info dictionary to match. Currently, it does not update the PDF's XMP stream. The command would look like this:
pdftk mydoc.pdf update_info new_info.txt output mydoc.updated.pdf
This will add or modify the Info keys given by mydoc.new_data.txt. Note that the output PDF filename must be different from the input. To remove a key/value pair, simply pass in the key/value with an empty value, like so:
InfoKey: MyDataKey
InfoValue:
Use pdftk to strip all Info and XMP metadata from a document by copying its pages into a new PDF, like so:
pdftk mydoc.pdf cat A output mydoc.no_metadata.pdf
The PDF specification defines several Info fields. Be careful to use these only as described in the specification. They are Title, Author, Subject, Keywords, Creator, Producer, CreationDate, ModDate, and Trapped.
pdftk mydoc.pdf update_info new_info.txt output mydoc.updated.pdf
This will add or modify the Info keys given by mydoc.new_data.txt. Note that the output PDF filename must be different from the input. To remove a key/value pair, simply pass in the key/value with an empty value, like so:
InfoKey: MyDataKey
InfoValue:
Use pdftk to strip all Info and XMP metadata from a document by copying its pages into a new PDF, like so:
pdftk mydoc.pdf cat A output mydoc.no_metadata.pdf
The PDF specification defines several Info fields. Be careful to use these only as described in the specification. They are Title, Author, Subject, Keywords, Creator, Producer, CreationDate, ModDate, and Trapped.