Actions80
- Extract Text From Word
- Find And Replace Text
- Convert PDF To Editable PDF Using OCR
- Create Swiss QR Bill
- Split PDF By Barcode
- Split PDF By Swiss QR
- Split PDF By Text
- Split PDF Regular
- Create PDF/A
- Convert HTML To PDF
- Convert Markdown To PDF
- Upload File To PDF4me
- Add Attachment To PDF
- Add Barcode To PDF
- Add Form Fields To PDF
- Fill PDF Form
- Add HTML Header Footer
- Add Image Stamp To PDF
- Add Margin To PDF
- Add Page Number To PDF
- Add Text Stamp To PDF
- AI-Invoice Parser
- AI-Process HealthCard
- AI-Process Contract
- Generate Barcode
- Classify Document
- Parse Document
- Linearize PDF
- Flatten PDF
- Convert To PDF
- Json To Excel
- Convert PDF To Excel
- Convert PDF To Word
- Convert PDF To PowerPoint
- Convert VISIO
- Crop Image
- Delete Blank Pages From PDF
- Delete Unwanted Pages From PDF
- Extract Pages
- Merge Multiple PDFs
- Overlay PDFs
- Rotate Document
- Rotate Page
- Sign PDF
- URL to PDF
- Add Image Watermark To Image
- Add Text Watermark To Image
- Compress Image
- Convert Image Format
- Create Images From PDF
- Flip Image
- Get Image Metadata
- Image Extract Text
- Remove EXIF Tags From Image
- Replace Text With Image
- Replace Text With Image In Word
- Resize Image
- Rotate Image
- Rotate Image By EXIF Data
- Compress PDF
- Get PDF Metadata
- Repair PDF Document
- Get Document From Pdf4me
- Update Hyperlinks Annotation
- Protect Document
- Unlock PDF
- Disable Tracking Changes In Word
- Enable Tracking Changes In Word
- Generate Document Single
- Generate Documents Multiple
- Get Tracking Changes In Word
- Read Barcode From Image
- Read Barcode From PDF
- Read SwissQR Code
- Extract Form Data From PDF
- Extract Pages From PDF
- Extract Attachment From PDF
- Extract Text By Expression
- Extract Table From PDF
- Extract Resources
Overview
The node operation "Add Barcode To PDF" allows users to embed a barcode into an existing PDF document. This is useful for scenarios where you want to add machine-readable information such as tracking numbers, product codes, or URLs directly onto PDF files. Common use cases include adding QR codes for quick access to web resources, encoding inventory or shipment data with Code 128 barcodes, or embedding other barcode types for document management and automation.
For example, a logistics company could automatically add a barcode containing shipment details to delivery PDFs, or a marketing team might add QR codes linking to promotional content on brochures in PDF format.
Properties
| Name | Meaning |
|---|---|
| Input Data Type | How the PDF file is provided: - Binary Data (from previous node) - Base64 String (encoded PDF content) - URL (link to PDF file) |
| Input Binary Field | The name of the binary property containing the PDF file when using Binary Data input type (usually "data"). |
| Base64 PDF Content | The base64 encoded string representing the PDF document content (used if Input Data Type is Base64). |
| PDF URL | The URL pointing to the PDF file to which the barcode will be added (used if Input Data Type is URL). |
| Barcode Text | The text string that will be encoded inside the barcode. |
| Barcode Type | The type of barcode to add. Options include: - QR Code - Code 128 - Data Matrix - Aztec - Han Xin - PDF417 - EAN-13 - UPC-A - Code 39 - Code 93 - Codabar - Interleaved 2 of 5 |
| Pages | Specifies pages to add the barcode to. Can be empty (all pages), single page ("1"), multiple pages ("1,3,5"), ranges ("2-5"), combined lists and ranges ("1,3,7-10"), or open-ended ranges ("2-"). |
| Positioning | Collection of options defining barcode placement: - Horizontal Alignment: Left, Center, Right - Vertical Alignment: Top, Middle, Bottom - Horizontal Margin (mm) - Vertical Margin (mm) |
| Barcode Size | Collection specifying barcode dimensions: - Height (mm) - Width (mm) - Height (points) - Width (points) Use 0 for auto-detect sizing. |
| Appearance | Collection controlling visual aspects: - Opacity (0-100) - Display Text position (Above or Below) - Hide Text (boolean) - Show Only in Print (boolean) - Text Above Barcode (boolean) |
| Output Options | Collection for output customization: - Output File Name (name of resulting PDF) - Custom Profiles (JSON string for advanced settings, e.g., output format) |
Output
The node outputs the modified PDF file with the barcode embedded according to the specified parameters. The output is typically provided as binary data representing the updated PDF document. The output file can be named as specified in the "Output File Name" property.
If configured, the output may also be available as a base64 encoded string depending on custom profile settings.
Dependencies
- Requires access to the PDF file either via binary data from a previous node, a base64 encoded string, or a URL.
- Needs an API key credential or similar authentication token configured in n8n to interact with the underlying PDF processing service.
- Network access is required if providing the PDF via URL.
Troubleshooting
Common issues:
- Invalid or inaccessible PDF URL: Ensure the URL is reachable and points to a valid PDF file.
- Incorrect binary field name: Verify the binary property name matches the actual input binary data.
- Unsupported barcode text or type: Confirm the barcode text is compatible with the selected barcode type.
- Page specification errors: Validate the page range syntax; invalid formats may cause failures.
- Output file naming conflicts: Avoid using names that conflict with existing files or contain invalid characters.
Error messages:
- "Failed to fetch PDF from URL": Check network connectivity and URL correctness.
- "Invalid binary data": Confirm the binary input contains a valid PDF file.
- "Barcode generation error": Review barcode text and type compatibility.
- "Page range parsing error": Correct the pages input format.
Resolving these usually involves verifying inputs and ensuring proper configuration of credentials and network access.
Links and References
- PDF4me API Documentation
- Barcode Types Reference: Wikipedia Barcode Types
- n8n Documentation: Creating Custom Nodes