Hosted API · same engine as the open source

HTML to PDF API, without a headless browser

POST your HTML and print CSS, get a PDF back. Or save a template once and send only its data. The API runs the open-source Forme engine — a Rust layout engine built for pages — so running headers, page counters, and table headers that repeat across pages come out right.

  • Raw HTML, or saved templates with JSON data
  • Redact, merge, certify, and extract over HTTP
  • Save to your own S3 bucket, or get the bytes back
  • Byte-identical to self-hosting on the same engine version — move off any time

Free plan, no card required.

curl https://api.formepdf.com/v1/render/html \
  -H "Authorization: Bearer $FORME_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "html": "<h1>Invoice #2024-001</h1><p>Widget Pro — $49.00</p>"
  }' \
  -o invoice.pdf

The response body is the PDF. Print CSS — @page, margin boxes, page counters — works as written.

~20 ms typical engine render for a multi-page document, measured in workerd. Benchmarks →

41/41 documents pass their claimed PDF/A and PDF/UA profiles — 165 veraPDF validations on every engine commit.

MIT licensed engine. The API is a convenience, not a lock-in.

How it works

Three steps from HTML to a PDF

  1. 01

    Create a key

    Sign up in the Dashboard and create an API key. Keys start with forme_sk_ and can be revoked at any time.

  2. 02

    Send HTML or data

    POST HTML to /v1/render/html, or save a template in the Dashboard — HTML with Liquid, or React components — and send its JSON data to /v1/render/{slug}.

  3. 03

    Get the PDF

    The response body is the PDF, or a URL if you pass an s3 config. Usage and request logs for your account are in the Dashboard.

Render a saved template with data
# Or save a template once and send only its data
curl https://api.formepdf.com/v1/render/invoice \
  -H "Authorization: Bearer $FORME_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "number": "2024-001",
    "customer": "Northwind Trading",
    "items": [{ "name": "Widget Pro", "price": 49 }]
  }' \
  -o invoice.pdf

A saved template is HTML with Liquid, with its CSS in a separate tab, or React components. Liquid binds the data — {{ customer.name }}, {% for item in items %}, and the currency, number, and percent filters — and HTML-escapes its output. The Dashboard ships 30 ready-made HTML document templates to start from: invoices, quotes, statements, letters, contracts, reports, and a shipping label.

Endpoints

Render, redact, merge, and certify PDFs over HTTP

Each render, redact, merge, or certify call is one operation; extract and the listing routes are not counted. Authenticate with Authorization: Bearer forme_sk_…. Limit: 100 requests per minute per key.

MethodEndpointWhat it does
POST/v1/render/htmlRender HTML and print CSS directly — @page rules, margin boxes, page counters, @page :first. No saved template needed.
POST/v1/render/{slug}Render a saved template. The JSON body is the template's data; add s3 to upload to your bucket and get a URL back instead of bytes.
POST/v1/render/{slug}/asyncQueue a render and return 202 with a jobId. Pass webhookUrl to be called when it finishes.
GET/v1/jobs/{jobId}Check an async render's status and fetch the result.
POST/v1/redactRemove text from a PDF by literal or regex pattern, built-in presets, or a saved redaction template — content-stream removal, not a box drawn over it.
POST/v1/mergeCombine 2 to 20 PDFs into one, in order.
POST/v1/certifyCertify a PDF with a certificate stored in the Dashboard, or a PEM certificate and key you send.
POST/v1/extractRead back the JSON data embedded in a PDF rendered from a JSX template — no OCR.
GET/v1/templatesList your templates (also documents, redaction templates, and certificates).

Full request and response schemas in the API reference →

Why not a Chrome-based API?

A PDF API built on a layout engine for pages

Most PDF APIs run headless Chrome behind the endpoint, and you inherit its print model: fragile page breaks, headers that may or may not repeat, a browser to keep warm. Forme lays out into pages directly.

Print CSS that works

@page rules, @top-center running heads, counter(page), @page :first, and break control — the parts browsers never finished. Unsupported CSS is named in a warning, not silently dropped.

Async and webhooks

Queue big batches with /async and get a webhook when each one is done, instead of holding a connection open.

Tables that page

Header rows repeat on every page automatically and cell content is never lost across a break.

Straight to your storage

Pass an s3 config and the PDF goes to your bucket — AWS or any S3-compatible endpoint — and you get a URL back.

Data you can read back

When you render a JSX template with /v1/render/{slug}, its data is embedded in the PDF. /v1/extract returns it later as JSON — no OCR, no re-keying. HTML templates and /v1/render/html do not embed data.

No lock-in

It's the MIT engine. On the same engine version, the same HTML renders to the same bytes with @formepdf/html on your own servers.

Moving from a browser-based setup? Replacing Puppeteer → · from wkhtmltopdf →

Hosted or self-hosted

Start on the API. Self-host whenever you want.

The API and the open-source packages run the same engine, tested in CI to produce byte-identical output on the same engine version. Choose by where you want rendering to happen, not by what it produces.

Hosted API
Nothing to install or size. Keys, usage, and request logs included. Good when you'd rather not run WASM in production.
Self-hosted
Free, in-process, no network hop. Runs on Node, Workers, Edge, Bun, Deno, the browser, and Python.

See the open-source PDF engine →

The same render, self-hosted
// The same HTML, rendered in your own process
import { renderHtml } from '@formepdf/html';

const { pdf, warnings } = await renderHtml(html);

HTML to PDF API questions

What is an HTML to PDF API?
A web service that takes HTML and CSS in an HTTP request and returns a PDF. Forme's API does this with its own layout engine rather than a headless browser, so print CSS such as @page rules, margin boxes, and page counters works as written.
Does the Forme API use headless Chrome?
No. It runs the open-source Forme engine, written in Rust and compiled to WASM. There is no browser in the render path, which is why page breaks, running headers, and table headers that repeat across pages behave predictably.
Should I send HTML or use a template?
Send HTML when your app already produces it. Save a template when the layout is fixed and only the data changes: your app then sends JSON, and you can render it asynchronously with a webhook. A saved template is either HTML with Liquid or React components, and the Dashboard has 30 ready-made HTML document templates to start from.
What counts as an operation?
Each render, redact, merge, or certify call is one operation. Extract calls and the GET listing routes are not counted. Usage is tracked for your account in the Dashboard.
Is the hosted output the same as self-hosting?
Yes, on the same engine version. The API runs the same engine as the @formepdf npm packages, which is tested in CI to produce byte-identical output across builds. On the same version, a document renders the same either way.
Can I move from the API to self-hosting?
Yes. Forme is MIT licensed. Install @formepdf/html and call renderHtml with the same HTML; nothing about the document has to change.
Is there a free plan?
Yes. You can sign up and render without a card. See the Dashboard for current plan limits.