HTML to PDF API
that just works
Puppeteer leaks memory. wkhtmltopdf breaks your CSS. LightningPDF just works.
One API call. Any HTML/CSS. Pixel-perfect PDF.
Go-native engine under 100ms, Chromium for complex layouts. Free tier included.
50 free PDFs/month. No credit card required.
How It Works
Design your template
Use our visual designer or bring your own HTML/CSS. Variables make content dynamic.
Call the API with your data
One POST request with your HTML or template ID. Works with any language that speaks REST.
Receive a pixel-perfect PDF
Get your PDF in milliseconds. Download directly, store in S3, or receive via webhook.
Built for These Use Cases
Invoices & Billing
Automate invoice generation for SaaS, e-commerce, and subscription platforms. Pixel-perfect every time.
Reports & Dashboards
Turn HTML dashboards into shareable PDFs. Charts, tables, and data visualizations rendered faithfully.
Contracts & Legal Docs
Generate contracts, NDAs, and compliance documents programmatically with template variables.
Two Ways to Generate PDFs
Design templates visually or send HTML via API. Either way, you get production-ready PDFs in milliseconds.
Visual Template Designer
Design templates visually with live preview — no code required. Use variables for dynamic content and apply consistent branding with themes.
- ✓ Real-time preview as you edit
- ✓ Type-safe Go templates
- ✓ Custom themes & branding
Powerful REST API
Integrate PDF generation into any stack with a single HTTP call. Works with every language that speaks REST.
- ✓ Python, Node.js, Go, PHP, cURL
- ✓ Async jobs & batch generation
- ✓ Under 100ms for simple docs
curl -X POST https://lightningpdf.dev/api/v1/pdf/generate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"template_id": "invoice-001",
"data": {
"company": "Acme Corp",
"items": [{"name": "Service", "price": 850}]
}
}'Generate PDFs in Seconds
One API call is all it takes. Choose your language.
curl -X POST https://lightningpdf.dev/api/v1/pdf/generate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"html": "<h1>Hello World</h1><p>My first PDF</p>",
"options": { "format": "A4" }
}'import requests
resp = requests.post(
"https://lightningpdf.dev/api/v1/pdf/generate",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"html": "<h1>Hello World</h1>",
"options": {"format": "A4"}
}
)
pdf_data = resp.json()["data"]["pdf"]const resp = await fetch(
"https://lightningpdf.dev/api/v1/pdf/generate",
{
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
html: "<h1>Hello World</h1>",
options: { format: "A4" }
})
}
);
const { data } = await resp.json();body := `{"html":"<h1>Hello</h1>","options":{"format":"A4"}}`
req, _ := http.NewRequest("POST",
"https://lightningpdf.dev/api/v1/pdf/generate",
strings.NewReader(body))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)How We Compare
See why developers choose LightningPDF.
| Feature | LightningPDF | CraftMyPDF | PDFShift |
|---|---|---|---|
| HTML + CSS to PDF | ✓ | ✓ | ✓ |
| Visual template designer | ✓ | ✓ | ✗ |
| Free tier included | ✓ | ✓ | ✓ |
| Tailwind CSS built-in | ✓ | ✗ | ✗ |
| Markdown support | ✓ | ✗ | ✗ |
| Async job queue | ✓ | ✗ | ✗ |
| Batch generation API | ✓ | ✗ | ✗ |
| Webhook notifications | ✓ | ✗ | ✓ |
Simple Pricing
Start free. Scale as you grow.