About this endpoint
What it does
Converts a web page at a given URL into a PDF file. The request body lets you control page orientation, page size, margins, background printing, and optional custom header/footer HTML.
Request Body
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| url | String | Yes | URL of the web page to convert to PDF. Must be an http or https URI. |
| landscape | Boolean | No | Page orientation. true for landscape, false for portrait. Default: false. |
| page_size | String | No | Page size. Default: A4. Allowed values: A4, Letter, Legal, A3, Tabloid. |
| margin_top | String | No | Top margin with CSS units. Default: 10mm. |
| footer_html | String | No | Custom footer HTML. Supports pageNumber and totalPages spans. |
| header_html | String | No | Custom header HTML. Supports pageNumber and totalPages spans. |
| 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 PDF file is the generated PDF content.