Skip to main content

PDF Generation Overview

APITemplate.io gives you four ways to generate PDFs:

  1. From reusable templates — design an HTML or visual template, then pass JSON data to produce PDFs on demand via the /v2/create-pdf endpoint
  2. From raw HTML — send HTML content directly through the /v2/create-pdf-from-html endpoint and get a PDF back
  3. From a URL — point the /v2/create-pdf-from-url endpoint at any web page and convert it to a PDF
  4. From Markdown — send Markdown content through the /v2/create-pdf-from-markdown endpoint 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:

  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