Gotenberg icon

Gotenberg

Convert HTML to PDF using Gotenberg API

Overview

This node integrates with the Gotenberg API to perform PDF-related operations such as converting HTML or URLs to PDF, merging multiple PDFs into one, and splitting a PDF into multiple files. The "Merge PDFs" operation specifically allows users to combine several PDF files from binary input data into a single PDF document.

Common scenarios for this node include:

  • Combining multiple reports or documents into a single PDF file for easier distribution.
  • Automating PDF processing workflows where multiple PDFs need to be consolidated.
  • Preparing merged PDFs for archiving or sharing.

Example: You have several invoice PDFs stored in binary fields of incoming items, and you want to merge them into one comprehensive PDF report.

Properties

Name Meaning
PDF Files The name of the binary field that contains the PDF files to merge. This can be a single PDF or an array of PDFs.

Output

The node outputs a single item per input item with the following structure:

  • json: The original JSON data of the input item is preserved.
  • binary.data: Contains the merged PDF file as binary data.
    • Filename: Defaults to document.pdf unless overridden by the original file names.
    • MIME type: application/pdf.

If multiple PDFs are merged, the output is a single combined PDF file.

Dependencies

  • Requires access to the Gotenberg API endpoint, which must be configured via credentials containing the base URL and authentication token.
  • The node uses HTTP POST requests to the Gotenberg /forms/pdfengines/merge endpoint.
  • Requires the user to provide an API key credential for authenticating with the Gotenberg service.

Troubleshooting

  • Error: No binary data found for field: This error occurs if the specified binary field (e.g., "pdfFiles") does not exist or contains no data in the input item. Ensure the correct binary field name is provided and that the input items contain valid PDF binary data.
  • Unknown operation: If the operation parameter is set incorrectly, the node will throw an error. Make sure "Merge PDFs" is selected when intending to merge PDF files.
  • API connection issues: Network problems or incorrect API credentials may cause request failures. Verify the Gotenberg API URL and authentication details.
  • Invalid PDF files: Corrupted or unsupported PDF files in the input may cause the merge operation to fail.

Links and References

Discussion