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

InputHandling
Arbitrary HTMLRendered by headless Chromium, CSS Grid and flexbox included.
Fonts and page breaksDrawn exactly as Chrome would print them.
Paper size and marginsformat, landscape, margin, and preferCSSPageSize options.
Repeated payloadsServed 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.

Open the playgroundRead the docs

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.

HTML to PDF API · PDFRelay