Convert an office document to PDF
convert_to_pdfConverts an existing Word, Excel, PowerPoint, OpenDocument, RTF or HTML document (up to 20 MB) to a PDF as it is, without filling in data, and returns the render with status and download_url. To make a document from a template and data, use render instead. Pass exactly one source: render_id, the render of a Word or PowerPoint template (output docx or pptx); or file_base64 with file_name, the document itself. Every call is a new render that counts units like a PDF; the Free plan cannot convert (Starter and above). The document is converted and not kept.
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": "convert_to_pdf"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | No | Name of the PDF behind download_url, e.g. report.pdf | |
| file_name | No | Name of the document, e.g. report.xlsx; the type is read from the content | |
| landscape | No | Landscape for spreadsheets and documents without their own page setup | |
| render_id | No | rnd_ id of a render whose output is docx or pptx, to get that document as a PDF | |
| file_base64 | No | The document to convert, base64 encoded; needs file_name | |
| page_ranges | No | Pages to convert, e.g. 1-3,5; all pages when left out | |
| single_page_sheets | No | Each spreadsheet sheet on one page |
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 |