PDF metadata script

· Info

After buying an ereader, I finally had a way to read all of my PDFs nicely. Problem was, every time I sideloaded a PDF, the usually very nice listing of all my ebooks and PDFs was filled with garbled filenames and non-existent author names.

Ghostscript provided a way to fix this through its PDF-editing magic, but manually changing the metadata of each PDF I sideloaded to my Kobo was becoming a pain. Thus, I concocted this little script.

Using it is dead easy. Just throw in the name of the PDF(s)’s author, and the filenames of all the PDFs they’ve written. The script will automagically use Ghostscript to set the author name and title properly in each file’s metadata. I wrote the script to generate titles based on how I name my PDF files, so it works by replacing underscores in filenames with spaces, and then capitalising every word (e.g.: my_file.pdf gets the title My File). Feel free to mess with the script so it works with however you name your files.