Changing PDF Metadata under Linux


If you are using e-book readers, changing meta information in PDF files might be useful. The PDF Toolkit has powerful capabilities that includes updating PDF metadata. Even though pdftk is a command line application and does not have editing feature, updating is a really simple process. All you have to do is, extract current metadata into a text file, edit it, and update the PDF file!

The following command extracts metadata from PDF file to metadata.txt

pdftk example.pdf dump_data output metadata.txt

Now, you can edit metadata.txt file with your favorite text editor. An example PDF metadata:

InfoKey: Title
InfoValue: Changing PDF Metadata under Linux
InfoKey: Author
InfoValue: Onur Guzel

Remember, you should only change “InfoValue”s. After editing metadata, you can update your PDF file by running the following command:

pdftk example.pdf update_info metadata.txt output example_updated.pdf