Changing PDF Metadata on Ubuntu

January 4th, 2010

I got a Sony E-Reader as a Christmas present from my parents this year. I absolutely love it! It will definitely change how I read books. I no longer have to lug around several books everywhere I go. The best part is that I can put all my journal articles in it. I no longer have to print off hundreds of pages of journal articles. However, there is one thing that I have found really annoying. It is practically impossible to find programs that change the pdf’s metadata. It took me awhile to find one that actually worked.

I ended up finding a Linux Program called PDFTK. I wanted to go over some basic commands (mainly so that I can find them easily).

Installing PDFTK:

sudo apt-get install pdftk

Edit Existing Meta-Data:

pdftk book.pdf dump_data output report.txt

You can then edit the data in report.txt which we can later upload back to the pdf. The text file will contain key value pairs like:

InfoKey: Title
InfoValue: Coders At Work
InfoKey: Author
InfoValue: Peter Seivel
InfoKey: Subject
InfoValue: Programming

After you edit this file, you can update the new meta-data to the pdf.

Update PDF Meta-Data:

pdftk book.pdf update_info report.txt output bookcopy.pdf

Comment by Koko

Made Wednesday, 23 of June , 2010 at 12:46 pm

This is great but a bit cumbersome when editing a lot of metadata. I know Calibre can do that with a GUI but I couldn’t warm up to Calibre. So what else can one use?

Comment by eldila

Made Thursday, 24 of June , 2010 at 7:51 pm

I am sure that there are a few GUI programs which will do this. However, I am not familiar with them. I am used to doing things from the command line, so I wasn’t looking for GUI solutions. I agree the method is a bit cumbersome. However, because it is on the command line, it is easy to create batch scripts.

Leave a Reply