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 | Description |
|---|---|---|
| url | String | URL of the web page to convert to PDF. Must be an http or https URI. |
| landscape | Boolean | Page orientation. true for landscape, false for portrait. Default: false. |
| page_size | String | Page size. Default: A4. Allowed values: A4, Letter, Legal, A3, Tabloid. |
| margin_top | String | Top margin with CSS units. Default: 10mm. |
| footer_html | String | Custom footer HTML. Supports pageNumber and totalPages spans. |
| header_html | String | Custom header HTML. Supports pageNumber and totalPages spans. |
| margin_left | String | Left margin with CSS units. Default: 10mm. |
| margin_right | String | Right margin with CSS units. Default: 10mm. |
| margin_bottom | String | Bottom margin with CSS units. Default: 10mm. |
| print_background | Boolean | Print background graphics. Default: true. |
Response
Returns a binary PDF file, which is the generated PDF content.



