# Crop a PDF

> Trim the margins of a PDF in the browser, from the terminal and over the API.

Source: https://tools.vukem.dev/docs/quick-start/

`pdf-crop` trims margins from the pages of a PDF. Distances are in PDF points; one point is 1/72 of an inch, so 72 points is one inch. The trimmed content is hidden, not deleted, so a crop can be undone.

You need a running server and an account. See [Installation](/docs/installation).

## In the browser

1. Open the app and sign in.
2. Open `/tools/pdf-crop`.
3. Choose a PDF, set the margins, and run the tool.
4. Download the result. It is deleted after five minutes.

## From the terminal

Create an API key with the `pdf:structure` ability (Account, then API keys), and set the two variables:

```bash
export VUKEM_TOOLS_URL="http://localhost:3000"
export VUKEM_TOOLS_API_KEY="vk_..."
vukem-tools pdf crop --input in.pdf --output out.pdf --left 36 --bottom 36 --right 36 --top 36
```

The command prints the path and the size of the file it wrote:

```text
out.pdf (48213 bytes)
```

Each margin is from 0 to 1000 points. `--pages 1-3,5` limits the crop to some pages; leave it out to crop every page. `vukem-tools pdf crop --help` lists every flag.

## Over the API

The same crop is `POST /api/v1/tools/pdf-crop`: upload the file, submit it, and download the result. [Convert a file](/docs/api/overview#make-a-request) does exactly this with `curl`.

## From an agent

Connect the [MCP server](/docs/mcp/connect) and ask in plain words. See [Prompts](/docs/prompts/overview) for wording that works.

## Next step

Try another tool: the [catalogue](/docs/concepts/catalogue) lists all 54.
