Compare HTML-to-PDF APIs side-by-side. Convert HTML, URLs, and Markdown to PDF via a simple HTTP request. Rendering engines, free tiers, and pricing compared.
PDF generation APIs replace running headless browsers or PDF libraries on your own infrastructure. Here are the most common use cases:
Feature matrix across all 8 HTML-to-PDF APIs. Scroll horizontally on mobile.
| Provider | Free Tier | Engine | Headers/Footers | JS Rendering | Signup | Starting Price |
|---|---|---|---|---|---|---|
| PDFShift | 50 credits/mo Free | Chromium | Yes | Yes | Required | $9/mo |
| DocRaptor | 5 docs/mo Freemium | Prince XML | Yes | Yes | Test key available | $15/mo |
| Browserless | 1,000 units/mo Free | Chrome / Firefox / WebKit | Yes | Yes | Required (no CC) | $25/mo |
| Api2Pdf | 1 month free Trial | Chrome or wkhtmltopdf | Yes | Chrome mode | Required | $1/mo min |
| CloudConvert | 10/day Free | Multiple | Limited | Varies | Required | $8 one-time |
| PDFMonkey | 20 docs/mo Limited | Chrome | Yes | Paid only | Required (no CC) | €5/mo |
| wkhtmltopdf | Unlimited Open Source | Qt WebKit | Yes | Poor | None (self-hosted) | Free forever |
| Frostbyte Best Value | 200 credits Free | Playwright/Chromium | Yes | Yes | API key (no CC) | $1 / 500 credits |
Detailed analysis of each PDF generation API with strengths, weaknesses, and ideal use cases.
Real code snippets for generating PDFs with popular providers. Copy and paste to get started.
curl -X POST 'https://api.pdfshift.io/v3/convert/pdf' \
-u 'api:YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"source": "<h1>Hello World</h1><p>Generated with PDFShift</p>"}' \
-o output.pdfconst resp = await fetch('https://api.pdfshift.io/v3/convert/pdf', {
method: 'POST',
headers: {
'Authorization': 'Basic ' + btoa('api:YOUR_API_KEY'),
'Content-Type': 'application/json'
},
body: JSON.stringify({
source: '<h1>Hello World</h1><p>Generated with PDFShift</p>'
})
});
const pdf = await resp.arrayBuffer();
// Save or send the PDF binaryimport requests
response = requests.post(
'https://api.pdfshift.io/v3/convert/pdf',
auth=('api', 'YOUR_API_KEY'),
json={'source': '<h1>Hello World</h1><p>Generated with PDFShift</p>'}
)
with open('output.pdf', 'wb') as f:
f.write(response.content)curl -X POST 'https://v2.api2pdf.com/chrome/pdf/html' \
-H 'Authorization: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"html": "<h1>Invoice #1234</h1><p>Total: $99.00</p>"}'const resp = await fetch('https://v2.api2pdf.com/chrome/pdf/html', {
method: 'POST',
headers: {
'Authorization': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
html: '<h1>Invoice #1234</h1><p>Total: $99.00</p>'
})
});
const { FileUrl } = await resp.json();
console.log('PDF URL:', FileUrl); // Available for 24 hoursimport requests
response = requests.post(
'https://v2.api2pdf.com/chrome/pdf/html',
headers={'Authorization': 'YOUR_API_KEY'},
json={'html': '<h1>Invoice #1234</h1><p>Total: $99.00</p>'}
)
print('PDF URL:', response.json()['FileUrl'])curl -X POST 'https://agent-gateway-kappa.vercel.app/v1/agent-pdfgen/api/pdf/from-html' \
-H 'Authorization: Bearer YOUR_KEY' \
-H 'Content-Type: application/json' \
-d '{"html": "<h1>Invoice #1234</h1><p>Total: $99.00</p>", "format": "A4"}' \
-o invoice.pdfconst resp = await fetch('https://agent-gateway-kappa.vercel.app/v1/agent-pdfgen/api/pdf/from-html', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
html: '<h1>Invoice #1234</h1><p>Total: $99.00</p>',
format: 'A4'
})
});
const pdf = await resp.arrayBuffer();
// pdf is the raw PDF binaryimport requests
response = requests.post(
'https://agent-gateway-kappa.vercel.app/v1/agent-pdfgen/api/pdf/from-html',
headers={'Authorization': 'Bearer YOUR_KEY'},
json={
'html': '<h1>Invoice #1234</h1><p>Total: $99.00</p>',
'format': 'A4'
}
)
with open('invoice.pdf', 'wb') as f:
f.write(response.content)curl -X POST 'https://agent-gateway-kappa.vercel.app/v1/agent-pdfgen/api/pdf/from-markdown' \
-H 'Authorization: Bearer YOUR_KEY' \
-H 'Content-Type: application/json' \
-d '{"markdown": "# Monthly Report\n\n## Summary\n\n- Revenue: $12,340\n- Users: 1,523\n- Uptime: 99.97%", "theme": "github"}' \
-o report.pdfGenerate a PDF from HTML right in your browser using Frostbyte's API. No signup required for the demo.
What does it actually cost to generate 1,000 PDFs per month?
Pick the right tool based on your specific requirements.
Use PDFMonkey if you need a visual template editor with Liquid variables, or Frostbyte for quick invoice/report templates via API without a dashboard.
Use DocRaptor. Its Prince XML engine is the gold standard for CSS Paged Media, page breaks, footnotes, and print typography. Worth the premium for contracts and legal docs.
Use Browserless (1,000 units/month) or PDFShift (50 credits/month). Browserless is more generous but is a full browser platform. PDFShift is simpler, PDF-focused.
Use Api2Pdf. At $0.001/MB + $0.0002/second, it is by far the cheapest for high-volume PDF generation. No rate limits. Frostbyte is also competitive at $1/500 credits.
Use Frostbyte for an API key with no email signup, or wkhtmltopdf (self-hosted, deprecated) for zero external dependencies.
Use CloudConvert if you need Word/Excel/PowerPoint to PDF alongside HTML-to-PDF. 200+ format pairs under one API. Or Api2Pdf for Office-to-PDF via LibreOffice.