sotoros-gotenberg

n8n custom node for Gotenberg integration with binary data support

Package Information

Downloads: 0 weekly / 0 monthly
Latest Version: 1.0.14
Author: Danila Fokin

Documentation

n8n-nodes-sotoros-gotenberg

Custom n8n node for integrating with Gotenberg API to convert documents to PDF.

Features

  • Convert Office documents (Word, Excel, PowerPoint) to PDF
  • Convert HTML to PDF
  • Convert Markdown to PDF
  • Convert URLs to PDF
  • Merge multiple PDF files
  • Support for single binary files and arrays of binary files
  • Automatic processing of all binary properties from previous nodes
  • Configurable conversion options (landscape, page ranges, scale, etc.)

Installation

  1. Clone this repository or copy the files to your n8n custom nodes directory
  2. Install dependencies:
    npm install
    
  3. Build the project:
    npm run build
    
  4. Copy the dist folder to your n8n custom nodes directory, or install it as a package

Configuration

Gotenberg URL

The base URL of your Gotenberg server (default: http://localhost:3000)

Operation

Select the type of conversion:

  • Convert Office Documents: Convert Word, Excel, PowerPoint files to PDF
  • Convert HTML: Convert HTML content to PDF
  • Convert Markdown: Convert Markdown content to PDF
  • Convert URL: Convert a web page URL to PDF
  • Merge PDFs: Merge multiple PDF files into one

Binary Property

Name of the binary property containing the file(s) to convert. If left empty, all binary properties from the previous node will be processed automatically.

Output Binary Property

Name of the binary property where the converted PDF will be saved (default: data)

Options

  • Landscape: Use landscape orientation
  • Page Ranges: Specify page ranges (e.g., "1-2,4-5")
  • Scale: Scale factor for the PDF (0.1 to 2)
  • Wait Timeout: Maximum time to wait for conversion (e.g., "30s", "1m")
  • Wait Delay: Delay before starting conversion (e.g., "1s")

Usage Examples

Example 1: Convert a single Office document

  1. Use a node that reads a file (e.g., "Read Binary File")
  2. Connect it to the Gotenberg node
  3. Configure:
    • Operation: "Convert Office Documents"
    • Binary Property: (leave empty to use all binary properties)
    • Gotenberg URL: Your Gotenberg server URL

Example 2: Convert multiple files from an array

  1. Use a node that returns multiple binary files (e.g., "Read Binary Files" with multiple files)
  2. The Gotenberg node will automatically process all files in the array
  3. All files will be converted and merged into a single PDF

Example 3: Convert HTML to PDF

  1. Use a node that provides HTML content as binary data
  2. Configure:
    • Operation: "Convert HTML"
    • Binary Property: Name of the property containing HTML

Binary Data Handling

The node supports both single binary files and arrays of binary files:

  • Single file: If a binary property contains a single file, it will be processed directly
  • Array of files: If a binary property contains an array of files, all files will be processed and sent to Gotenberg
  • Multiple properties: If no specific binary property is specified, all binary properties from the previous node will be processed

Requirements

  • n8n (self-hosted or cloud)
  • Gotenberg server running and accessible
  • Node.js 18+ and npm

Development

# Install dependencies
npm install

# Build the project
npm run build

# Watch mode for development
npm run dev

# Lint code
npm run lint

# Format code
npm run format

License

MIT

Author

Danila Fokin sir.sotoros@ys.ru

Links

Discussion