Use addScriptTag/addStyleTag to inject JS/CSS before rendering, plus shared config (gotoOptions, waitForSelector/waitForTimeout/waitForFunction, bestAttempt) just like /screenshot and /content.
Response is binary application/pdf (Content-Disposition: attachment) - save via arrayBuffer(), or in curl use -o result.pdf with --fail-with-body so failures stop the script.
For documents too large for one request, split by pageRanges into separate requests and merge client-side with pdf-lib. Ref: https://docs.browserless.io/rest-apis/pdf
Known gotchas
Plain curl exits 0 even on a 401/500 and writes the error text into the -o file; use --fail-with-body and verify status before merging.
Chrome's printToPDF has no API for document metadata (Title/Author/Subject) - Browserless can't set it directly; post-process with pdf-lib.
Each pageRanges chunk is a separate request that reloads the page, so time-dependent/personalized/lazy-loaded content can differ between chunks unless cookies and wait options are identical.
A pageRanges value starting past the last page returns an HTTP 500 with a plain-text error body instead of a PDF.
No built-in single-continuous-page (non-paginated) PDF mode on /pdf - build it via the /function endpoint's page.pdf() with a computed height.
Give your agent this knowledge — and 16,400+ more routes
One MCP install gives any agent live access to the full route map across 5,800+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?