Overview
This node converts one or more input images into a single PDF file. It is useful in workflows where you need to programmatically combine images (such as scanned documents, photos, or generated graphics) into a PDF for sharing, archiving, or further processing. For example, you could use this node to merge multiple image attachments from emails into a single PDF document.
Properties
| Display Name | Type | Meaning |
|---|---|---|
| Destination Key | String | The name of the binary key under which the resulting PDF will be stored. |
| PDF Name | String | The filename to assign to the output PDF. |
| Keep Images | Boolean | Whether to retain the original image binaries after creating the PDF. |
Output
- The node outputs items with a
binaryproperty containing the generated PDF file. - The PDF is stored under the key specified by Destination Key.
- The filename of the PDF is set according to PDF Name.
- If Keep Images is set to
false, the original image binaries are removed from the output; otherwise, they are retained. - The
jsonfield is preserved from the input item.
Example Output Structure
{
"json": { /* original data */ },
"binary": {
"yourDestinationKey": {
"data": "<Buffer ...>",
"fileName": "yourPdfName.pdf",
"mimeType": "application/pdf"
}
// (other binaries may be present if 'Keep Images' is true)
}
}
Dependencies
- Requires the following npm packages:
pdfkit,image-size. - No external API keys or services are required.
- n8n helpers are used for binary data handling.
Troubleshooting
- "No binary data exists on item!"
This error occurs if the input item does not contain any binary data. Ensure that your workflow provides image files as binary data to this node. - PDF not generated or empty:
Make sure at least one valid image is present in the input item's binary properties. - Output key collision:
If the specified Destination Key matches an existing binary key, it will be overwritten.