Combine PDFs with Python on Mac


I was looking for a way to combine PDFs (without using Acrobat) and came across this note.

$ python '/System/Library/Automator/Combine PDF Pages.action/Contents/Resources/join.py' -o '/path/to/output.pdf' '/path/to/input1.pdf' '/path/to/input2.pdf'

This command will generate the PDF and it will echo the following warning (date and name of your computer will vary, of course) which apparently you can safely ignore.

Sun Jun 21 14:58:34 sj.local Python [16000] : The function `CGPDFDocumentGetMediaBox' is obsolete and will be removed in an upcoming update. Unfortunately, this application, or a library it uses, is using this obsolete function, and is thereby contributing to an overall degradation of system performance. Please use `CGPDFPageGetBoxRect' instead.

Better yet, use the Mac Automator. You can use the Automator to combine multiple image files, or PDFs into a single PDF. You can then use the Previewer to re-arrange the pages and delete some of the pages if needed.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.