17

How can I easily crop a PDF page in a given PDF file? I prefer using as little coding as possible, and guess border geometries as little as possible...

Sparkler
  • 2,103
  • 1
  • 20
  • 36

4 Answers4

32

There are several options:

  1. Crop by point-and-click using a GUI front-end:
  2. Crop by using the command line:
    • pdfcrop command (provided by texlive-extra-utils), using the following arguments: pdfcrop --margins '-30 -30 -250 -150' --clip input.pdf output.pdf (-left -top -right -bottom format).
    • PDFCrop
    • convert -crop command (provided by imagemagick)
    • Ghostscript
  3. Crop by writing your own script:
Community
  • 1
  • 1
Sparkler
  • 2,103
  • 1
  • 20
  • 36
  • 1
    As a note to the GUI tools: _pdf-quench_ and _krop_ need Python and are aimed for Linux, _briss_ and _PDF scissors_ need Java. – Willem Oct 13 '19 at 10:24
  • The margin unit for pdfcrop is bp which is close (but not equal) to point. Some details [here](https://tex.stackexchange.com/questions/8260/what-are-the-various-units-ex-em-in-pt-bp-dd-pc-expressed-in-mm) for conversion. – Lalylulelo Feb 19 '20 at 14:28
  • 2
    pdfcrop is almost magic. It did exactly what I wanted. – Thales Carl Jul 12 '20 at 19:15
  • 2
    pdfcrop (from texlive-extra-utils) is the winner! – Vagner do Carmo Apr 05 '21 at 18:38
2

For quick, GUI-aided PDF cropping tasks, try pdfarranger (available in Debian repos, formerly known as PDF-Shuffler).

Digger
  • 176
  • 2
  • 10
1

For precise point-and-click cropping, one option is to use LibreOffice Draw.

The instructions below assume you want to crop part of a single-page PDF:

  • Start with a blank document
  • Select the Insert > Image... menu
  • Navigate to the PDF you wish to crop
    • The contents of the PDF will show up as an image
  • Right-click on the PDF content in your document and select the "Crop" menu item.
  • Use the handles to resize the viewable area of the PDF to the section you want to remain after cropping
  • Click outside of the PDF to disable the crop handles
  • Click again on the PDF content to position it however you want by:
    • Dragging it around the page
    • Using the arrow keys to move it
    • Use the Draw positioning tools to align or center the PDF content.

When you're happy with the result, save, export it to PDF, or print it.

For multi-page PDFs, You'll have to work page by page by first splitting the PDF into multiple pages using some other tool like PDF Arranger (or simply "Printing to PDF" each page of the PDF you want to crop in your PDF viewer), cropping them one by one with Draw, then recombining them into a single PDF (using PDF Arranger again).

LeoRochael
  • 12,383
  • 5
  • 26
  • 37
0

You could try using the pdfCropMargins Python program (https://pypi.org/project/pdfCropMargins/) with the -pg option to select the particular page. The command-line program offers many options, and also has an optional GUI.

alb
  • 1
  • 2