HTML in. PDF out.
Nothing kept.

A PDF API for invoices, contracts and patient records. We render in memory, send the file back, and keep no copy.

curl -X POST https://api.html4pdf.com/generate-pdf \
  -H "Authorization: Bearer $HTML4PDF_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "template": {
      "type": "invoice",
      "data": {
        "logo": "https://northgate.co/mark.svg",
        "company": { "name": "Northgate Bookkeeping" },
        "client": { "name": "Parker Family Dental" },
        "invoice": { "number": "INV-1042", "dueDate": "2026-10-22" },
        "items": [
          { "description": "Monthly bookkeeping", "quantity": 1, "rate": 850 },
          { "description": "Payroll run", "quantity": 6, "rate": 45 },
          { "description": "Quarterly tax filing", "quantity": 1, "rate": 400 }
        ]
      }
    },
    "responseFormat": "binary"
  }' \
  -o INV-1042.pdf
Waiting for request

Northgate Bookkeeping

[email protected]

Invoice

INV-1042

Billed to

Parker Family Dental

Emily Parker

Issued

Sep 22, 2026

Due

Oct 22, 2026

DescriptionQtyRateAmount
Monthly bookkeeping1$850.00$850.00
Payroll run6$45.00$270.00
Quarterly tax filing1$400.00$400.00
Subtotal$1,520.00
Sales tax 8.25%$125.40
Total$1,645.40

Payment by ACH within 30 days. Thank you.

Page 1 of 1

Stored on our side: 0 bytes

Your document exists for a few seconds.
Then it is gone.

Many PDF services store your files so you can download them later. We hand the file back in the same request, so there is nothing to keep.

  1. POST/generate-pdf

    1Arrives

    Your request comes in over TLS and goes straight to a rendering worker. There is no upload bucket in between.

  2. 2Renders

    Headless Chromium lays out your HTML with real CSS, web fonts and JavaScript, entirely in memory.

  3. 3Returns

    The finished PDF comes back in the same response, as binary or base64. URLs are delivered to your webhook.

  4. 0 B

    4Forgotten

    The worker releases its memory. There is no copy left to leak, back up or delete on request.

What we keep

Enough to run your account and bill you.

  • Your email address and hashed API keys
  • Credit balance and purchase history
  • How many PDFs you generated each day
  • Your webhook URL, if you set one

What we never keep

Anything inside your documents.

  • The HTML you send
  • Pages we fetch from your URLs
  • Template data: names, amounts, addresses
  • The PDFs themselves

Three ways in.
One endpoint.

Send the markup you already have.

Inline CSS, Google Fonts, flexbox, grid, even charts drawn with JavaScript. If Chrome can print it, so can we.

Cost
1 credit
Delivery
Same response
Returns
Binary or base64
POST /generate-pdf
{
  "html": "<h1>Discharge summary</h1><p>Patient: Emily Parker</p>...",
  "responseFormat": "binary",
  "options": {
    "format": "Letter",
    "margin": { "top": "20mm", "bottom": "20mm" },
    "printBackground": true
  }
}
200 OK application/pdf

Skip the HTML.
Send the data instead.

Four templates cover most of what finance, legal and healthcare teams print. Every one is free to try in the browser, no account needed.

Pay for PDFs,
not for months.

Every account starts with 10 free credits. Top up when you need more. Credits never expire and there is no subscription.

Starter

$5

100 credits, $0.05 per PDF

Buy credits

Growth

$20

500 credits, $0.04 per PDF

Buy credits

Scale

Best value

$50

1,500 credits, $0.033 per PDF

Buy credits

What a credit buys

HTML or template, same response
1 credit
HTML delivered to your webhook
2 credits
URL, delivered to your webhook
2 credits
  • All templates included
  • Unlimited API keys

Questions,
answered.

Do you store my HTML or the PDFs?

No. Your request is rendered in memory, the PDF is sent back in the same response, and the worker releases that memory. Nothing from the document is written to disk or kept in storage.

Can I use it for patient records or financial documents?

That is what it is built for. Because document contents never persist, there is no stored personal data or PHI on our side to breach. How you store and share the PDFs afterwards is still up to you.

What happens when I run out of credits?

Requests return 402 Payment Required until you top up from the dashboard. Credits never expire, so there is no reason to buy more than you need.

Why do URL conversions cost 2 credits?

We have to load the page in a full browser and wait for it to settle, so URLs always run asynchronously and are posted to your webhook. That costs us more than rendering HTML you send directly.

Can I use custom fonts and JavaScript?

Yes. Rendering runs in headless Chrome, so Google Fonts, @font-face with absolute URLs, flexbox, grid and scripts that draw charts all work.

Base64 or binary?

Base64 is the default and arrives inside a JSON response with your remaining credits. Set responseFormat to binary to receive the raw PDF with Content-Type: application/pdf.