Convert an office document to PDF
convert_to_pdfConvert Word, Excel, PowerPoint, OpenDocument, RTF, or HTML documents to PDF, preserving original layout. Returns a downloadable PDF link without storing the file.
Instructions
Converts 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); path, a file on this machine; or file_base64 with file_name. 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 |
|---|---|---|---|
| path | No | Absolute path of the document on this machine | |
| 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 |