Send a PDF and a rectangle or margins, as you see the page; get back the same PDF with its visible area (CropBox) set accordingly. The hidden content is not removed — it can still be recovered from the file. For actually removing content, see our roadmap for a dedicated redaction tool.
See the Crop PDF tool page, or the docs index for authentication, the shared request/webhook contract, and the generic error table.
POST /webhooks/trigger — same endpoint and fields as every tool, with tool="crop-pdf" set explicitly (it's not the default).
curl -X POST https://api.anyconvert.app/webhooks/trigger \ -H "x-api-key: your_api_key_here" \ -F "file=@drawing.pdf" \ -F "fileId=document-001" \ -F "referenceId=reference-001" \ -F "tool=crop-pdf"
An optional options multipart field carrying a JSON object, validated synchronously before a credit is charged — a bad value is rejected with 400, not charged and not queued.
| box | object, one of box/margins | { x, y, width, height } in displayed points (top-left origin). Must be at least 10×10pt and lie inside the page. |
| margins | object, one of box/margins | { top, right, bottom, left } — removed from each displayed edge. |
| unit | string, optional | "pt" (default), "mm", or "in". |
| pages | string, optional | Default "all"; the page-selection grammar. |
The success delivery carries a warning noting that cropped content is hidden, not removed.
Billed per page, not per document — 1 credit for every 20 pages, rounded up.
Delivered via the webhook as outcome=failure with a reason below — see the docs index for the full delivery shape.
| invalid_options | The box lies outside the page, is smaller than 10×10pt, or a page is outside the document. |
| invalid_file | The file could not be read, or was not the format this tool expects. |
| render_failed | Something failed during conversion that wasn’t a problem with the input itself. |
| timeout | The job did not finish within its time budget. |
| internal_error | An unexpected error on our side. |