Render a PDF
render_pdfConvert HTML or a public URL into a PDF, with signed receipt and quota details returned. Choose either HTML or URL as input and optionally save the file locally.
Instructions
Turn HTML or a public URL into a PDF with pagenull. Send exactly one of html or url. Returns the PDF (base64, or written to save_to), its signed receipt, warnings and quota. Nothing is stored by pagenull.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | A public http(s) URL to load. Private and internal addresses are refused. | |
| html | No | The HTML document to render (up to 5 MB). | |
| test | No | Test render: watermarked, free, not counted against the quota. | |
| format | No | Paper size. Default A4. | |
| margin | No | ||
| options | No | Any other option from https://pagenull.dev/docs/api (e.g. waitFor, timeoutMs, scale, headerHtml). Checked by the API. | |
| save_to | No | Write the file to this path on this machine instead of returning it as base64. The folder must exist. Use it for large files. | |
| filename | No | File name for the Content-Disposition header. | |
| landscape | No | ||
| overwrite | No | Replace the file at save_to if it already exists. Default false. | |
| pageNumbers | No | true for "Page {page} of {pages}", or your own text with {page} and {pages}. | |
| printBackground | No | Print background colours and images. Default true. |