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.
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 | |
| error | Yes | Why a failed render failed | |
| units | Yes | Units the render counted | |
| 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 |