Skip to main content

PDF Generation Overview

APITemplate.io gives you three ways to generate PDFs:

  1. From reusable templates — design an HTML or visual template, then pass JSON data to produce PDFs on demand
  2. From raw HTML — send HTML content directly through the API and get a PDF back
  3. 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:

  1. Create a template in the web console (HTML editor or visual editor)
  2. Add dynamic variables using the Jinja2 template language
  3. Call the API with JSON data to populate the template
  4. Receive a download URL for the generated PDF

Choosing an editor

FeatureHTML EditorVisual (WYSIWYG) Editor
Control over layoutFull (HTML + CSS)Drag-and-drop
Template languageJinja2 with HTMLJinja2 with rich text
Custom CSS/JSYesLimited
Learning curveModerateLow
Best forComplex layouts, developersSimple 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