Skip to content

Guides

PDF crop

The options of pdf-crop and how to run it from the web, the CLI, the API and MCP.

Last updated:

pdf-crop sets the crop box of a PDF, which is what a reader displays and prints. The trimmed content is hidden rather than deleted, so a crop can be undone, and nothing else about the document changes. It runs in the qpdf engine.

The options#

OptionTypeNotes
left, bottom, right, topnumberPoints to trim from that edge, from 0 to 1000.
pagesstringPages to crop, as 1-3,5. Empty crops every page. Up to 512 characters.

A point is 1/72 of an inch. The tool needs the ability pdf:structure.

One tool, four ways#

DoorHow
Web appOpen /tools/pdf-crop.
CLIvukem-tools pdf crop --input in.pdf --output out.pdf --left 36 --right 36
APIPOST /api/v1/tools/pdf-crop with {"file_id": "...", "options": {"left": 36}}. See Convert a file.
MCPtools/call with the name pdf-crop. See pdf-crop.

The fields of the API route are in Trim a PDF's margins.

If it fails#

What you seeWhat to do
The tool is not in the listThe server has no qpdf. Install it, or set QPDF_PATH, and restart the server.
403The key lacks pdf:structure.
unsupported_inputThe file is not a PDF. The server reads the bytes, not the extension.

More in Common problems.

Next step#

Cut pages instead of margins: pdf-extract-pages.