I have a number of PDFs that I downloaded from JStor. They come with unhelpful numeric filenames, but often there is at least a title if not the author in the metadata.

How do I batch rename a number of PDF's so that it will search the metadata and rename the file "Author-Title" when both "Author" and "Title" are specified in the metadata? If one is missing, I'd like it to just rename the file to reflect the metadata which is present, naming the file "Author" or "Title". If there is no metadata I would like nothing to change.

  • 1
    link This question is a near duplicate. Not quite a duplicate because he wants a solution for .pdf's without MetaData. – Dennis Dec 23 '12 at 6:18

Free Bibliography software like

can do this for you.

  • I assume that BibDesk (which is not platform independent, but much more mac-like) can also do that.
  • 1
    I wound up getting Mendeley for this purpose. I already use BibDesk, but Mendeley seems to be better at identifying the PDFs. Thaks! – Dennis Dec 23 '12 at 16:28

Here's one possible way, which would involve writing a script that shouldn't be too horrible.

Use JHOVE to extract metadata from the file and write it to an XML file. Use an XPath expression to pull out these paths:


where the three property elements in the path contain <name> elements whose value is respectively, "PDFMetadata", "Info", and "Title" to grab the title, and "PDFMetadata, "Info", and "Author" to grab the author. Then you can use these programmatically to create the new file name.

This is a rough outline, but I think the idea can work.

Full disclosure: I wrote most of the code for JHOVE.

  • This is very helpful, I'll look into figuring out how to implement your suggestion. Looking at JHOVE, it seems to be associated with JStor. Will this solution only work for .pdfs gotten from JSTOR or is it a general solution? – Dennis Dec 23 '12 at 4:32
  • It should work with any PDF. The association of JHOVE with JSTOR is just a coincidence. – gmcgath Dec 24 '12 at 0:25

On OS X, you can use mdls to query the Spotlight database for the properties it's extracted and indexed for the file:

$ mdls -name kMDItemTitle A-Self-Referential-Story.pdf 
kMDItemTitle = "This Is the Title of This Story, Which Is Also Found Several Times in the Story Itself"
$ mdls -name kMDItemAuthors A-Self-Referential-Story.pdf 
kMDItemAuthors = (
    "David Moser"

I just recently created an app to batch rename scientific papers, very useful to rename papers to make it papers more organised in term of file name.

The app works by get title from metadata. If there's no metadata it will intelligently get the correct title from the pdf. Then other advanced option can be applied to the title such as shorten to abbreviation, add date and so on.

Demo video: http://www.youtube.com/watch?feature=player_embedded&v=R01bvA9rhiQ

Can be downloaded at App Store https://itunes.apple.com/app/pdf-paper-renamer/id591593578?mt=12

  • Do you plan to port it to windows too? – PHPst Jun 3 '13 at 8:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.