USE CASE · HTML → PDF
HTML to PDF API
Send your markup, get back a finished PDF. PDFRelay renders with real headless Chromium via Playwright, so the CSS, fonts, and page breaks your templates already use come out exactly as the browser draws them, no separate print stylesheet required.
One call, one document
POST /api/v1/pdf takes an html field in the request body plus an optional options object for paper size, margins, scale, and page ranges. A successful call returns 200 with application/pdf bytes directly, no polling or webhook required.
Every key carries its own monthly quota and rate line, visible on every response via the X-Pdfrelay-Quota-* headers. Identical HTML plus the same options is served from a short-TTL cache instead of re-rendering, and cache hits don’t consume quota.
What renders
| Input | Handling |
|---|---|
| Arbitrary HTML | Rendered by headless Chromium, CSS Grid and flexbox included. |
| Fonts and page breaks | Drawn exactly as Chrome would print them. |
| Paper size and margins | format, landscape, margin, and preferCSSPageSize options. |
| Repeated payloads | Served from cache, free and instant. |
TRY IT · FREE · NO SIGNUP
See your own markup rendered
Paste your HTML into the free playground and render a proof in seconds, using the exact engine the API uses.
Free tier: 150 documents/month, no card. More in the FAQ, or see how this compares to running your own headless Chrome in PDFRelay vs DIY Puppeteer. Back to the PDFRelay homepage.