Automating Invoices with n8n: A Step-by-Step HTML-to-PDF Guide

Stop manually generating PDF invoices. Discover how to build a fully automated document workflow using n8n and PageSnap—without managing a single server or writing complex Puppeteer scripts.

Why Use n8n + PageSnap for Documents?

n8n is powerful, but generating high-quality PDFs is the "missing link" for many users.

While n8n can handle your data logic, the built-in HTML nodes often struggle with complex layouts, headers, and professional branding. By connecting n8n to PageSnap, you get a "hands-off" document engine that handles the heavy lifting of Chrome rendering.

Automation Challenge The Manual Way The n8n + PageSnap Way
Data Source Exporting CSVs manually Connect Airtable/PostgreSQL/Stripe
PDF Rendering Basic, broken HTML tags Pixel-perfect Chrome engine
Storage Manual uploads to S3/Drive Direct S3 upload via s3_path_url
Scaling One by one Batch up to 200 PDFs per request
Reliability Scripts crashing on RAM Stable API with webhook notifications

The 3-Step Automation Workflow

1

Prepare Your Data and Template

In n8n, gather your invoice data from your source (like a "New Payment" in Stripe). You can either send raw HTML to PageSnap or use the Handlebars engine.

Pro Tip:

Save your invoice design in the PageSnap portal and simply pass the uuid and your JSON data in the templates array.

2

Configure the HTTP Request Node

To generate your PDF, add an HTTP Request node in n8n with the following settings:

  • Method: POST
  • URL: https://api.pagesnap.co/snap
  • Authentication: Basic Auth (Your PageSnap Username & API Key)
  • Body Parameters: Use the "JSON" option
3

Handle the Response or Webhook

For a single invoice, PageSnap returns the PDF URL immediately in the response.

For batch processing (e.g., end-of-month reports), provide a webhook_url. PageSnap will ping your n8n "Webhook" node as soon as the files are ready for delivery.

The Validated n8n JSON Payload

Here is exactly how to format your request within n8n to ensure it aligns with the PageSnap API:

POST https://api.pagesnap.co/snap
{
  "webhook_url": "https://your-n8n-instance.com/webhook/pdf-ready",
  "contents": {
    "templates": [
      {
        "uuid": "your-saved-invoice-uuid",
        "data": {
          "customer_name": "John Doe",
          "amount": "MYR 500.00",
          "invoice_no": "INV-2026-001"
        }
      }
    ]
  },
  "options": {
    "format": "A4",
    "display_header_footer": true,
    "footer_template": "<div style='font-size:10px; width:100%; text-align:center;'>Page <span class='pageNumber'></span> of <span class='totalPages'></span></div>",
    "margin_bottom": "2cm",
    "print_background": true
  }
}

Why Automation Users Prefer PageSnap

Credits Never Expire

Many automation workflows only run once a month. Unlike other APIs that charge a monthly fee for nothing, PageSnap credits roll over. If you don't use them this month, they are ready for the next.

Native S3 Integration

Want the PDF to go straight to your AWS bucket without passing through n8n's memory? Use the s3_path_url option for direct uploads.

50 Sandbox Requests Daily

Perfect your n8n workflow for free. Use "sandbox": true while building your automation so you don't consume credits during the "trial and error" phase.

Automation FAQ

Q: Can I generate multiple invoices in one go?

A: Yes! You can include up to 200 items in the contents array. PageSnap will process them and notify your n8n webhook when the entire batch is finished.

Q: How do I handle Arabic (RTL) or special fonts in n8n?

A: You don't have to do anything special. Because PageSnap uses a full Chrome engine, it renders RTL and web fonts automatically—something that standard n8n HTML nodes often fail to do.

Q: Is there an n8n community node?

A: You can use the standard HTTP Request node for maximum control, which works perfectly with our https://api.pagesnap.co/snap endpoint.

Automate your documents in minutes.

Stop wasting time on manual PDF exports and start building with PageSnap and n8n.

Get 60 Free Credits Per Month — No Credit Card Required