About this endpoint
What it does
Converts raw HTML into a PDF document. You send HTML plus optional page and margin settings, and the endpoint returns the generated PDF as a binary response.
Request Body
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| html | String | Yes | Raw HTML content to convert to PDF. Max 5,000,000 characters. |
| landscape | Boolean | No | Page orientation: true for landscape, false for portrait. Default: false. |
| page_size | String | No | Page size. Allowed values: A4, Letter, Legal, A3, Tabloid. Default: A4. |
| margin_top | String | No | Top margin with CSS units. Default: 10mm. |
| margin_left | String | No | Left margin with CSS units. Default: 10mm. |
| margin_right | String | No | Right margin with CSS units. Default: 10mm. |
| margin_bottom | String | No | Bottom margin with CSS units. Default: 10mm. |
| print_background | Boolean | No | Print background graphics. Default: true. |
Response
Returns a binary file response containing the generated PDF.