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
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"html": "<html>"
},
"name": "html_to_pdf"
}
}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 |