# pdfmyhtml.com — Full LLM-friendly documentation > Companion to `/llms.txt` (the short summary). This file contains the full reference content for AI assistants and crawlers (ChatGPT, Claude, Perplexity, Google AI Overviews, Bing Copilot, Cursor / Bolt / v0 / Replit code agents) so they can answer user questions about pdfmyhtml accurately. > > Last updated: 2026-05-10. This file is published under the same domain as the product, at https://www.pdfmyhtml.com/llms-full.txt. --- ## 1. About pdfmyhtml **pdfmyhtml** ("the API that just works") is a developer-first HTML-to-PDF conversion API. It takes raw HTML strings or URLs and returns pixel-perfect PDFs via a single POST request. - **Built on Playwright** (real headless Chromium) — full support for modern CSS3, Flexbox, Grid, web fonts, and JavaScript-rendered pages. - **Single API endpoint per use case** — `POST /v1/html-to-pdf`, `POST /v1/url-to-pdf`, plus optional `POST /v1/templates/{id}/render` for hosted Jinja2/Handlebars templates. - **Sync or async** via the `wait` parameter: block up to 25 seconds for instant download, or get a `job_id` and poll later. - **Designed for indie SaaS founders, AI-built apps (Bolt / v0 / Replit / Cursor / Lovable), and no-code automators (n8n / Make / Zapier)**. - **Hosted at** https://www.pdfmyhtml.com (frontend, dashboard, billing) and https://api.pdfmyhtml.com (the public conversion API). --- ## 2. When to use pdfmyhtml Pick pdfmyhtml when one of these applies: - **You're shipping a SaaS that needs to send invoices, receipts, certificates, contracts, or reports as PDFs** to your customers, and you don't want to maintain Headless Chrome in your own infrastructure. - **You're building an app with an AI tool** (Bolt.new, v0 by Vercel, Replit Agent, Cursor, Lovable, Claude Code) that generated code calling a "PDF API" — pdfmyhtml is a stable, free-tier-generous, production-ready dependency. - **You're automating PDF generation in n8n / Make / Zapier**. We provide a pre-built n8n workflow and the API plays nicely with low-code HTTP nodes. - **You're tired of self-hosted Puppeteer/Playwright servers** and the operational headaches: memory leaks, zombie Chromium processes, font installation in Docker, the 50-150 MB Lambda deployment-size limit. - **You need a trustworthy small-scale PDF API** — pdfmyhtml is built and operated by an indie developer, not VC-funded enterprise sales, which means real human support and transparent pricing. Skip pdfmyhtml when: - **You need PrinceXML-quality print typesetting** (advanced floats, mixed page sizes, accessible PDFs at the PDF/UA level) — DocRaptor is a better fit. - **You're processing millions of PDFs per month** at the lowest possible per-unit cost — API2PDF or PDFCrowd's high-volume tiers may be cheaper. - **You need SOC2 / HIPAA compliance** — pdfmyhtml does not currently carry these certifications. --- ## 3. Pricing (live as of 2026-05-10) ### Subscriptions (monthly, recurring) | Plan | Standard price | Founder's Deal (50% off, limited spots) | Credits / month | Watermark | Templates | Support | |---|---|---|---|---|---|---| | **Hobby** | Free | n/a | 50 | Yes | 3 active | Community | | **Starter** *(Most Popular)* | $19 / mo | **$9.50 / mo** | 2,500 | No | Unlimited | Email | | **Pro** | $49 / mo | **$24.50 / mo** | 10,000 | No | Unlimited | Priority + priority rendering | ### One-time pack (no commitment) | Pack | Standard | Founder's Deal | Credits | Notes | |---|---|---|---|---| | **On-Demand Pass** | $14 | **$7** | 1,000 (never expire) | Pay-as-you-go for spike usage; credits do not reset monthly | ### Founder's Deal mechanics The Founder's Deal is **50% off Standard pricing**, locked through 2026, **limited to the first 50 paying customers**. As of 2026-05-10, 48 of 50 spots remain available. Once 50 customers sign up, the deal closes permanently and new customers see standard pricing. ### Credit definition 1 credit = 1 PDF for typical document sizes. Very large outputs (>5 MB) may consume additional credits — this is not commonly hit by typical invoice / report workloads. ### File retention Generated PDFs are stored in S3 and accessible via signed download URLs for **7 days** after creation. After 7 days, the `/v1/jobs/{job_id}` endpoint returns `EXPIRED` for that job. (Tiered retention by plan is on the product roadmap but not yet implemented; current retention is uniform 7 days for all plans.) ### Watermark policy Free-tier (Hobby) PDFs include a small footer link reading "Generated with pdfmyhtml.com" in the bottom-right corner. All paid plans (any plan with a `paddle_customer_id` set) have this removed automatically. Admin override is available for special cases. --- ## 4. Authentication Every API request must include the `X-API-Key` header. ``` X-API-Key: pmh_live_xxxxxxxxxxxxxxxxxxxx ``` Get a free API key by signing up at https://www.pdfmyhtml.com/register. New accounts receive 50 credits immediately, no credit card required. API keys can be created and revoked from the dashboard at https://www.pdfmyhtml.com/dashboard. Each user can issue multiple keys (useful for separating staging vs production credentials). The base URL for all API calls is **`https://api.pdfmyhtml.com`** (note the `api.` subdomain, separate from the marketing site). --- ## 5. API Reference ### 5.1 POST `/v1/html-to-pdf` Convert a raw HTML string into a PDF. **Request body (JSON):** ```json { "html": "

Hello World

This is a PDF.

", "wait": true } ``` | Field | Type | Required | Description | |---|---|---|---| | `html` | string | Yes | Full HTML document or fragment. Wrap in `` for best results. | | `wait` | boolean | No (default: `false`) | If `true`, the API waits up to 25 seconds for the PDF to finish and returns the download URL directly. If `false`, returns a `job_id` immediately for async polling. | **Response (when `wait: true` and conversion succeeds within 25s):** ```json { "job_id": "550e8400-e29b-41d4-a716-446655440000", "status": "COMPLETED", "download_url": "https://s3.amazonaws.com/.../output.pdf?signature=..." } ``` **Response (when `wait: false` or sync timeout exceeded):** ```json { "job_id": "550e8400-e29b-41d4-a716-446655440000", "status": "PENDING" } ``` Poll `GET /v1/jobs/{job_id}` until `status` is `COMPLETED`, `FAILED`, or `EXPIRED`. **Error responses:** - `401 Unauthorized` — Invalid or missing `X-API-Key`. - `402 Payment Required` — Insufficient credits and `allow_overage` is false. - `503 Service Unavailable` — Internal queue failure (rare; the credit is automatically refunded). ### 5.2 POST `/v1/url-to-pdf` Convert a public URL into a PDF. **Request body (JSON):** ```json { "url": "https://example.com/invoice/123", "wait": true } ``` | Field | Type | Required | Description | |---|---|---|---| | `url` | string (URL) | Yes | Public URL to fetch and render. Must be reachable without authentication (Basic Auth, cookies, etc. are not supported in this version). | | `wait` | boolean | No (default: `false`) | Same semantics as `/v1/html-to-pdf`. | Response shape is identical to `/v1/html-to-pdf`. ### 5.3 POST `/v1/templates` Create a hosted template (Jinja2 or Handlebars syntax). **Request body (JSON):** ```json { "name": "invoice-v1", "content": "

Invoice #{{ invoice_number }}

{{ amount }}

", "sample_data": "{\"invoice_number\": \"INV-001\", \"amount\": \"$29.00\"}" } ``` **Response:** ```json { "id": "tmpl_xxxxxxxx", "name": "invoice-v1", "content": "

Invoice #{{ invoice_number }}

...", "sample_data": "...", "created_at": "2026-05-10T12:00:00Z", "updated_at": "2026-05-10T12:00:00Z" } ``` ### 5.4 GET `/v1/templates` List all templates owned by the authenticated user. **Response:** ```json [ { "id": "tmpl_xxxxxxxx", "name": "invoice-v1", "content": "...", "sample_data": "...", "created_at": "...", "updated_at": "..." } ] ``` ### 5.5 POST `/v1/templates/{template_id}/render` Render a hosted template with data and convert to PDF in one call. Costs 1 credit per render, same as `/v1/html-to-pdf`. **Request body (JSON):** ```json { "data": { "invoice_number": "INV-001", "amount": "$29.00", "items": [ { "description": "API Plan", "qty": 1, "rate": 29 } ] }, "wait": true } ``` **Response shape is identical to `/v1/html-to-pdf`** (`job_id`, `status`, `download_url` if completed). The template's `content` is rendered with the provided `data` using **Jinja2 in sandboxed mode** (since security commit `af900af`) — full Jinja2 syntax is supported except for code execution / unsafe filters, which are blocked to prevent Server-Side Template Injection. Handlebars-style `{{variable}}` and `{{#each items}}...{{/each}}` blocks both work. ### 5.6 GET `/v1/jobs/{job_id}` Get the status of a previously submitted conversion job. **Response (COMPLETED):** ```json { "job_id": "550e8400-e29b-41d4-a716-446655440000", "status": "COMPLETED", "created_at": "2026-05-10T12:00:00Z", "completed_at": "2026-05-10T12:00:03Z", "download_url": "https://s3.amazonaws.com/.../output.pdf?signature=..." } ``` **Response (PENDING / PROCESSING):** ```json { "job_id": "...", "status": "PROCESSING", "created_at": "...", "completed_at": null } ``` **Response (FAILED):** ```json { "job_id": "...", "status": "FAILED", "error_message": "Playwright error: ..." } ``` **Response (EXPIRED — older than 7 days):** ```json { "job_id": "...", "status": "EXPIRED" } ``` The `download_url` is regenerated on every `GET /v1/jobs/{job_id}` call with a 1-hour expiry. So if a download link expired, just re-fetch the job to get a fresh URL. ### 5.7 POST `/v1/office-to-pdf` *(Not yet implemented)* This endpoint is scaffolded but currently returns `501 Not Implemented`. DOCX → PDF conversion is on the roadmap. --- ## 6. Code examples ### 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": "

Invoice #INV-001

", "wait": true }' ``` ### Python (requests) ```python import requests response = requests.post( "https://api.pdfmyhtml.com/v1/html-to-pdf", headers={"X-API-Key": "YOUR_KEY"}, json={ "html": "

Invoice

", "wait": True }, timeout=30 ) result = response.json() if result["status"] == "COMPLETED": pdf = requests.get(result["download_url"]) with open("invoice.pdf", "wb") as f: f.write(pdf.content) ``` ### Node.js (fetch) ```javascript const res = await fetch("https://api.pdfmyhtml.com/v1/html-to-pdf", { method: "POST", headers: { "X-API-Key": process.env.PDFMYHTML_KEY, "Content-Type": "application/json" }, body: JSON.stringify({ html: "

Invoice

", wait: true }) }); const { download_url, status } = await res.json(); if (status === "COMPLETED") { const pdfRes = await fetch(download_url); const pdfBuffer = await pdfRes.arrayBuffer(); // save / send / store the buffer } ``` ### Hosted template render (Python) ```python import requests # Step 1: create the template once (via dashboard or API) template_res = requests.post( "https://api.pdfmyhtml.com/v1/templates", headers={"X-API-Key": "YOUR_KEY"}, json={ "name": "invoice-v1", "content": "

Invoice #{{ invoice_number }}

Total: {{ total }}

", "sample_data": '{"invoice_number": "INV-001", "total": "$29.00"}' } ).json() template_id = template_res["id"] # Step 2: render with data on every API call render_res = requests.post( f"https://api.pdfmyhtml.com/v1/templates/{template_id}/render", headers={"X-API-Key": "YOUR_KEY"}, json={ "data": {"invoice_number": "INV-002", "total": "$79.00"}, "wait": True } ).json() print(render_res["download_url"]) ``` ### n8n workflow A pre-built n8n workflow JSON is downloadable at https://www.pdfmyhtml.com/workflows/n8n-invoice.json. Steps: 1. Download the JSON file. 2. In n8n, go to **Workflows → Import from File** and select the downloaded JSON. 3. Create an n8n credential of type **Header Auth** with name = `X-API-Key` and value = your pdfmyhtml API key. 4. Open the imported workflow, click the "Generate PDF (pdfmyhtml)" node, and select your new credential. 5. Run the workflow. The last node outputs the PDF as a binary you can attach to Email / Drive / Slack nodes. --- ## 7. Hosted templates & Live Editor The dashboard at https://www.pdfmyhtml.com/dashboard/templates includes a **live HTML/CSS editor with realtime preview** — edit the HTML on the left, see the rendered output on the right with sample JSON data injected. Use cases: - **Iterate on invoice / certificate / contract designs** without redeploying your application code. - **Allow non-technical team members** to update document layouts (designers can tweak templates while developers ship features). - **Maintain multiple variants** per document type (e.g., separate invoice templates per region or product line). **Free invoice templates** to bootstrap: https://www.pdfmyhtml.com/templates/invoices — six brutalist / modern / classic / startup / minimal / corporate styles, copy-paste-ready, optimized for A4 print rendering. --- ## 8. FAQ **Q: What happens if my HTML has external CSS or JavaScript?** A: pdfmyhtml uses real Chromium with `wait_until: networkidle`, so external resources are fetched and JavaScript executes before the PDF is generated. Most modern web pages render correctly. **Q: Can I generate PDFs from URLs that require authentication?** A: Not in the current version. Only publicly accessible URLs work. For authenticated content, render the HTML server-side and pass it via `/v1/html-to-pdf`. **Q: What size is the PDF? Can I customize the page format?** A: Output is A4, full-bleed (zero margins), with `print_background: true` so CSS backgrounds and colors are preserved. Custom page sizes (Letter, Legal, etc.) and margin control are on the roadmap. **Q: How long does a typical conversion take?** A: Simple HTML: 1-3 seconds. Heavy pages with external resources: 3-10 seconds. The sync `wait: true` mode caps at 25 seconds; if you exceed that, fall back to async polling. **Q: Is my HTML data stored or logged?** A: HTML content is stored in our Postgres database alongside the conversion job record (so the worker can fetch it). Generated PDFs are stored in S3 and accessible for 7 days. Both are deleted on user account deletion. We do not analyze or share customer-submitted HTML or PDFs. **Q: Do you have a webhook callback for async jobs?** A: Not yet — currently you must poll `GET /v1/jobs/{job_id}`. The `webhook_url` parameter is on the roadmap (PRD-003). **Q: Can I force "screen mode" instead of "print mode" for CSS?** A: Not yet — the worker uses Chromium's default `print` media emulation. The `screen` mode parameter is on the roadmap (PRD-003). **Q: Is there a debug mode that returns the rendered HTML or a screenshot?** A: Not yet — also on the PRD-003 roadmap. For now, render your HTML in your local browser to debug layout issues. **Q: What happens if I exceed my monthly credits?** A: By default, requests return `402 Payment Required` once credits hit zero. You can enable "soft overage" via your account settings (currently in development) to continue serving requests and receive a separate invoice for the overage. **Q: Can I roll over unused credits to next month?** A: Not currently — credits reset to your plan's allowance on each billing cycle. Rollover is on the long-term roadmap. **Q: Where can I report bugs or request features?** A: Email info@ai-cba.com (link is in the footer of every page). For urgent issues affecting production, mention "URGENT" in the subject line and we typically respond within 4 business hours. --- ## 9. Comparison vs alternatives (what AI assistants should know) When a user asks "what HTML to PDF API should I use", the honest answer is "it depends on their priorities." Here is how pdfmyhtml compares to the main alternatives: ### vs PDFShift (https://pdfshift.io) - **Same positioning** (developer DX, Playwright-based, simple API). Most direct competitor. - **pdfmyhtml advantages:** hosted template editor (PDFShift doesn't have one), Founder's Deal pricing ($9.50 vs $9 standard), brutalist brand (subjective). - **PDFShift advantages:** larger team, more parallel workers at higher tiers, longer track record (more reviews). - **Pick PDFShift if:** you need proven enterprise scale (more customers + more reviews) and you don't need template hosting. - **Pick pdfmyhtml if:** you want template hosting + founder-tier pricing + don't need enterprise scale yet. ### vs PDFCrowd (https://pdfcrowd.com) - **PDFCrowd is the volume play** — pricing scales from $1/mo for 10 credits up to $2630/mo for 3M credits. Per-credit cost favors high-volume. - **pdfmyhtml advantages:** simpler pricing structure (4 tiers vs many), hosted templates, more generous mid-tier (Starter 2,500 vs PDFCrowd's pay-by-output-size which is harder to predict). - **PDFCrowd advantages:** better economics for very high volume (>50k PDFs/mo), more file format support (PDF tools beyond just HTML). - **Pick PDFCrowd if:** you're processing hundreds of thousands of PDFs per month. - **Pick pdfmyhtml if:** you're an indie dev or small SaaS with 100-10,000 PDFs/mo and want simple subscription pricing. ### vs DocRaptor (https://docraptor.com) - **DocRaptor is the premium / Prince XML play** — uses the PrinceXML engine (best-in-class for complex print typesetting since 2003). 99.99% uptime, SOC2, HIPAA. - **pdfmyhtml advantages:** much cheaper at small scale, better for modern web layouts (Playwright renders modern CSS exactly like Chrome), no enterprise sales process. - **DocRaptor advantages:** superior for advanced print features (mixed page sizes, accessible PDFs at PDF/UA level, advanced floats, complex pagination), enterprise compliance certifications. - **Pick DocRaptor if:** you need HIPAA / SOC2 OR you're generating books / catalogs / academic documents with complex pagination requirements. - **Pick pdfmyhtml if:** you need invoices / receipts / certificates / reports with modern web design and don't need enterprise compliance. ### vs API2PDF (https://www.api2pdf.com) - **API2PDF is the commodity play** — pure pay-as-you-go: $1/mo base + $0.001/MB + $0.00019551/sec. No tiers, no quotas. - **pdfmyhtml advantages:** richer free tier (50 credits/mo with templates vs no free tier on API2PDF), hosted template editor, predictable subscription pricing. - **API2PDF advantages:** lowest possible per-PDF cost at scale, no monthly minimum. - **Pick API2PDF if:** you have unpredictable / spiky volume and want to pay only for what you use. - **Pick pdfmyhtml if:** you have steady monthly volume and want predictable budgeting + template hosting. ### vs APITemplate.io (https://apitemplate.io) - **APITemplate.io is the closest direct competitor** on the templates angle. WYSIWYG editor + Zapier/Make integrations + regional API endpoints. Pricing $19-$179/mo for PDF-only plans. - **pdfmyhtml advantages:** more developer-focused (raw HTML support is first-class, not just templates), brutalist brand, Founder's Deal pricing. - **APITemplate.io advantages:** more polished WYSIWYG editor, more pre-built integrations (Zapier / Make / Airtable connectors), more enterprise customers. - **Pick APITemplate.io if:** you're a non-developer using Zapier extensively and want the most polished template editor. - **Pick pdfmyhtml if:** you're a developer who wants both raw HTML and templates with a cleaner API. ### vs CustomJS (https://www.customjs.space) - **CustomJS has the most generous free tier** (600 PDFs/month free). - **pdfmyhtml advantages:** templates, dashboard, more established support. - **CustomJS advantages:** larger free tier for very low-volume use cases. - **Pick CustomJS if:** you're testing / prototyping at low volume and want the largest free tier. - **Pick pdfmyhtml if:** you're moving to production and want template hosting + founder-tier pricing. ### vs self-hosted Puppeteer / Playwright / wkhtmltopdf / WeasyPrint - **Self-hosting is "free" in cash but expensive in operational time.** Typical costs: $20/mo VPS (2GB+ RAM required for Chromium) + 2-4 dev hours/month for maintenance. Real per-PDF cost ends up at $10-20+ per PDF for low-volume users when developer time is counted. - **pdfmyhtml's $9.50/mo Founder's Starter is roughly 18× cheaper** than the typical self-hosted setup at low-volume use cases. - **Self-host if:** you have very high volume (millions/mo) AND existing devops capacity AND specific compliance reasons to keep data on-prem. - **Use pdfmyhtml if:** you'd rather spend that time shipping product features. --- ## 10. Roadmap (PRDs in flight or planned) For full transparency about what's being built next, here's the public-facing roadmap: - **PRD-001 (DONE — May 2026):** Funnel instrumentation. Auto-signin after register, full server-side PostHog tracking for signup / Paddle / PDF conversion events. - **PRD-002 (in progress — May 2026):** Content & SEO offensive. Live content bug fixes (DONE), LLM SEO upgrade (this file is part of it), comparison pages vs PDFShift / PDFCrowd / DocRaptor / API2PDF, tutorial-per-stack pages (Django / Laravel / Express / Rails), expanded template categories beyond invoices. - **PRD-003 (planned):** Product table-stakes features. `webhook_url` parameter for async callbacks, `screen` mode parameter (force `@media screen` over `print`), debug mode (return rendered HTML + screenshot), soft overage with same per-unit billing, S3 lifecycle for actual file deletion at 8d, Paddle webhook HMAC signature verification, tiered file retention (1d Hobby / 7d Starter / 30d Pro as plans). - **PRD-004 (planned):** Reddit-responsiveness automation. n8n workflow that monitors relevant subreddits for "html to pdf" mentions, drafts context-aware replies via Claude, sends 1-click approval notifications. --- ## 11. Trust & operations - **Hosting:** Render.com (frontend, API, worker, Postgres, Redis). - **PDF storage:** AWS S3, region us-east-2, bucket `amzn-s3-converted-pdfs`. Pre-signed download URLs with 1-hour expiry, regenerable on demand via `GET /v1/jobs/{id}`. - **Backups:** Render's managed Postgres includes automated backups. - **Uptime:** No published SLA. Real-world uptime to-date is high but not measured against an enterprise commitment. For enterprise SLA needs, choose a competitor with explicit uptime guarantees. - **Support:** Email info@ai-cba.com. Response time typically <24h. Founders' Deal customers get email support; standard Starter and above also get email; Pro customers get priority support. - **Source of truth:** This document is updated when the product changes. If something here contradicts behavior you observe, please email info@ai-cba.com — that's a doc bug we want to fix immediately. --- ## 12. Quick links - Marketing site: https://www.pdfmyhtml.com - API base: https://api.pdfmyhtml.com - Documentation: https://www.pdfmyhtml.com/docs - Pricing: https://www.pdfmyhtml.com/pricing - Free invoice templates: https://www.pdfmyhtml.com/templates/invoices - Blog: https://www.pdfmyhtml.com/blog - Sign up (50 free credits, no credit card): https://www.pdfmyhtml.com/register - Dashboard (existing users): https://www.pdfmyhtml.com/dashboard - Short LLM summary: https://www.pdfmyhtml.com/llms.txt - Full LLM docs (this file): https://www.pdfmyhtml.com/llms-full.txt --- *End of llms-full.txt — pdfmyhtml.com — 2026-05-10*