How to Automate PDF Generation with n8n and APITemplate

Want to automate PDF generation with n8n? In this tutorial, I’ll show you how to create a PDF template in APITemplate, connect it to n8n, send dynamic JSON data, and generate a PDF automatically. In this video, you’ll learn how to: Create your first PDF template in APITemplate

  • Add HTML, CSS, and sample JSON data

  • Use dynamic variables and loops in your template

  • Find your Template ID

  • Set up an n8n workflow with Manual Trigger

  • Send data using the HTTP Request node

  • Authenticate with your API key

  • Generate a PDF and get the PDF URL back

This is a simple way to automate invoices, reports, and other documents using n8n and APITemplate.

Get started with APITemplate: https://apitemplate.io/

Docs: What is APITemplate.io? | APITemplate.io Docs

1 Like

nice tutorial. been using apiTemplate for invoice generation in a couple projects, the dynamic vars + loops handle tables well. one thing i ran into — if the source data has scanned pages mixed in, is there a fallback for that or does it only work cleanly with structured json?

Thanks, really appreciate that.

Yes, APITemplate works best when you have structured JSON, since the template is designed to map dynamic fields, loops, and variables directly into the PDF.

If your source PDF has scanned pages mixed in, that usually means the data first needs to be extracted into structured JSON before APITemplate can generate a clean output. In that case, the fallback would be to run it through OCR or a document parsing step first, then pass the extracted data into APITemplate.

So in short:

  • structured JSON = works cleanly

  • scanned documents = usually needs OCR / extraction first

APITemplate itself is focused on generating the PDF, rather than reading data back out of scanned PDFs.

Do you mean, you want some PDF pages inserted amongst freshly generated ones to compile a document?