About this endpoint
What it does
Converts raw HTML into a PDF document. You send the HTML and optional page setup options in the request body, and the endpoint returns the generated PDF as binary content.
Request Body
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| html | String | Yes | Raw HTML content to convert to PDF. Maximum 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 response containing the generated PDF document. The output schema is a single String with binary format, so the success payload is the PDF file itself rather than a JSON object.