PDF Generation Overview
APITemplate.io gives you three ways to generate PDFs:
- From reusable templates — design an HTML or visual template, then pass JSON data to produce PDFs on demand
- From raw HTML — send HTML content directly through the API and get a PDF back
- From a URL — point the API at any web page and convert it to a PDF
All three methods support custom headers, footers, page numbers, margins, paper sizes, and CSS/JavaScript.
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