Actions80
- Add Attachment To PDF
- Add Barcode To PDF
- Add Form Fields To PDF
- Add HTML Header Footer
- Add Image Stamp To PDF
- Add Image Watermark To Image
- Add Margin To PDF
- Add Page Number To PDF
- Add Text Stamp To PDF
- Add Text Watermark To Image
- AI-Invoice Parser
- AI-Process Contract
- AI-Process HealthCard
- Classify Document
- Compress Image
- Compress PDF
- Convert HTML To PDF
- Convert Image Format
- Convert JSON To Excel
- Convert Markdown To PDF
- Convert PDF To Editable PDF Using OCR
- Convert PDF To Excel
- Convert PDF To PowerPoint
- Convert PDF To Word
- Convert To PDF
- Convert URL to PDF
- Convert VISIO
- Convert Word to PDF Form
- Create Images From PDF
- Create PDF/A
- Create Swiss QR Bill
- Crop Image
- Delete Blank Pages From PDF
- Delete Unwanted Pages From PDF
- Disable Tracking Changes In Word
- Enable Tracking Changes In Word
- Extract Attachment From PDF
- Extract Form Data From PDF
- Extract Pages From PDF
- Extract Resources
- Extract Table From PDF
- Extract Text By Expression
- Extract Text From Word
- Fill PDF Form
- Find And Replace Text
- Flip Image
- Flatten PDF
- Generate Barcode
- Generate Document Single
- Generate Documents Multiple
- Get Document From Pdf4me
- Get Image Metadata
- Get PDF Metadata
- Get Tracking Changes In Word
- Image Extract Text
- Linearize PDF
- Merge Multiple PDFs
- Overlay PDFs
- Parse Document
- Protect PDF
- Read Barcode From Image
- Read Barcode From PDF
- Read SwissQR Code
- Remove EXIF Tags From Image
- Repair PDF Document
- Replace Text With Image
- Replace Text With Image In Word
- Resize Image
- Rotate Document
- Rotate Image
- Rotate Image By EXIF Data
- Rotate PDF Page
- Sign PDF
- Split PDF By Barcode
- Split PDF By Swiss QR
- Split PDF By Text
- Split PDF Regular
- Unlock PDF
- Update Hyperlinks Annotation
- Upload File To PDF4me
Overview
This node operation "Add Attachment To PDF" allows users to add one or multiple file attachments to an existing PDF document. It supports various ways to provide the source PDF (binary data, base64 string, or URL) and also supports different methods for supplying the attachment files themselves. This functionality is useful in scenarios where you want to enrich a PDF with supplementary documents, images, or other files embedded as attachments.
Practical examples include:
- Adding supporting documents or references directly inside a PDF report.
- Embedding related images or text files into a PDF invoice or contract.
- Attaching user manuals or additional resources to a product datasheet PDF.
Properties
| Name | Meaning |
|---|---|
| Input Data Type | How the source PDF file is provided. Options: Binary Data (from previous node), Base64 String (encoded content), or URL (link to PDF). |
| Input Binary Field | The binary property name containing the PDF file when using Binary Data input type (usually "data"). |
| Base64 PDF Content | Base64 encoded string of the PDF document content when using Base64 input type. |
| PDF URL | URL pointing to the PDF file when using URL input type. |
| Output File Name | Desired filename for the output PDF with attachments (e.g., "document_with_attachments.pdf"). |
| Document Name | Reference name for the source PDF file (informational). |
| Attachments | Collection of files to attach to the PDF. Each attachment can be provided as Binary Data, Base64 String, or URL, along with its filename and content details. |
| Advanced Options | Optional JSON profiles to customize API call properties for advanced use cases. |
| Debug Options | Settings to enable debug mode, select log detail level, and choose whether to output logs to console for troubleshooting purposes. |
| Binary Data Output Name | Custom name for the binary data field in the node's output (default is "data"). |
Output
The node outputs the modified PDF document with the added attachments as binary data. The output includes:
- A JSON object representing the processed item.
- A binary property containing the updated PDF file data, named according to the "Binary Data Output Name" property (default "data").
If enabled, debug information may also be included in the output depending on debug settings.
Dependencies
- Requires access to the PDF processing API service that handles adding attachments to PDFs.
- Needs appropriate API authentication credentials configured in n8n to authorize requests.
- Internet access if URLs are used for input PDF or attachments.
Troubleshooting
Common issues:
- Incorrect binary property names leading to missing input files.
- Invalid or inaccessible URLs causing download failures.
- Malformed base64 strings resulting in decoding errors.
- Missing or invalid API credentials causing authorization errors.
Error messages and resolutions:
- "File not found in binary property" — Verify the binary field name matches the actual input data.
- "Failed to fetch file from URL" — Check URL accessibility and correctness.
- "Invalid base64 content" — Ensure the base64 string is properly encoded without extra characters.
- "Authentication failed" — Confirm API key or token is correctly set up in n8n credentials.
- Enable debug mode to get detailed logs for diagnosing issues.
Links and References
- PDF4me API Documentation — For advanced profile options and API capabilities.
- n8n Documentation on Working with Binary Data — Guidance on handling binary inputs and outputs in workflows.