PDFCropper is a simple command-line utility (coded in Python) that crops the margins around PDFs for the purpose of printing as efficiently as possible. It relies almost entirely on the venerable PyPDF2 module.
The script accepts a single argument (the filename of the PDF file to be cropped) and a single option --format
.
The values passed to --format
determine margin dimensions typical to that publisher:
Alternatively, you can define custom margins in inches by supplying arguments to the following options:
--top
--right
--bottom
--left
python pdfcropper.py ~/doc.pdf --format packtpub --top 1.25