render_html_to_pdf
Prepare a paid PDF render from arbitrary Handlebars-flavoured HTML. Use only when no starter fits (one-off layouts, custom branding). Prefer render_template_to_pdf when a starter matches. Validates your HTML and returns the exact, ready-to-execute HTTP request to run against pdfzen's render endpoint — POST /v402/render/pdf (x402, $0.006 USDC on Base, no API key) or POST /v1/render/pdf (pdfzen API key). pdfzen renders are executed over HTTP, not streamed in-band over MCP; this tool is the bridge.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| css | No | Optional CSS injected into the document head. Alternative to inline <style> in `html`. | |
| data | No | Handlebars context object resolved against the {{...}} expressions in `html`. | |
| html | Yes | The HTML body. Supports Handlebars {{ }} expressions resolved against `data`, plus pdfzen helpers ({{barChart}}, {{lineChart}}, {{pageBreak}}, {{#each}}, {{#if eq}}). Don't include <html>/<head>; just the body content + any <style> tags. | |
| pageOptions | No | Page format/margin/orientation. Defaults to A4 portrait. Example: { "format": "A4", "margin": { "top": "20mm" } }. |