---
title: "Get Page PDF"
method: POST
path: "/v1/tools/page-pdf"
tags: ["Tools"]
---

# Get Page PDF

`POST /v1/tools/page-pdf`

Generates a PDF of the current page for a browser session and returns it as a binary PDF file.

## Query parameters

- `sessionId` string, uuid

## Request body

- object
  - `url` string, uri, required — The URL of the page to print to PDF.
  - `landscape` boolean — Paper orientation. Defaults to false.
  - `displayHeaderFooter` boolean — 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.
  - `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.
  - `marginBottom` number — Bottom margin in inches. Defaults to ~0.4.
  - `marginLeft` number — Left margin in inches. Defaults to ~0.4.
  - `marginRight` number — Right margin in inches. Defaults to ~0.4.
  - `pageRanges` string — Page ranges to print, e.g. '1-5, 8, 11-13'. Defaults to all pages.
  - `headerTemplate` string — HTML template for the print header.
  - `footerTemplate` string — HTML template for the print footer.
  - `preferCSSPageSize` boolean — Prefer page size as defined by CSS. Defaults to false.

## Response `200`

PDF generated successfully

## Other responses

- `400` — Invalid parameters
- `404` — Session not found
- `500` — Failed to generate PDF

## Changes

- **2026-03-20** `c1198ecebd31` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/anchorbrowser/apis/anchorbrowser-api/changes/v1/tools/page-pdf/post.md)

---

[API](https://skmtc.dev/anchorbrowser/apis/anchorbrowser-api.md) · [All operations](https://skmtc.dev/anchorbrowser/apis/anchorbrowser-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/anchorbrowser/anchorbrowser-api/revisions/d0f5aa64f9f4/schema)
