More PDF Fun – Cropping PDFs

When printing out postage labels for eBay sales, I wanted to make an A4 sized landscape print out, as opposed to the A5 sized default. I could usually switch to Windows and use my Acrobat Pro to do this, but wanted a linux way! Enter pdfcrop.

PDFCrop is a part of texlive-extra-utils, so it does drag a lot of dependencies and other stuff with it on install, but it is worth it.

sudo apt-get install texlive-extra-utils

Usage: default behaviour without any parameters is to crop away all the white space around the text or images on the pdf

pdfcrop input.pdf
outputs:
input-crop.pdf

If you want some margin around the content then for left,top,right,bottom do something like this:

pdfcrop --margins '10 10 10 10' input.pdf output.pdf

To crop into the content use negative values

pdfcrop --margins '-10 -10 -10 -10' input.pdf output.pdf

Will only crop a single pdf file, but you can script to crop multiple files

Simples.

Leave a Reply

Your email address will not be published. Required fields are marked *