Add metadata information to a PDF file (to my thesis!) with pdftk

25 Nov

Using pdftk (THE pdf toolkit) an open source toolkit t manipulate and do magic tricks with pdf files.

In most PDF files are meta-information stored (for example, about the author, the subject of the file or the software used). With pdftk can you can print this information to standard output or save to a file:

> pdftk example.pdf dump_data
> pdftk example.pdf dump_data output info.txt

The info.txt file now contains all the metadata of the document. It is composed of key fields and their values:

InfoKey: Creator
InfoValue: TeX
InfoKey: Producer
InfoValue: pdfTeX-1.10b
InfoKey: CreationDate
InfoValue: D: 20041226182200
NumberOfPages: 4

Back up that file, because we will edit on top of that and then upload again with the pdftk to change the pdf file to include metadata.

InfoKey: Title
InfoValue: Mt-Djing: multitouch DJ table
InfoKey: Subject
InfoValue: Dissertation for Master degree
InfoKey: Keywords
InfoValue: DJing, NUI, multitouch, user-centered design
InfoKey: Author
InfoValue: Pedro Lopes

It must, this file does not include any information that can save a PDF file. Already occupied when updating fields remain unaffected if they are not included in the text file. You can also define additional key fields (eg “site”) and impose values. The update of the meta-information by means of:

> pdftk example.pdf update_info info_neu.txt output beispiel_metadaten.pdf

Output file and input file may not carry the same name. With a small shell script or batch file you can rename the output file accordingly.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: