# pdfmyhtml.com ## Summary pdfmyhtml (the "API that just works") is a developer-first document-generation and HTML-to-PDF API built on Playwright (real headless Chromium) and Python. It does two things: (1) generate polished **invoices, quotes, and receipts** from structured JSON using ready-made templates (you send the data, we own the layout and compute the totals), and (2) convert raw HTML strings or any public URL to pixel-perfect PDFs. The same engine powers a free no-code generator UI and the developer API — uniquely, you can use either door. Designed for indie developers, AI-built apps, SaaS teams embedding document generation, and no-code automators (n8n / Make / Zapier). ## When to use pdfmyhtml - You need to generate invoices, receipts, certificates, contracts, or reports as PDFs from your SaaS or app - You're building with an AI tool (Bolt, v0, Replit, Cursor) that needs a reliable PDF API dependency - You're automating PDF generation in n8n / Make / Zapier - You want to stop wrestling with self-hosted Puppeteer/Playwright servers (memory leaks, zombie processes, font issues, deployment size limits) ## Key Features - **Document Generation API** — `POST /v1/invoices`, `POST /v1/quotes`, `POST /v1/receipts`. Send structured JSON (parties, line items, tax); get a polished PDF. Server computes subtotal/tax/total. Multiple styles per type (invoices: modern/classic/minimal/brutalist/startup; receipts: thermal/modern; quotes: modern/classic + validUntil/terms). - **Live preview endpoint** — `POST /v1/preview` returns rendered HTML (no API key, no credit) for instant previews; the same canonical template the PDF endpoints use. - **Real Chromium rendering** via Playwright — full CSS3 / Flexbox / Grid / web fonts / JavaScript support - **HTML & URL to PDF** — `POST /v1/html-to-pdf` or `POST /v1/url-to-pdf`. JSON in, PDF out (or async job_id). - **Sync or async** via the `wait` parameter — block up to 25s for instant download, or get a job_id and poll - **Custom templates** — save your own Jinja2/Handlebars HTML in the dashboard, render with JSON data each call - **Free invoice generator** — brutalist/modern/classic/startup/minimal styles, in-browser, copy-paste ready, with the exact API call to reproduce it - **n8n workflow ready** — pre-built workflow JSON downloadable for instant integration - **One engine, two doors** — the no-code generator UI and the API render the identical templates, so what you preview is what you ship ## Pricing - **Hobby (Free):** 50 credits/month, watermarked PDFs, 7-day file retention - **Founder's Starter:** $9.50/month for 2,500 credits/mo, no watermark — limited Founder's Deal (50% off, locks pricing through 2026, only 50 spots) - **Founder's Pro:** $24.50/month for 10,000 credits/mo, no watermark, priority rendering - **On-Demand Pass:** $7 one-time for 1,000 credits that never expire (also 50% off via Founder's Deal) - Standard pricing (after Founder's Deal closes): Starter $19/mo, Pro $49/mo, On-Demand Pass $14 1 credit = 1 document (one HTML/URL conversion OR one generated invoice/quote/receipt — same shared pool). One subscription covers every product type. Both monthly subscriptions and pay-as-you-go packs are available. ## Documentation - [Docs Home](/docs) - [Pricing](/pricing) - [Free Invoice Templates Gallery](/templates/invoices) - [Long-form docs (LLM-friendly)](/llms-full.txt) ## Code Examples ### Generate an invoice PDF from JSON (cURL) ```bash curl -X POST https://api.pdfmyhtml.com/v1/invoices \ -H "X-API-Key: YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{ "style": "modern", "taxRate": 10, "from": { "name": "Acme Corp" }, "to": { "name": "Client Inc" }, "items": [{ "description": "Design work", "quantity": 10, "rate": 150 }], "wait": true }' ``` Swap `/v1/invoices` for `/v1/quotes` or `/v1/receipts` for the other document types. ### Convert raw HTML to PDF (cURL) ```bash curl -X POST https://api.pdfmyhtml.com/v1/html-to-pdf \ -H "X-API-Key: YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{ "html": "