HTML to PDF API for Developers and Automation Teams
Design an HTML template once, then send JSON data to the REST API to generate high-quality PDFs for invoices, reports and business documents. Raw HTML and web page URLs convert through the same API.
- Automatically Generate PDF documents and images.
- Generate beautiful PDF documents from HTML with our cloud-based PDF generation API.
- Integration with Zapier, Make.com, N8n, or REST API.
- We've generated over millions of PDFs and images.
Get started for FREE, upgrade as you grow
Trusted by Companies, Developers and Builders
Generate Professional PDF Documents in seconds
Powerful PDF Generation API
Powerful API and template engine for PDF documents.
Dynamic Reusable Templates
Build repeatable document workflows with reusable templates.
Visual Editor for WYSIWYG
Convert editor content to PDF without HTML knowledge.
Convert HTML to PDF
Convert HTML to PDF with production-ready rendering.
Custom CSS & JS
Support custom CSS and Javascript for advanced control.
No-Code and REST API Integrations
Works with Zapier, Make, n8n, Airtable, UiPath, and more.
Fast Preview & JSON
Fast HTML preview and custom JSON data for testing.
Support Headers & Footers
Support headers, footers, page numbers, and total pages.
Render modern HTML and CSS into PDFs
Write the layout once as an HTML template, with variables, loops and conditions in Jinja2 syntax, and send JSON data with each API call. One template turns every order into an invoice and every attendee into a certificate.
Each PDF renders in Chromium, so modern CSS, web fonts and JavaScript charts come out the way they look in the browser.

One Platform, Three Ways to Generate PDFs
From visual template editing to seamless HTML-to-PDF conversion, create stunning, fully-customized PDFs tailored to your business needs—all without coding expertise. Perfect for invoices, reports, and more.
- From a template:
POST /v2/create-pdf?template_id=…with your JSON data. Best for invoices, reports and certificates you produce again and again. - From raw HTML:
POST /v2/create-pdf-from-htmlwith your HTML and optional data. Best when your app already builds the HTML. - From a URL:
POST /v2/create-pdf-from-urlwith any public web page. Best for archiving pages and turning dashboards into reports.
Content already in Markdown? The Markdown to PDF API takes it as it is.
Create PDF Templates with Visual Editor
Create stunning PDFs using our WYSIWYG Template Editor. With its user-friendly interface, you can design templates visually — no coding required.
Combine your designs with JSON data to generate dynamic, fully-customized PDFs tailored to your needs. Perfect for invoices, reports, certificates, and more.

Convert HTML to PDF
Convert HTML to PDF using APITemplate.io’s powerful HTML Template Editor. Combine your HTML, CSS, and JavaScript skills with dynamic JSON data to create custom templates that deliver pixel-perfect PDFs.
Our PDF generation solution supports modern web technologies, enabling seamless integration for your automated workflows, reports, and more.

Creating PDF from URL or HTML Content
APITemplate.io simplifies the process of generating professional PDFs directly from URLs or custom HTML content.
Whether you need to transform web pages, reports, invoices, or dynamic data into downloadable PDFs, APITemplate.io delivers seamless and scalable solutions through HTML to PDF templates.

HTML to PDF API Code Examples
Each example sends the same request to POST /v2/create-pdf-from-html, with your API key in the X-API-KEY header. The {{name}} and {{total}} placeholders are filled from data, so the HTML works as a template too. The response is JSON with a download_url for the finished PDF.
curl -X POST "https://rest.apitemplate.io/v2/create-pdf-from-html" \
--header "Content-Type: application/json" \
--header "X-API-KEY: YOUR_API_KEY" \
--data '{
"body": "<h1>Invoice for {{name}}</h1><p>Total: {{total}}</p>",
"data": {"name": "Acme Corp", "total": "$250.00"},
"settings": {"paper_size": "A4", "print_background": "1"}
}'
# {"status": "success", "download_url": "https://...", "transaction_ref": "..."}const res = await fetch("https://rest.apitemplate.io/v2/create-pdf-from-html", {
method: "POST",
headers: { "Content-Type": "application/json", "X-API-KEY": "YOUR_API_KEY" },
body: JSON.stringify({
body: "<h1>Invoice for {{name}}</h1><p>Total: {{total}}</p>",
data: { name: "Acme Corp", total: "$250.00" },
settings: { paper_size: "A4", print_background: "1" },
}),
});
const { download_url } = await res.json();import requests
res = requests.post(
"https://rest.apitemplate.io/v2/create-pdf-from-html",
headers={"X-API-KEY": "YOUR_API_KEY"},
json={
"body": "<h1>Invoice for {{name}}</h1><p>Total: {{total}}</p>",
"data": {"name": "Acme Corp", "total": "$250.00"},
"settings": {"paper_size": "A4", "print_background": "1"},
},
)
download_url = res.json()["download_url"]<?php
$ch = curl_init('https://rest.apitemplate.io/v2/create-pdf-from-html');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Content-Type: application/json', 'X-API-KEY: YOUR_API_KEY'],
CURLOPT_POSTFIELDS => json_encode([
'body' => '<h1>Invoice for {{name}}</h1><p>Total: {{total}}</p>',
'data' => ['name' => 'Acme Corp', 'total' => '$250.00'],
'settings' => ['paper_size' => 'A4', 'print_background' => '1'],
]),
]);
$downloadUrl = json_decode(curl_exec($ch), true)['download_url'];using System.Net.Http.Json;
using System.Text;
using System.Text.Json;
using var http = new HttpClient();
http.DefaultRequestHeaders.Add("X-API-KEY", "YOUR_API_KEY");
var payload = JsonSerializer.Serialize(new
{
body = "<h1>Invoice for {{name}}</h1><p>Total: {{total}}</p>",
data = new { name = "Acme Corp", total = "$250.00" },
settings = new { paper_size = "A4", print_background = "1" },
});
var res = await http.PostAsync("https://rest.apitemplate.io/v2/create-pdf-from-html",
new StringContent(payload, Encoding.UTF8, "application/json"));
var json = await res.Content.ReadFromJsonAsync<JsonElement>();
var downloadUrl = json.GetProperty("download_url").GetString();Saved your layout as a template in the editor? Send only the JSON data to /v2/create-pdf?template_id=…. For a web page, send its address as url to /v2/create-pdf-from-url. The API reference lists every parameter, and 4 ways to generate a PDF compares the endpoints.
Rendering Engine and Supported CSS
Every PDF renders in headless Chromium, the engine inside Google Chrome, so flexbox, grid, web fonts and JavaScript work as they do in the browser. Version 153 is the current engine, and version 97 stays available for older templates.
- Page breaks:
page-break-before,page-break-afterandpage-break-inside: avoid, with table headers that repeat on every page. See advanced PDF topics. - Headers and footers with the page number, total pages, date, title and URL. See headers and footers.
- Page size and margins for the whole document, or per page with CSS
@pagerules. See custom page size and margin. - Fonts: load any web font with
@font-face, including colour emoji fonts. - JavaScript charts from libraries such as Chart.js, ApexCharts and D3 render before the page is printed. See embedding charts.
- Backgrounds: colours and images print when
print_backgroundis set to1.
Generate PDFs in Four Simple Steps
Design once, automate forever. Create beautiful PDFs at scale with a single API call.
Sign Up Free
Create your free account in seconds. No credit card required — includes 50 PDFs/month.
Design a Template
Use our visual editor or write HTML to build a reusable PDF template with dynamic variables.
Send Data via API
Call our REST API with JSON to populate your template and generate a PDF on the fly.
Download & Share
Get a download URL or integrate with Zapier, Make, and n8n for automated workflows.
Built for Real PDF Generation Workflows
Create PDFs from Reusable Templates, HTML, or URLs
Generate professional PDFs from reusable templates, raw HTML, or live web pages. Build polished documents quickly with a flexible PDF API designed for automation at scale.
No-Code Automation & Integrations
Connect your PDF workflows with Zapier, Make, n8n, and our REST API. Automate document generation without complex setup or manual work.
4 Regional API Endpoints
Improve performance and support data residency requirements with regional processing and storage. Available regions include the US, EU, Singapore, and Australia.
Synchronous or Asynchronous Generation
Process multiple PDF generation requests at once with synchronous or asynchronous workflows. Use webhooks to get notified automatically when async jobs are complete.
Custom CSS and JavaScript Support
Fully control the design, layout, and behavior of your PDFs with custom CSS and JavaScript. Create documents that match your branding and workflow requirements.
Advanced PDF Generation Controls
Go beyond basic PDF creation with support for headers, footers, page numbers, custom styling, JavaScript rendering, and quality optimization options.
Real-Time Side-by-Side Preview
Edit and preview your templates in real time with an interactive side-by-side editor. Build faster with instant feedback for HTML, CSS, and JavaScript changes.
30+ Million PDFs and Images Generated
Trusted by businesses worldwide to generate millions of PDFs and images reliably. Scale document and image automation with confidence.
Automation and Integrations
Automate PDFs and images from Zapier, Make.com or n8n — or call the REST API from Python, C#, Java, PHP and UiPath.
curl -X POST \
"https://rest.apitemplate.io/v2/create-pdf?template_id=6b277b234d395eca" \
--header "Content-Type: application/json" \
--header "X-API-KEY: YOUR_API_KEY" \
--data '{"invoice_no": "INV38379", "total_amount": 82542.56}'
# {"status": "success", "download_url": "https://pdf.apitemplate.io/..."}const url =
"https://rest.apitemplate.io/v2/create-pdf?template_id=6b277b234d395eca";
const res = await fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-KEY": "YOUR_API_KEY",
},
body: JSON.stringify({ invoice_no: "INV38379", total_amount: 82542.56 }),
});
const { download_url } = await res.json();import requests
res = requests.post(
"https://rest.apitemplate.io/v2/create-pdf",
params={"template_id": "6b277b234d395eca"},
headers={"X-API-KEY": "YOUR_API_KEY"},
json={"invoice_no": "INV38379", "total_amount": 82542.56},
)
download_url = res.json()["download_url"]var url = "https://rest.apitemplate.io/v2/create-pdf"
+ "?template_id=6b277b234d395eca";
var json = "{\"invoice_no\": \"INV38379\", \"total_amount\": 82542.56}";
var request = HttpRequest.newBuilder().uri(URI.create(url))
.header("Content-Type", "application/json")
.header("X-API-KEY", "YOUR_API_KEY")
.POST(HttpRequest.BodyPublishers.ofString(json))
.build();
var res = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());Automate PDF and image generation with no-code platforms or the REST API
One reusable template, one JSON payload. Send data from a Zapier zap, a Make.com scenario, an n8n workflow or your own backend — every integration calls the same endpoint and returns a ready-to-share file URL.
Generate synchronously for on-screen downloads or asynchronously with webhooks for batches, and keep processing and storage in your chosen region: US, EU, Singapore or Australia.
Browse all integrationsNative integrations for the tools your team already runs, plus a REST API for everything else.
Operational Metrics for Enterprise PDF Document Automation
APITemplate.io gives technical teams clear signals on performance, reliability, infrastructure, and support for production document workflows.
~2s
Fast rendering
Typical PDFs and images render in around 2 seconds for common workflows.
99.99%
Uptime target
Built for stable document generation across scheduled and customer-facing workflows.
30M+
Files generated
Demonstrates platform maturity and real-world usage across production workloads.
24/7
Support coverage
Responsive help for onboarding, production issues, and higher-volume workflows.
Need higher limits, SLA support, or a tailored setup?
Talk to us about volume pricing, regional deployment, and support for large-scale document automation.
Free Tier and Pricing
The free plan includes 50 PDFs a month, 3 templates and the REST API, with no credit card. Paid PDF plans add volume, more templates, CDN storage and async generation with webhooks.
| Plan | PDFs a month | Price a month | Per 1,000 PDFs |
|---|---|---|---|
| Free | 50 | Free | — |
| PDF Basic | 3,000 | $19 billed yearly, $24 monthly | $6.33 to $8.00 |
| PDF Standard | 12,000 | $69 billed yearly, $89 monthly | $5.75 to $7.42 |
| PDF Enterprise | 25,000 | $139 billed yearly, $179 monthly | $5.56 to $7.16 |
Prices are in US dollars. See pricing for every plan, including the Image + PDF plans and pay-as-you-go for enterprise.
Frequently Asked Questions
What does an HTML to PDF API do?
Will the PDF look like my web page?
Pretty much, yes. The API supports your own CSS and JavaScript, so your fonts, colours and layout should carry over to the PDF. It’s still worth checking the live preview before you use the file. You’ll catch layout problems early, not after the document has already gone out.
Does it handle live web pages as well as HTML code?
It handles both. You can send raw HTML, or give it the URL of a web page and get a PDF of that page. For documents you produce regularly, save a template and send fresh data each time. That beats rebuilding the whole file.
Are headers, footers and page numbers supported?
Yes. You can add a header and footer to every page, plus page numbers and the total page count. They matter most in longer documents like reports and contracts, where a consistent top and bottom make all the pages feel like one document.
Is there a free HTML to PDF API plan?
Open a free account, no credit card required. The free plan gives you 50 PDFs per month, which is enough room to test the API with your own HTML. For development, you can use it with Python, Node.js, Java, PHP or C#. Prefer no-code? It also connects with Zapier, Make.com and n8n.
Which rendering engine does the HTML to PDF API use?
Chromium, the engine inside Google Chrome. Modern CSS such as flexbox and grid, web fonts and JavaScript all work, and you control page breaks, headers and footers with CSS and the page settings. Version 153 is the current engine; version 97 is kept for older templates.
How do I get the PDF back from the API?
The API answers with JSON that includes a download_url for the PDF. Add export_type=file to the request to get the PDF file itself in the response instead. On paid plans you can also set async=1 with a webhook_url, and the API calls your URL when a large document is ready. The API reference has the details.
Customer Reviews
Trusted by businesses worldwide to generate millions of PDFs and images reliably. See what our customers have to say.
Jamie DearFounderWe are very grateful to Jacky and the team at APITemplate - their software has helped us to auto-generate high quality images for our student reports. It has been the perfect fit for us as we grow our Oxford summer school.
Alex DowdingVice SecretaryThe Wheelchair Football Association
We've successfully automated YouTube thumbnails and match event creation for our Powerchair Football league using your templates. It integrates with our Postgres database on retool.com, is expanding to include league table graphics and match results. Thanks to an AWS Inclusion and Diversity grant, we're enhancing our live-streaming workflow, further boosted by your product's automation capabilities. We're grateful for your excellent service and wanted to share our positive experience.
Nishitha DhanekulaCofounder /CTOAt askreferral.io, We are building referral networking platform for people to pitch and generate leads for different kinds of referrals, including, but not limited to job referrals, product referrals, funding referrals, realtor referrals etc. Having a vibrant social media community is crucial for our growth and APITemplate.io played crucial role in automating generation of digital posters for job postings, profile pitches, funding requests etc, to help us grow from 0 to 200K+ followers in LinkedIn in less than one year.
Danaé NicolasCTOWe've been using APITemplate.io to generate social images for our karting races and it's been a huge time-saver. The support team is super responsive and helpful - they quickly resolved an issue we encountered. We highly recommend this tool to anyone who needs a similar solution.
Ryan TurnbullIT ManagerAPITemplate.io is such an easy application to use. Simple, intuititive, and code free. At simplehuman, we render all our commercial invoices, dispatch notes, and multiple other templates. The ability to create multiple layouts, and group them into a logical container - makes our lives much simpler. This is a great tool to use, both affordable, and the support service turnaround time is second to none! Defintely worth the subscription!
Ron P.Product ManagerHad an issue with template implementation via Make and reached out for support. Within minutes, I got a response and was soon on a Zoom call resolving it. Despite the issue not being directly related to APITemplate.io, their team efficiently guided me to the right formatting. Many thanks!
Nicholas GertzProduct OwnerWe have been using the service daily in our application for a year and are very satisfied with the reliability. It meets all our requirements and requests for changes/improvements can be discussed directly with Jacky 1:1. Thanks and greetings from Germany
Lucas FridmanChief Product OfficerWe use APITemplate to generate key documentation we need to work with our industry partners. We are building a digital solution in an antiquated industry, which means we need to communicate data to our partners in the format that they are accustomed to (pdf forms). APITempate makes it easy for us to do this!
Jean-Paul HornPublisherWe love APITemplate.io for its simplicity and ease of use. Just setup once and "forget" about it due to its fabulous 3rd party integration. New features are regularly added, and reasonable custom requests are honoured within days.
Kevin FrickēAPITemplate.io is one of the best services I have worked with in a very, very long time. They are super responsive and a joy to work with. If you are struggling with PDF's, like I was, check 'em out!
Jacob MonashAutomation SpecialistWe run conferences with a number of speakers, each requiring an individual speaker profile. We used to create all of these profiles manually, but by incorporating APItemplate into our Zapier workflow, our team can generate a complete image with all of the speakers information in one click. Using the template editor is a bit of a learning curve, but the support team is very responsive and helpful.
George CooperAPITemplate.io is great. I love being able to quickly use HTML and CSS templates with dynamic variables to create documents. Support is also fast and responsive. Great vendor!
Sign up now for free!
Start generating PDFs and images from reusable templates today. No credit card, no commitment.