Skip to main content
POST
/
v1
/
tools
/
page-pdf
Get Page PDF
curl --request POST \
  --url https://api.anchorbrowser.io/v1/tools/page-pdf \
  --header 'Content-Type: application/json' \
  --header 'anchor-api-key: <api-key>' \
  --data '
{
  "url": "<string>"
}
'
"<string>"

Authorizations

anchor-api-key
string
header
required

API key passed in the header

Query Parameters

sessionId
string<uuid>

Optional browser session ID. If omitted, url in the request body is required.

Body

application/json
url
string<uri>
required

The URL of the page to print to PDF.

landscape
boolean

Paper orientation. Defaults to false.

Display header and footer. Defaults to false.

printBackground
boolean

Print background graphics. Defaults to false.

scale
number

Scale of the webpage rendering. Defaults to 1.

Required range: 0.1 <= x <= 2
paperWidth
number

Paper width in inches. Defaults to 8.5.

paperHeight
number

Paper height in inches. Defaults to 11.

marginTop
number

Top margin in inches. Defaults to ~0.4.

Required range: x >= 0
marginBottom
number

Bottom margin in inches. Defaults to ~0.4.

Required range: x >= 0
marginLeft
number

Left margin in inches. Defaults to ~0.4.

Required range: x >= 0
marginRight
number

Right margin in inches. Defaults to ~0.4.

Required range: x >= 0
pageRanges
string

Page ranges to print, e.g. '1-5, 8, 11-13'. Defaults to all pages.

Pattern: ^\d+(-\d+)?(,\s*\d+(-\d+)?)*$
headerTemplate
string

HTML template for the print header.

HTML template for the print footer.

preferCSSPageSize
boolean

Prefer page size as defined by CSS. Defaults to false.

Response

PDF generated successfully

The response is of type file.