HTML to PDF Document Generator API - A4/Letter
html_to_pdf_apiConvert HTML documents, invoices, certificates, and reports with inline CSS and base64 data-URI images into printable A4 or Letter PDFs. SSRF-safe offline rendering strips external scripts and remote links automatically. Deterministic output with page count and SHA-256 digest, nothing stored. Free: 5 calls/day per IP. Paid: Radar API key (from €15/mo at https://radarbg.com/pricing#starter via X-API-Key) or $0.01/call via x402 at https://radarbg.com/x402/html-to-pdf-api.
Example tool call
This call uses example arguments supplied in the tool’s input schema.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"html": "<h1>Statement of Account</h1><p>Account: <b>DE89-3704-0044</b></p><table><tr><th>Date</th><th>Description</th><th>Amount</th></tr><tr><td>2026-12-01</td><td>Platform Subscription</td><td>149.00 EUR</td></tr></table>",
"fileName": "statement.pdf",
"marginMm": 15,
"pageSize": "A4"
},
"name": "html_to_pdf_api"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| html | No | Raw HTML markup string (provide either html or fileBase64, max 5 MB). | |
| fileName | No | Optional output file name (e.g. invoice-104.pdf). | |
| marginMm | No | Page margin in millimeters (5-40). | |
| pageSize | No | PDF page size: A4 or Letter. | A4 |
| fileBase64 | No | Base64-encoded .html file (alternative to html). |