PDF Generator API: HTML to PDF, With Prices Compared

Updated by Cyril Nicodème

Send PDFShift your HTML or a URL in one POST request, and the PDF comes back in the response. Your templates stay in your own code, the Chromium that renders them runs on our servers, and you can see what it costs before you sign up: free for 50 credits a month, then from $9 for 500 to $799 for 500,000.

Generate an invoice PDF from HTML with one API call

Your app already renders the invoice as HTML. Send that HTML as source, with your API key in the X-API-Key header:

curl https://api.pdfshift.io/v3/convert/pdf \
  -H 'X-API-Key: sk_your_api_key' \
  -H 'Content-Type: application/json' \
  -d '{"source": "<h1>Invoice #1042</h1><p>Total: $240.00</p>"}' \
  -o invoice-1042.pdf

The response body is the PDF itself, so -o writes it straight to a file. Got a URL instead? Put it in source and we load the page and convert it, no extra flag.

The same call from Node.js 18 or later, and from Python with requests:

const res = await fetch('https://api.pdfshift.io/v3/convert/pdf', {
  method: 'POST',
  headers: {
    'X-API-Key': process.env.PDFSHIFT_API_KEY,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({ source: invoiceHtml })
})
const pdf = Buffer.from(await res.arrayBuffer())
import os, requests

res = requests.post(
    "https://api.pdfshift.io/v3/convert/pdf",
    headers={"X-API-Key": os.environ["PDFSHIFT_API_KEY"]},
    json={"source": invoice_html},
)
pdf = res.content

Read the body as bytes, not JSON. If you'd rather have a link, add "filename": "invoice-1042" and the response turns into JSON with a url to the PDF, plus filesize, duration and pdf_pages. Add "encode": true and the PDF comes back Base64-encoded. Every parameter is in the convert reference (API v3).

One request, four ways to get the resultWith no parameter added, the response body is the PDF. With filename, JSON with a URL to the PDF, kept for 2 days. With encode true, the PDF as Base64 text. With webhook, a 202 at once and the result posted to your webhook later.You addYou get backNo parameterThe PDF, as the response body"filename"JSON with a url, kept 2 days"encode": trueThe PDF as Base64 text"webhook"202 now, the result POSTed later
What one POST to /v3/convert/pdf sends back, by the parameter you add. PDFShift API v3.

Templates in a visual editor, or your own HTML?

We render the HTML and CSS you already have, with a current Chromium. Most of the other PDF generator APIs you'll find in a search work the opposite way: you rebuild the template in their visual editor, then fill it with JSON. If your developers own the layout, that's a second copy of every template, in another company's editor, to keep in sync. Rather keep templates with us? Store them as HTML through the API and send only the data each time.

PDF generation API comparison: what 500 to 500,000 PDFs a month cost

We count 1 credit per 5 MB of output, so an invoice or a report of a few pages costs 1 credit. Here's the smallest published plan that covers each volume of one-page PDFs, and what it costs a month:

APIBilled by500 a month5,00050,000500,000
PDFShiftcredit (1 per 5 MB)$9$39$149$799
PDF Generator APIcredit (1 per 1 to 5 pages)€43, billed yearly€73, billed yearly€296, billed yearlynot published
CraftMyPDFPDF$29$99$499contact sales
APITemplate.ioPDF$24$89not publishednot published
PDFMonkeydocument€6.60€29€300€2,500
Nutrient DWS APIcredit (0.5 per HTML to PDF)$75$275contact salescontact sales
Adobe PDF Servicesdocument transactionfree tier, 500 a monthcontact salescontact salescontact sales
DocRaptordocument$75$149contact salescontact sales
Api2PdfMB and compute secondabout $1.25about $3.46about $26about $247

Prices as of November 9, 2026, billed monthly unless the row says otherwise. PDFMonkey's figures include its published per-document overage. Api2Pdf charges $1 a month plus bandwidth and compute time, so its figures use the 0.1 MB, 2-second PDF from its own pricing example. A heavier page costs more.

The more PDFs you make, the fewer of these APIs will tell you the price:

At 500,000 PDFs a month, 3 of 9 APIs publish a priceBar chart of how many of the 9 APIs publish a monthly price that covers each volume. 500 PDFs a month: 9. 5,000: 8. 50,000: 5. 500,000: 3, PDFShift, PDFMonkey and Api2Pdf.03695005,00050,000500,000One-page PDFs a month9 of 98 of 95 of 93 of 9
How many of the 9 APIs in the table publish a monthly price at each volume of one-page PDFs, as of November 9, 2026.

You shouldn't need a sales call to know what your next invoice run costs. Every PDFShift plan, up to 1,000,000 credits for $999 a month, is on the pricing page.

Webhooks, async and batch PDF generation

By default, your request waits until the PDF is ready. For long documents or big runs, add a webhook URL: the API answers at once with 202 and a queued status, then POSTs the result to your webhook with a link to the file. To skip our storage, set s3_destination and the PDF goes straight to your own S3 bucket.

A batch job is just more of the same calls: one request per document, in parallel, up to 250 a minute, with a webhook to collect the results. One conversion can run for up to 15 minutes on a paid plan.

HIPAA, BAA and GDPR: PDFs generated in the EU

PDFShift is a French company, and conversions run on our servers in France. We don't keep your documents by default. A PDF is stored only when you ask for a link (filename or webhook), on AWS S3 in Paris, and it's deleted after 2 days. For GDPR, our data processing agreement is public.

For health data, set is_hipaa: true on the request and sign our BAA. With it on, filename and webhook need your own s3_destination, so the file never sits in our storage.

Frequently asked questions

Is there a free PDF generator API?

Yes. PDFShift's free plan gives you 50 credits a month with no credit card, for files up to 15 MB and conversions up to 30 seconds. For testing, add "sandbox": true to a request: the PDF gets a watermark and uses no credits, up to 10 documents a minute.

How do I automate PDF generation without writing a backend?

Use a no-code tool that can call PDFShift, such as n8n, Make or Zapier, or give an AI agent our hosted MCP server. Each one calls the same API as the code on this page.

Which browser engine renders my HTML?

Chromium. New accounts get the latest version PDFShift offers, and the X-Processor-Version header lets you pin one of the accepted versions, 116 or 142.

Can the same API make images instead of PDFs?

Yes. Separate endpoints return PNG, JPEG or WebP from the same HTML or URL.