PDF Generation Overview
APITemplate.io gives you four ways to generate PDFs:
- From reusable templates — design an HTML or visual template, then pass JSON data to produce PDFs on demand via the
/v2/create-pdfendpoint - From raw HTML — send HTML content directly through the
/v2/create-pdf-from-htmlendpoint and get a PDF back - From a URL — point the
/v2/create-pdf-from-urlendpoint at any web page and convert it to a PDF - From Markdown — send Markdown content through the
/v2/create-pdf-from-markdownendpoint and receive a styled PDF, powered by the marked library
All four methods support custom headers, footers, page numbers, margins, paper sizes, and CSS/JavaScript rendering. For a deep dive with full API references and code examples in cURL, C#, and Python, see 4 Ways to Generate a PDF.
Why use an API for PDF generation?
Generating PDFs in-house typically means managing headless browsers, rendering engines, and scaling infrastructure yourself. APITemplate.io handles all of that so you can focus on your application:
- No infrastructure to manage — no Chromium processes, no memory tuning, no browser updates
- Consistent output — the same Chromium-based rendering engine every time
- Scales automatically — from one PDF to thousands per hour
- Multiple language SDKs — official libraries for C#, Python, JavaScript, PHP, and Java
The template workflow
Most users follow this pattern:
- Create a template in the web console (HTML editor or visual editor)
- Add dynamic variables using the Jinja2 template language
- Call the API with JSON data to populate the template
- Receive a download URL for the generated PDF
Choosing an editor
| Feature | HTML Editor | Visual (WYSIWYG) Editor |
|---|---|---|
| Control over layout | Full (HTML + CSS) | Drag-and-drop |
| Template language | Jinja2 with HTML | Jinja2 with rich text |
| Custom CSS/JS | Yes | Limited |
| Learning curve | Moderate | Low |
| Best for | Complex layouts, developers | Simple documents, non-technical users |
Not sure which one to pick? See HTML vs Visual Editor for a detailed comparison.
What you can generate
- Invoices and receipts
- Reports and certificates
- Shipping labels and packing slips
- Contracts and agreements
- Any document with a consistent layout and variable data
Related pages
- 4 Ways to Generate a PDF — API references, code examples, and settings for all four methods
- Code/HTML Template Editor
- Visual Template Editor
- Headers and Footers
- Advanced PDF Topics
- Markdown to PDF blog post — in-depth guide for Markdown workflows
- Template Language
- REST API — endpoints, authentication, and SDKs