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

  • The Wheelchair Football Association
  • Askreferral.io
  • Ukart.io
  • simplehuman
  • Elation Factory
  • Factored Quality
  • iCulture.nl
  • @kwfricke
  • Oxford Scholastica Academy
  • Fin Match

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-html with your HTML and optional data. Best when your app already builds the HTML.
  • From a URL: POST /v2/create-pdf-from-url with 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.

APITemplate.io's visual template editor, with a drag-and-drop invoice layout on the canvas and its field palette alongside

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.

The HTML template editor showing markup and CSS on the left and the rendered PDF page preview on the right

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.

A Postman request to the create-pdf-from-url endpoint, with the target URL and page settings in the JSON body

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": "..."}

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-after and page-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 @page rules. 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_background is set to 1.

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.

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();

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 integrations

Native 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.

PlanPDFs a monthPrice a monthPer 1,000 PDFs
Free50Free—
PDF Basic3,000$19 billed yearly, $24 monthly$6.33 to $8.00
PDF Standard12,000$69 billed yearly, $89 monthly$5.75 to $7.42
PDF Enterprise25,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?

It turns HTML into a PDF file automatically. You send the HTML code or a link to a web page, and a finished PDF comes back. Invoices, receipts, reports and tickets are common uses, since making each of those by hand gets tedious fast.

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.

Sign up now for free!

Start generating PDFs and images from reusable templates today. No credit card, no commitment.