4x approaches to generating PDFs in n8n workflows

Hey all, I recently released this video on 4x approaches to generating PDFs in n8n. Thought it might be useful for people!

A brief overview of the 4x approaches covered (and my personal thoughts on best use cases):

Approach #1 Google Doc template

Use a Google Doc template stored in Google Drive as a template. Add [placeholder_values] and then make a copy of the doc in your workflow. Update the copy of the Doc and use find and replace to swap the [placeholder_values] with your own data.

Pros

  • Free
  • Easy to use (most people familiar with Google Docs)

Cons

  • Very hard to get arrays of varying lengths working (EG invoices with an unknown number of line items)
  • Limited styling options

Best for: Relatively straightforward, plain-text docs like contracts or other legal documents.

Approach #2 Self-host PDF generation with Puppeteer or Gotenberg

Convert a HTML template to a PDF using Puppeteer or Gotenberg.

Pros

  • Free and you can self-host
  • Flexible styling (as you’re working with HTML/CSS)

Cons

  • Not possible (to my knowledge?) on the cloud version of n8n
  • There’s a bit of work in getting the infra setup and maintaining it

Best for: More technically-minded people who are self-hosting and want complete control over their PDF generation.

Approach #3 Document template tool

Use a third-party service that allows you to build reusable document templates and handles the PDF generation for you.

Pros

  • Easy to build great-looking reusable templates
  • No need to worry about your own PDF generation infra

Cons

  • Will typically require a paid plan
  • You’re trusting the service with your data (although in my experience most typically only store the template HTML and no actual personal information)

Best for: People who want to 1) be able to easily build and manage reusable templates and 2) out-source the PDF generation and don’t mind paying for it.

I demo DocuPotion in the video (disclaimer: I’m the founder), but there are other similar tools out there like CraftMyPDF, PDFMonkey and Documentero.

Approach #4 HTML to PDF API

Pretty similar to approach #3 - main differences is you typically provide raw HTML rather than building a template with a template builder.

Pros

  • Relatively easy to build great-looking reusable templates if you’re comfortable with HTML
  • No need to worry about your own PDF generation infra

Cons

  • Will typically require a paid plan (although often cheaper than template management tools)

Best for: People who are comfortable building / maintaining their own HTML templates and don’t mind paying for the service.

Hopefully people find it useful. Any questions let me know :slight_smile:
Alex

3 Likes