GET
/api/v1/screenshotPDF Options
Render any URL or HTML as a PDF with full control over paper size, orientation, margins, and print-media CSS.
Set format=pdf to render as a PDF document. All standard parameters (viewport, wait, custom CSS, etc.) still apply.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
format | string | required | Must be pdf. |
pdf_paper_format | string | optional | Paper size: A0, A1, A2, A3, A4 (default), A5, A6, Letter, Legal, Tabloid. |
pdf_landscape | boolean | optional | Landscape orientation. Default: false. |
pdf_print_background | boolean | optional | Print background graphics and colors. Default: true. |
pdf_fit_one_page | boolean | optional | Scale content to fit on a single page. Default: false. |
pdf_margin | string | optional | Shorthand for all four margins (CSS units, e.g. 1cm). Overridden by individual margin params. |
pdf_margin_top | string | optional | Top margin (CSS units). Max 50 chars. |
pdf_margin_right | string | optional | Right margin. |
pdf_margin_bottom | string | optional | Bottom margin. |
pdf_margin_left | string | optional | Left margin. |
Code Examples
# A4 PDF with print styles and 1cm margins
curl "https://screenshotcore.com/api/v1/screenshot?access_key=KEY&url=https://example.com&format=pdf&pdf_paper_format=A4&media_type=print&pdf_margin=1cm" \
--output page.pdf
# Letter landscape, fit to one page
curl "https://screenshotcore.com/api/v1/screenshot?access_key=KEY&url=https://example.com&format=pdf&pdf_paper_format=Letter&pdf_landscape=true&pdf_fit_one_page=true" \
--output wide.pdfResponse
(Raw PDF bytes, Content-Type: application/pdf)