Aggregating PDFs with a One-Line Bash Script

This year, like dozens of Canadian researchers, I’m serving on a SSHRC Insight Development Grant selection committee. While SSHRC has a decent back end (I think I’m one of the only people who kinda likes SharePoint now), they do tend to provide the documents that need to be reviewed in a bunch of seperate documents, i.e.:

  • App_Milligan_Ian.pdf
  • Attach_Milligan_Ian_Description.pdf
  • Attach_Milligan_Ian_References.pdf
  • Attach_Milligan_Ian_Timelines.pdf
  • CCV_App_Milligan_Ian.pdf

Scale this up by the 11 or 12 proposals that you need to read, and suddenly, you’re working with 60 individual PDFs rather than just 12 nicely-packaged PDFs. As somebody who tends to move PDFs to my iPad to annotate there, this is a bit annoying.

This isn’t just a SSHRC problem, of course. Until a few years ago, when reviewing graduate admissions, we would get four or five PDFs per applicant.

Bash to the rescue. This MacOS command will turn all of the above into a nice PDF for review:

"/System/Library/Automator/Combine PDF Pages.action/Contents/Resources/join.py" -o Milligan.pdf *Milligan*

This saved me a lot of headache, so maybe if it saves just one of you some headache, posting it here will be worth it too.

Avatar
Ian Milligan

Associate Vice-President, Research Oversight and Analysis

Professor of History

Exploring how technology is transforming historical research.