Compress a PDF
compress_pdfMakes a PDF smaller and returns the render with download_url; a PDF that cannot be made smaller comes back as it was. For a preview picture of a page instead, use pdf_to_image. Pass exactly one PDF: source, a render or library file of the workspace, or file_base64, the PDF itself. Starter plan and above; 0.5 units on a live key. A PDF/A or a password-protected PDF is refused.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "compress_pdf"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | No | A PDF of the workspace: the rnd_ id of a PDF render, or a PDF of the file library by name (such as terms.pdf) or fil_ id | |
| filename | No | Name of the file behind download_url; the source's name when left out | |
| file_name | No | Name of the PDF given as file_base64 or path, e.g. contract.pdf; the results are named after it | |
| file_base64 | No | The PDF itself, base64 encoded, up to 20 MB; sent with the request and not kept |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | rnd_ id of the render | |
| form | No | What fill_pdf_form did: the fields filled, those left out (unknown name or invalid value) and those whose calculation or display format no viewer ran | |
| pdfa | No | The PDF/A verdict (PDF/A-2b or PDF/A-3b), when the template declares it | |
| error | Yes | Why a failed render failed | |
| units | Yes | Units the render counted | |
| output | No | The format of the file: pdf, png, jpg, webp, docx or pptx, or zip for the several files of split_pdf and pdf_to_image | |
| status | Yes | ||
| einvoice | No | The e-invoice report, when the render made one | |
| template | Yes | The template and version rendered; null for html and conversions | |
| expires_at | Yes | When download_url stops working; get_render issues a fresh one | |
| page_count | Yes | ||
| environment | Yes | ||
| download_url | Yes | Signed link to the file; null until the render succeeded | |
| accessibility | No | The PDF/UA-1 verdict, when the template declares it |