HTML to PDF (wkhtmltopdf)
api2pdf_wkhtml_to_pdfRender an HTML string to a PDF using the wkhtmltopdf engine — an alternate to Chrome that supports a table of contents (pass enableToc / tocOptions inside options). Returns a { FileUrl } (valid ~24h). BILLED. Api2Pdf API: POST /wkhtml/pdf/html.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| html | Yes | The HTML source to render into a PDF. | |
| inline | No | If true (Api2Pdf default), the generated file is served inline; if false, as an attachment. | |
| options | No | Engine-specific render options (page size, margins, orientation, headers/footers, etc.). Passed through verbatim to Api2Pdf. | |
| storage | No | Custom storage target, used when useCustomStorage is true. | |
| fileName | No | A name for the generated file, e.g. 'invoice.pdf'. | |
| output_binary | No | If true, return the raw file bytes as base64 instead of a FileUrl. Default false (recommended for agents — returns a short-lived link). | |
| extraHTTPHeaders | No | Extra HTTP headers Api2Pdf forwards when it fetches a source URL (e.g. auth for a protected page/file). | |
| useCustomStorage | No | If true, Api2Pdf uploads the result to your own storage (see `storage`) instead of hosting it. |