PDF
Tools
Render the active page as a PDF and return the binary bytes.
POST
PDF
Overview
Renders the session’s active page as a PDF via Chrome’sPage.printToPDF and returns the binary PDF in the response body. Response Content-Type is application/pdf.
Path Parameters
Browser session ID (UUID).
Body
Optional URL to navigate to before rendering. If omitted, the current page is printed.
Paper format. One of
Letter, Legal, Tabloid, Ledger, A0, A1, A2, A3, A4, A5, A6. When set, overrides paperWidth / paperHeight.Paper orientation.
Include background colors and images.
Render scale.
1 = 100%.Paper width in inches. Ignored when
format is set.Paper height in inches. Ignored when
format is set.Page margins in inches.
One-based page ranges, e.g.
1-5, 8, 11-13.Display the header and footer templates.
HTML template for the header. Supports CSS classes
date, title, url, pageNumber, totalPages.HTML template for the footer. Same substitutions as
headerTemplate.When true, prefer page size defined by
@page CSS rules.Example Request
Response
Success Response (200)
Binary PDF. Response headers:Content-Type: application/pdf
-o output.pdf in cURL, or read response.body as bytes.
Error Responses
| Status | Description |
|---|---|
400 | Invalid body — unknown format, bad margin, or scale out of range. |
401 | Unauthorized — invalid or missing API key. |
404 | Session not found or not owned by the caller. |
503 | The browser session is temporarily unreachable. |