# PDF crop

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

Source: https://tools.vukem.dev/docs/guide/pdf-crop/

`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

| Option | Type | Notes |
| --- | --- | --- |
| `left`, `bottom`, `right`, `top` | number | Points to trim from that edge, from 0 to 1000. |
| `pages` | string | Pages 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

| Door | How |
| --- | --- |
| Web app | Open `/tools/pdf-crop`. |
| CLI | `vukem-tools pdf crop --input in.pdf --output out.pdf --left 36 --right 36` |
| API | `POST /api/v1/tools/pdf-crop` with `{"file_id": "...", "options": {"left": 36}}`. See [Convert a file](/docs/api/overview#make-a-request). |
| MCP | `tools/call` with the name `pdf-crop`. See [`pdf-crop`](/docs/mcp/tools/pdf-crop). |

The fields of the API route are in [Trim a PDF's margins](/docs/api/tools.pdf-crop).

## If it fails

| What you see | What to do |
| --- | --- |
| The tool is not in the list | The server has no `qpdf`. Install it, or set `QPDF_PATH`, and restart the server. |
| `403` | The key lacks `pdf:structure`. |
| `unsupported_input` | The file is not a PDF. The server reads the bytes, not the extension. |

More in [Common problems](/docs/troubleshooting/common-problems).

## Next step

Cut pages instead of margins: [`pdf-extract-pages`](/docs/mcp/tools/pdf-extract-pages).
