HTML to PDF
html_to_pdfTurn an HTML document into a print-ready PDF with page size, margins, orientation and page-numbered header and footer. Cost: 3 credits per call. Output: a file (application/pdf) returned inline, at most 1 MiB. The PDF document
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| html | Yes | The HTML document or fragment (UTF-8, up to 2 MB). JavaScript is not executed. | |
| scale | No | Rendering scale | |
| format | No | Paper size | A4 |
| landscape | No | ||
| margin_mm | No | Page margin on all sides, millimetres | |
| footer_text | No | Plain-text page footer; {page} and {pages} are replaced | |
| header_text | No | Plain-text page header; {page} and {pages} are replaced | |
| print_background | No | Print CSS backgrounds and colours |