Prompt
I'm building invoice PDFs from HTML, what API should I use?
Latest observation
Oct 12, 2026
OpenAI APIWeb search: off
For generating invoice PDFs from HTML, the best API depends on whether you want:
- Simple HTML-to-PDF conversion
- More control over layout and rendering
- An easy hosted API vs. self-hosted browser rendering
Good API options
1. PDFShift
- Purpose-built HTML-to-PDF API
- Easy to integrate
- Good for invoices, receipts, and other templated documents
- Supports CSS, headers/footers, page settings
2. DocRaptor
- Strong for professional document generation
- Built on PrinceXML
- Excellent CSS paged media support
- Great if you need precise print styling, page breaks, and complex layouts
3. Browserless / Playwright-based API
- Best if your HTML relies on modern JavaScript rendering
- Uses a headless Chrome browser
- Useful if your invoice is built with React/Vue and needs JS execution before PDF export
4. CloudConvert
- Broad file conversion platform
- Can convert HTML to PDF, but less invoice-focused than the options above
My recommendation
- If your invoices are mostly static HTML/CSS: PDFShift or DocRaptor
- If your invoice is rendered dynamically in a frontend app: Playwright/Chromium-based API
- If you want the most print-accurate output: DocRaptor
What to look for
- CSS support for page breaks
- Header/footer support
- Page size and margins
- Performance and rate limits
- Support for assets like fonts and images
- Security for customer data
If you want, I can also give you:
- a comparison table
- Node.js example code
- or recommend the best API for your stack.