How to crop PDF using PDFCrop

PDFCrop is a simple Perl script that can be used to crop every page of a PDF file down to its minimal size. That is, it removes all the margins so that the page is reduced to the bounding box of the content. This tool is most commonly used to crop the PDF figures exported from other tools, so that they can be inserted in LaTeX documents.

PDFCrop ships along with the texlive-extra-utils package, so you may need to install it:

$ sudo apt-get install texlive-extra-utils

Using the tool is easy:

$ pdfcrop in.pdf out.pdf

I got this error when I ran it under the fish shell:

Failed to execute process '/usr/bin/pdfcrop'. Reason:
exec: Exec format error
The file '/usr/bin/pdfcrop' is marked as an executable but could not be run by the operating system.

It turns out that PDFCrop script file uses 3 lines of bash at the top. So, you will need to run under bash or a bash compatible shell.

Tried with: PDFCrop 1.2 and Ubuntu 12.04

Advertisements

One thought on “How to crop PDF using PDFCrop

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 )

Google photo

You are commenting using your Google 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

This site uses Akismet to reduce spam. Learn how your comment data is processed.