This script is from UNIX Tips for Mac OS X---How do I split a PDF file into several from command-line?. It utility utilize Apple CoreGraphics python module, please use /usr/bin/python
instead of /usr/local/bin/python
if you are using homebrew
or you will get a No module named CoreGraphics
error. For more info about CoreGraphics
, please refer here.
Here is the usage:
/usr/bin/python splitPDF.py <the-number-of-page-you-want-to-extract>