HTML to PDF
html_to_pdfRender a URL or a raw HTML string to a PDF in headless Chromium (print-quality, selectable text). Options: paper format (A4, Letter, Legal, A3, A5, Tabloid), landscape, print backgrounds, margins, and scale. Returns a short-lived download URL (valid 1 hour) with byte size, page count and SHA-256; set includeBase64 for the PDF inline (up to 3 MB). Raw HTML up to 2 MB; any external resources it loads go through the same private-address block. Pure rendering, no AI.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "html_to_pdf"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | Page to render (provide url OR html) | |
| html | No | Raw HTML document to render instead of a URL (max 2 MB) | |
| scale | No | Render scale, 0.1-2 (default 1) | |
| format | No | Paper size (default A4) | |
| margin | No | CSS margin applied to all sides, e.g. '1cm', '0.5in', '10mm' (default '1cm') | |
| landscape | No | Landscape orientation (default false) | |
| waitUntil | No | When loading counts as finished (default load) | |
| includeBase64 | No | Also return the PDF as base64 in the response (default false; omitted if over 3 MB) | |
| printBackground | No | Include CSS backgrounds and colors (default true) |