Convert a file (by URL) to PDF
convert_fileConvert documents, images, HTML, or Markdown from a public URL into a PDF. Automatically detects format and applies the appropriate conversion engine.
Instructions
Convert a file fetched from a public URL into a PDF. Auto-detects the engine from the extension: Office docs (DOCX, XLSX, PPTX, ODT, RTF, TXT, CSV…), images (PNG, JPG, WebP…), HTML, Markdown, or an existing PDF (passthrough). Costs 1 credit on success. Returns the PDF as an embedded resource.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Public http(s) URL of the file to download and convert. | |
| landscape | No | Render in landscape orientation. (Pro/Scale/trial only.) | |
| nativePageRanges | No | Page ranges to include, e.g. "1-3". | |
| password | No | Password to open a protected source document. | |
| pdfa | No | PDF/A conformance level, e.g. "PDF/A-2b". (Pro/Scale/trial only.) | |
| pdfua | No | Produce an accessible PDF/UA document. | |
| userPassword | No | Password required to open the resulting PDF. | |
| ownerPassword | No | Owner password controlling permissions on the resulting PDF. | |
| save_path | No | Optional absolute path to also write the PDF to on disk. |