Skip to main content

n8n Integration

PDF Gen Studio provides an official n8n community node that allows you to generate PDFs and images directly within your n8n workflows.

Features

  • Template Renderer: Render saved templates with dynamic data injection
  • JSON Renderer: Render raw JSON design documents to PDF/PNG/JPG/HTML
  • HTML Renderer: Convert HTML content to PDF or images

Installation

In n8n Desktop/Self-hosted

  1. Go to Settings > Community Nodes
  2. Select Install
  3. Enter n8n-nodes-pdfgenstudio and click Install

Using npm

npm install n8n-nodes-pdfgenstudio

Credentials Setup

To use this node, you need a PDF Gen Studio API key:

  1. Sign up at PDF Gen Studio
  2. Go to your Dashboard > API Keys
  3. Create a new API key
  4. In n8n, create new credentials for "PDF Gen Studio API"
  5. Enter your API key and base URL

Credential Properties

PropertyDescription
API KeyYour PDF Gen Studio API key
Base URLAPI base URL (default: https://api.pdfgenstudio.com)

Node Operations

Template Renderer

Render saved templates with dynamic data.

Parameters:

ParameterDescription
TemplateSelect from your saved templates or enter ID directly
Dynamic DataJSON data to inject into template placeholders
Output FormatPDF, PNG, or JPG
Response TypeBinary (file) or Base64 (encoded string)

Options:

  • Text Overflow: How to handle text exceeding boundaries (truncate, wrap, scale, none)
  • Table Pagination: Auto-paginate tables exceeding page height
  • Table Header on New Page: Repeat headers on new pages
  • Pixel Ratio: Image quality multiplier (1-4)
  • Quality: JPG quality (0.1-1)
  • Page Index: Render specific page only

JSON Renderer

Render raw JSON design documents.

Parameters:

ParameterDescription
JSON DocumentThe JSON design document structure
Output FormatPDF, PNG, JPG, or HTML
Response TypeBinary, Base64, or Preview (HTML only)
Validate OnlyOnly validate without rendering

Options:

  • Scale, Quality, Print Background
  • Header/Footer templates
  • Timeout, Full Page, Omit Background, Raw output

HTML Renderer

Convert HTML content to PDF or images.

Parameters:

ParameterDescription
HTML ContentComplete HTML document
Output FormatPDF, PNG, or JPG
Response TypeBinary or Base64

PDF Options:

  • Page Format: A4, A3, A5, Letter, Legal, Tabloid
  • Orientation: Portrait or Landscape
  • Margins, Scale, Print Background
  • Header/Footer templates, Page Ranges
  • Custom Width/Height, Timeout

Image Options:

  • Quality (1-100)
  • Full Page, Omit Background, Timeout

Example Workflows

Generate Invoice PDF from Template

  1. Trigger: Webhook or Schedule
  2. Set Node: Prepare invoice data
  3. PDF Gen Studio: Template Renderer
    • Select invoice template
    • Pass dynamic data with customer info, items, totals

Convert HTML Report to PDF

  1. HTTP Request: Fetch HTML report
  2. PDF Gen Studio: HTML Renderer
    • Pass HTML content
    • Set format to PDF
    • Configure page options

Generate Document from JSON

  1. Function: Build JSON document structure
  2. PDF Gen Studio: JSON Renderer
    • Pass document JSON
    • Choose output format

API Endpoints Used

This node connects to the following PDF Gen Studio API endpoints:

EndpointMethodDescription
/api/v1/templatesGETList all templates
/api/v1/templates/:idGETGet template by ID
/api/v1/renderer/templates/:idPOSTRender template
/api/v1/renderer/jsonPOSTRender JSON document
/api/v1/renderer/htmlPOSTRender HTML

All render endpoints support query parameters for options (e.g., ?format=pdf&response=binary).

Support