Menu

1 / 2

I Built a PDF API That Doesn't Use Chrome – Here's Why

DEV Community·cimigoo·6 months ago
#6lGfk9sI
#pdf#api#webdev#saas#chrome
Reading 0:00
15s threshold

I Built a PDF API That Doesn't Use Chrome

Most PDF generation APIs spin up a headless browser (Puppeteer, Playwright) to render HTML into a PDF. It works, but it's slow, expensive, and unpredictable.

So I built DocForge – a PDF generation API that uses PDFKit directly for deterministic, fast output.

How It Works

POST /api/generate { "template": "invoice", "data": { "invoice_number": "INV-001", "from": { "name": "Acme Corp" }, "to": { "name": "Client Corp" }, "items": [...], "total": 49.99 } } → Returns a PDF in ~3 seconds

Enter fullscreen mode

Exit fullscreen mode

Why Not Chrome?

Headless Chrome PDFKit (DocForge)

Speed 5-15 seconds ~3 seconds

Memory 500MB+ per instance ~50MB

Deterministic ❌ Different renders possible ✅ Same input = same output

Cost Expensive at scale Cheap at scale

5 Templates Available Now

Invoice – Professional billing with line items

Receipt – Payment confirmation

Certificate – Achievement/completion certificates

Report – Data-driven reports

Contract – Legal document…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.