Convert an office document to PDF
convert_to_pdfConvert Office documents (Word, Excel, PowerPoint, OpenDocument, RTF, HTML) up to 20 MB to PDF and get a download URL. Provide a render_id, file path, or base64 data with file name.
Instructions
Converts a Word, Excel, PowerPoint, OpenDocument, RTF or HTML document (up to 20 MB) to a PDF and returns a download URL (Starter plan and above; units follow the PDF rule). 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. The document is converted and not kept.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Absolute path of a document on this machine | |
| filename | No | Name of the 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 | |
| file_base64 | No | The document, base64 encoded | |
| page_ranges | No | Pages to convert, e.g. 1-3,5 | |
| single_page_sheets | No | Each spreadsheet sheet on one page |