Splicing a big pile of PDFs on a Mac

  • Sat 07 February 2015
  • misc

I recently downloaded a pretty spiffy free ebook ( http://www.cadhistory.net if that's of interest to you ) but it came in the form of a couple of dozen PDF files. I want them as a single file in iBooks on my iPad. What to do?

Of course, I've been slicing and dicing PDF files for years on the Mac - and over the past 7 years give or take I've had accounting departments who were enlightened enough to want scans of all my receipts rather than the physical paper. The IRS has allowed it since 1997, so... about 10 years behind the times? Sounds right for accounting. Years ago I had to pony up for Acrobat to do this, then various shareware programs, and since Snow Leopard this functionality has been built into Preview.

Using Preview to concatenate two dozen files seems cumbersome. This calls for a command line utility. Turns out, such a thing ships with the Mac, and it's yours for the price of a symlink deep into a library item. Shades of the Airport command line utility

TL;DR version for Terminal.app-using higher primates:

{% raw %} sudo ln -s "/System/Library/Automator/Combine PDF Pages.action/Contents/Resources/join.py" /usr/local/bin/PDFconcat PDFconcat -o outfile.pdf file1.pdf file2.pdf file3.pdf etc

Note that the "sudo" line is all one big line that the CMS helpfully wraps for you. Cut and paste it, and it will work fine.

Apparently this has been a thing for a while. The blog post I found which goes into it in some greater detail is from 2010.