PDFPi is a lightweight API that renders any public URL inside a headless Chromium browser and returns a pixel-perfect PDF — no browser plugins required.
Everything you need
A focused set of features built for automation, browser extensions, and server-side document generation.
Pass any URL as a query parameter and receive a link to a high-fidelity PDF rendered by Chromium — including backgrounds, fonts, and layout.
Control paper size (A3–Legal), orientation, scale, margins, and whether to include CSS backgrounds or print headers & footers.
Single Node.js process on port 7301. Run bare-metal, inside Docker, or behind an Nginx reverse proxy in minutes.
Live Demo
Enter a public URL below, choose your options, and hit Generate PDF to see the API in action.
API Endpoints
All routes are served on the same port (default 7301).
Quick Start
Up and running in under five minutes.
Docker
Query-Parameter Reference
All parameters for GET /pdf/generate.
| Parameter | Type | Default | Description |
|---|---|---|---|
url required |
string | — | Full URL of the page to convert. |
id required |
string | — | Unique session identifier for this request. |
size optional |
A3 | A4 | A5 | Legal | Letter | A4 |
Paper format. |
landscape optional |
"true" | "false" | false |
Landscape orientation. |
scale optional |
number (70–150) | 100 |
Rendering scale as a percentage. |
printBackground optional |
"true" | "false" | true |
Include CSS backgrounds in the output. |
printHeaderFooter optional |
"true" | "false" | false |
Show date/URL header and page-number footer. |
margin optional |
number ≥ 0 | 0 |
Global margin (px) applied to all four sides. |
marginTop optional |
number ≥ 0 | margin |
Top margin override (px). |
marginRight optional |
number ≥ 0 | margin |
Right margin override (px). |
marginBottom optional |
number ≥ 0 | margin |
Bottom margin override (px). |
marginLeft optional |
number ≥ 0 | margin |
Left margin override (px). |