Overview
This node provides PDF manipulation capabilities with three main operations: converting images to a PDF, merging two PDFs into one, and converting an Excel sheet to a PDF. It is useful in workflows where you need to generate or combine PDF documents dynamically from various input formats.
- Convert Images To PDF: Takes multiple image files from the input binary data and compiles them into a single PDF document, each image on its own page.
- Merge PDFs: Combines two existing PDF files from the input binary data into one continuous PDF.
- Convert Excel To PDF: Converts a specified worksheet from an Excel file into a formatted PDF document, optionally including headers.
Practical examples:
- Automatically generating a PDF report from a set of images captured during a process.
- Combining multiple PDF reports into a single document for easier distribution.
- Converting Excel-based data sheets into PDFs for sharing or archiving without requiring Excel software.
Properties
| Name | Meaning |
|---|---|
| Operation | The action to perform: "Convert Images To PDF", "Merge PDFs", or "Convert Excel To PDF". |
| Destination Key | The name of the binary key where the resulting PDF will be stored. |
| PDF Name | The filename to assign to the output PDF file. |
| Keep Images | (Only for "Convert Images To PDF") Whether to keep the original images in the output item. |
| First PDF Binary Field | (Only for "Merge PDFs") The binary field name containing the first PDF to merge. |
| Second PDF Binary Field | (Only for "Merge PDFs") The binary field name containing the second PDF to merge. |
| Keep Source PDFs | (Only for "Merge PDFs") Whether to keep the source PDFs in the output item after merging. |
| Excel Binary Field | (Only for "Convert Excel To PDF") The binary field name containing the Excel file. |
| Include Headers | (Only for "Convert Excel To PDF") Whether to include column headers in the PDF output. |
| Sheet Name/Index | (Only for "Convert Excel To PDF") The sheet to convert, by name or 1-based index. |
| Keep Excel File | (Only for "Convert Excel To PDF") Whether to keep the original Excel file in the output item. |
Output
The node outputs items with a binary property containing the generated PDF file under the user-defined destination key. The PDF is stored as binary data with the specified filename and MIME type application/pdf.
- For "Convert Images To PDF", the output PDF contains one page per image.
- For "Merge PDFs", the output PDF is the concatenation of the two input PDFs.
- For "Convert Excel To PDF", the output PDF contains a formatted representation of the selected worksheet, including optional headers and pagination.
If configured to keep source files (images, PDFs, or Excel), those remain in the binary data; otherwise, they are removed to reduce output size.
Dependencies
- Uses the
pdfkitlibrary to create PDFs from images and Excel data. - Uses
pdf-libto merge PDF documents. - Uses
image-sizeto determine dimensions of images. - Uses
exceljsto read Excel files and extract worksheet data. - Requires input items to have binary data fields containing images, PDFs, or Excel files as appropriate.
- No external API keys or services are required; all processing is local within the node.
Troubleshooting
No binary data exists on item!
This error occurs if the input item does not contain any binary data. Ensure that the previous node outputs binary files (images, PDFs, or Excel) and that the correct binary field names are used.Binary field does not exist on item!
When merging PDFs or converting Excel, if the specified binary field name is incorrect or missing, this error appears. Double-check the exact binary field names in the input data.Error merging PDFs / Error converting Excel to PDF
These errors indicate corrupted or invalid PDF or Excel files. Verify the integrity of the input files and ensure they are valid and not password-protected.Worksheet not found / Invalid sheet index
When converting Excel, specifying a non-existent sheet name or an out-of-range index causes these errors. Confirm the sheet names or indexes in the Excel file.Empty worksheet
If the selected Excel sheet has no data, the node throws an error. Make sure the sheet contains data before conversion.
Links and References
- pdfkit Documentation – Used for PDF creation.
- pdf-lib Documentation – Used for PDF merging.
- exceljs Documentation – Used for reading Excel files.
- image-size npm package – Used to get image dimensions.