Today I needed to combine a PDF file for a coverpage (produced from Word) with another PDF representing the body of the document (produced from LaTeX) into a single document. Turns out OS X already has a script that does this hidden deep inside Automator. The path is very long, so I'll break it up to lead you to the file:

cd /System/Library/Automator/Combine\\ PDF\\ Pages.action
cd Contents/Resources
ls -l join.py

If you look at the Python script, you'll see some usage information at the top.

I created a link to the script in by bin directory to make using it more convenient, then just used the command:

~/bin/joinPDF.py -o 2006prop.pdf 2006cover.pdf 2006desc.pdf 

That's it. The resulting PDF is perfect. I found this recipe at Benjamin Han's site.


Please leave comments using the Hypothes.is sidebar.

Last modified: Thu Oct 10 12:47:18 2019.