pdfcrop
TLDR
Automatically detect and remove margins from each page
SYNOPSIS
pdfcrop [options] input.pdf [output.pdf]
DESCRIPTION
pdfcrop automatically detects and removes margins from PDF pages using Ghostscript for boundary detection and pdfTeX for the actual cropping. It analyzes each page to find the bounding box of actual content and creates a new PDF with minimal whitespace.
The tool is particularly useful for preparing scanned documents, removing excess margins from journal articles, or optimizing PDFs for e-reader displays. It can process all pages automatically or apply custom bounding boxes.
PARAMETERS
--margins "l t r b"
Add margins after cropping (in bp units)--clip
Clip content to bounding box--bbox "l t r b"
Use specified bounding box for all pages--bbox-odd "l t r b"
Bounding box for odd pages--bbox-even "l t r b"
Bounding box for even pages--resolution dpi
Resolution for bounding box detection (default: 72)--restricted
Turn on restricted mode (safer for web use)--verbose
Print additional processing information--debug
Enable debug mode with more output--gscmd command
Specify Ghostscript command to use--pdftexcmd command
Specify pdftex command to use--help
Display help message--version
Display version information
CAVEATS
Requires Ghostscript and pdfTeX to be installed. Automatic detection may not work well for pages with very light content near edges. Processing time increases with resolution; use lower resolution for faster results when precision is not critical.
HISTORY
Originally developed as part of texlive by Heiko Oberdiek. Widely used in academic and publishing workflows for preparing documents. Now maintained as part of the ho-tex bundle of TeX utilities.


