render_template_to_pdf
Prepare a paid PDF render from one of the 45 starter templates. Validates your template + data 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, credit-billed). pdfzen renders are executed over HTTP, not streamed in-band over MCP; this tool is the bridge. Your data is merged ON TOP of the starter sampleData at render time, so partial payloads inherit demo defaults (e.g. ship just the customer name + total).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | Handlebars context. Each starter expects a specific shape — call get_starter to see the sampleData and dataKeys for the chosen slug. Your fields merge ON TOP of sampleData, so you can supply only the fields the user gave you and the rest fall back to the demo content. | |
| template | Yes | Slug of the starter to render (e.g. "invoice", "receipt", "certificate"). Call list_starters first if unsure which fits the user request. | |
| pageOptions | No | Page format/margin/orientation overrides. Defaults come from the starter (most are A4 portrait). Example: { "format": "Letter", "landscape": true }. |