About this endpoint
What it does
Converts an HTML document into a PDF file and returns the generated PDF as binary data. You can provide the HTML either inline as text or as an uploaded file, and optionally include referenced asset files and PDF layout options.
Request Body
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| file | String | No | The HTML document as a file, instead of html. |
| html | String | No | The HTML document. Example: <h1>Hello, world!</h1>. |
| pdfa | ENUM | No | Archival format. Allowed values: PDF/A-1b, PDF/A-2b, PDF/A-3b. |
| paper | ENUM | No | Page size. Allowed values: A3, A4 (default), A5, A6, Letter, Legal, Tabloid. |
| assets | String Array | No | Up to 20 files the HTML references by name, e.g. logo.png or style.css. |
| landscape | Boolean | No | Landscape pages. Default: false. |
| margin_top | Number | No | Top margin in inches. Range: 0-4. Default: 0.39. |
| wait_delay | Integer | No | Seconds to wait after the page loads, for JavaScript-heavy pages. Range: 0-10. |
| footer_html | String | No | HTML repeated at the bottom of every page; same placeholders as header_html. |
| header_html | String | No | HTML repeated at the top of every page. <span class="pageNumber"></span> and <span class="totalPages"></span> are filled in. |
| margin_left | Number | No | Left margin in inches. Range: 0-4. Default: 0.39. |
| margin_right | Number | No | Right margin in inches. Range: 0-4. Default: 0.39. |
| margin_bottom | Number | No | Bottom margin in inches. Range: 0-4. Default: 0.39. |
| print_background | Boolean | No | Print background colours and images. Default: true. |
Response
Returns a binary PDF file as the success response body.



