Skip to main content
POST
PDF

Overview

Renders the session’s active page as a PDF via Chrome’s Page.printToPDF and returns the binary PDF in the response body. Response Content-Type is application/pdf.

Path Parameters

string
required
Browser session ID (UUID).

Body

string
Optional URL to navigate to before rendering. If omitted, the current page is printed.
string
Paper format. One of Letter, Legal, Tabloid, Ledger, A0, A1, A2, A3, A4, A5, A6. When set, overrides paperWidth / paperHeight.
boolean
default:"false"
Paper orientation.
boolean
default:"false"
Include background colors and images.
number
default:"1"
Render scale. 1 = 100%.
number
default:"8.5"
Paper width in inches. Ignored when format is set.
number
default:"11"
Paper height in inches. Ignored when format is set.
object
Page margins in inches.
string
One-based page ranges, e.g. 1-5, 8, 11-13.
Display the header and footer templates.
string
HTML template for the header. Supports CSS classes date, title, url, pageNumber, totalPages.
HTML template for the footer. Same substitutions as headerTemplate.
boolean
default:"false"
When true, prefer page size defined by @page CSS rules.

Example Request

Response

Success Response (200)

Binary PDF. Response headers:
  • Content-Type: application/pdf
Pipe to a file with -o output.pdf in cURL, or read response.body as bytes.

Error Responses