PdfKit

PDFKit Node

Overview

This node provides PDF manipulation capabilities with three main operations:

  • Convert Excel To PDF: Converts an Excel file (from binary data) into a PDF document. It supports selecting a specific sheet by name or index and optionally including column headers in the output. This is useful for generating printable or shareable PDF reports from spreadsheet data.

Common scenarios include:

  • Automating report generation workflows where Excel data needs to be distributed as PDFs.
  • Archiving spreadsheet data in a fixed format.
  • Sharing Excel content with users who do not have spreadsheet software.

Properties

Name Meaning
Destination Key The name of the binary key where the resulting PDF will be stored.
PDF Name The filename to assign to the generated PDF file.
Excel Binary Field The binary field containing the Excel file to convert.
Include Headers Whether to include the column headers from the Excel sheet in the PDF output (true/false).
Sheet Name/Index The name or 1-based index of the sheet to convert. Can be a sheet name string or a number as string.
Keep Excel File Whether to keep the original Excel file in the binary data after conversion (true/false).

Output

The node outputs the converted PDF as binary data under the specified destination key. The binary data includes:

  • data: The raw PDF file content.
  • fileName: The PDF file name as specified by the user.
  • mimeType: Set to "application/pdf".

If the "Keep Excel File" option is false, the original Excel binary data is removed from the output item to reduce payload size.

Dependencies

  • Uses the exceljs library to read and parse Excel files.
  • Uses pdfkit to generate PDF documents.
  • Requires input items to contain valid binary Excel files in the specified binary field.
  • No external API keys or services are required; all processing is local.

Troubleshooting

  • Error: Excel field "X" does not exist on item!
    Ensure that the binary field name exactly matches the field containing the Excel file in the input data.

  • Worksheet "Y" not found in the workbook.
    Verify the sheet name or index provided exists in the Excel file. You can check available sheets by inspecting the Excel file.

  • Invalid sheet index: Z.
    Sheet indices start at 1. Make sure the index is within the range of available sheets.

  • The selected worksheet is empty.
    The chosen sheet contains no data. Confirm the sheet has content before converting.

  • Error converting Excel to PDF: ...
    Indicates issues reading or parsing the Excel file or generating the PDF. Check that the Excel file is valid and not corrupted.

Links and References

Discussion