Render HTML to an image or PDF
render_htmlConvert HTML into JPEG, PNG, WebP, or PDF documents like invoices, reports, and certificates; returns a file link and inline image when small.
Instructions
Renders an HTML document you provide as a JPEG, PNG or WebP image, or as a PDF: an invoice, a report, a certificate. Returns a link to the file, and the image itself when it is small enough. Images, fonts and stylesheets referenced by the HTML must use absolute URLs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| html | Yes | The HTML document to render, up to 2 MB. | |
| width | No | Viewport width in pixels, 200 to 3840. Values outside the range are clamped. Default 1280. | |
| format | No | Output type. `jpeg` (default), `png`, `webp`, or `pdf` for a paged document. | jpeg |
| height | No | Viewport height in pixels, 150 to 4320. Values outside the range are clamped. Default 1024. | |
| quality | No | JPEG quality from 1 to 100. Sent as 80 when omitted, which keeps most captures small enough to be returned inline. Ignored for other formats. |