Skip to main content

Generating PDFs

info

Currently, Browserless V2 is available in production via two domains: production-sfo.browserless.io and production-lon.browserless.io

The pdf mutation allows for simple navigation to a site and capturing a PDF. Browserless will respond with a Content-Type of application/pdf and a Buffer of the PDF file. Similar to screenshots, this REST API also exposes puppeteer's pdf options via an options property in the JSON body for granular control.

On this collection we’ll look at:

Basic Usage

mutation PDF {
goto(url: "https://example.com") {
status
}

pdf(displayHeaderFooter: true, printBackground: false, format: a0) {
base64
}
}
BQL Schemas

For more details on BQL mutations, refer to the BrowserQL Schema reference pages.

Rest API

Generating PDFs can also be done with Browserless Rest API. For endpoint details, parameters, and code samples, see the Browserless REST API.