Go to TogaWare.com Home Page. GNU/Linux Desktop Survival Guide
by Graham Williams
Duck Duck Go

Cropping a PDF

20180528 There are times and circumstances where it is useful to crop a pdf document. For example, when producing the pdf for my book titled The Essentials of Data Science I placed crop marks in each of the four corners. From this original version I wanted to extract just the printable page. Through experimentation I found that introducing a margin of $-50$ did the trick.

  $ pdfcrop --margins -50 input.pdf output.pdf
  $ evince output.pdf

The original and result can be seen in Figure 66.1. The original is at the top of the figure and the cropped version, using pdfcrop with –margins 50, is at the bottom. When printing, the image will generally be expanded to fit the page, though that is often a setting within the application controlling the printing.

Figure 66.1: The effect of cropping the margins of a pdf document.
Image pdfcrop-essentials

Copyright © 1995-2020 Togaware Pty Ltd
Support further development through the purchase of the PDF version of the book.
Graham Williams is the developer of open source software including rattle and wajig.
He is the author of Data Mining with Rattle and Essentials of Data Science.
This web site is hosted by Togaware, free and open source software since 1984.