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
- Split PDF By Barcode
- 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
- Split PDF By Swiss QR
- 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 Text
- Split PDF Regular
- Unlock PDF
- Update Hyperlinks Annotation
- Upload File To PDF4me
Overview
The "Add Barcode To PDF" operation allows users to embed a barcode into an existing PDF document. This node supports various input methods for the PDF file, including binary data from a previous node, a base64-encoded string, or a URL pointing to the PDF. Users can specify the barcode type, text content to encode, positioning, size, opacity, and display options for the barcode within the PDF pages.
This node is beneficial in scenarios where documents need to be tagged with barcodes for tracking, inventory management, authentication, or quick data retrieval. For example, adding QR codes to invoices for easy payment processing or embedding Code 128 barcodes on shipping labels for logistics.
Properties
| Name | Meaning |
|---|---|
| Input Data Type | Method to provide the PDF file: "Binary Data" (from previous node), "Base64 String" (base64 encoded PDF content), or "URL" (link to PDF file). |
| Input Binary Field | Name of the binary property 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 String" input type. |
| PDF URL | URL to the PDF file when using "URL" input type. |
| Barcode Text | The text string to encode inside the barcode. |
| Barcode Type | Type of barcode to add. Options include QR Code, Code 128, Data Matrix, Aztec, PDF417, EAN-13, UPC-A, Code 39, and many others (a comprehensive list of barcode symbologies is supported). |
| Pages | Specifies which pages to add the barcode to. Can be empty (all pages), single page ("1"), multiple pages ("1,3,5"), ranges ("2-5"), or combinations ("1,3,7-10", "2-"). |
| Horizontal Alignment | Horizontal alignment of the barcode on the page: Left, Center, or Right. |
| Vertical Alignment | Vertical alignment of the barcode on the page: Top, Middle, or Bottom. |
| Height in mm | Height of the barcode in millimeters; "0" means auto-detect. |
| Width in mm | Width of the barcode in millimeters; "0" means auto-detect. |
| Margin Horizontal In mm | Horizontal margin from the left origin of the barcode in millimeters. |
| Margin Vertical In mm | Vertical margin from the top origin of the barcode in millimeters. |
| Height In Pt | Height of the barcode in points (pt); "0" means auto-detect. |
| Width In Pt | Width of the barcode in points (pt); "0" means auto-detect. |
| Margin X In Pt | Horizontal margin from the top origin of the barcode in points (pt). |
| Margin Y In Pt | Vertical margin from the left origin of the barcode in points (pt). |
| Opacity | Opacity level of the barcode, from 0 (fully transparent) to 100 (fully opaque). |
| Display Text | Position of the barcode text relative to the barcode: Above or Below. |
| Hide Text | Boolean to hide (true) or show (false) the barcode text alongside the barcode. |
| Show Only In Print | Boolean to make the barcode visible only when printing. |
| Is Text Above | Boolean indicating if the text is above the barcode. |
| Output Options | Collection of output-related settings: |
| - Output File Name | Custom name for the resulting PDF file with the barcode added. |
| - Custom Profiles | JSON string to adjust custom properties for output formatting (refer to external documentation for details). |
| 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 file with the barcode embedded according to the specified parameters. The output includes:
- A binary data field containing the updated PDF file. The field name can be customized via the "Binary Data Output Name" property.
- The binary data represents the PDF document with the barcode added on the selected pages and positions.
- No additional JSON fields are explicitly described, but standard metadata about the output file may be included.
Dependencies
- Requires access to the PDF file either as binary data, base64 string, or accessible URL.
- Depends on an external PDF processing service or library capable of rendering barcodes onto PDFs.
- May require an API key or authentication token configured in n8n credentials to interact with the PDF processing backend (not detailed in the source).
- Custom profiles for output formatting can be used by providing JSON configuration per the external service's documentation.
Troubleshooting
Common Issues:
- Invalid or inaccessible PDF input (e.g., wrong binary field name, invalid base64 string, or unreachable URL) will cause failures.
- Unsupported barcode types or incorrect barcode text format might result in errors or invalid barcodes.
- Incorrect page range syntax could lead to no barcode being added or errors.
- Mismatched units or zero values for width/height without auto-detection may cause layout issues.
Error Messages:
- Errors related to missing or malformed PDF input should be resolved by verifying the input data type and content.
- Barcode generation errors often stem from unsupported barcode types or invalid text; ensure the barcode type matches the text format.
- Permission or network errors when using URL input indicate connectivity or access issues to the PDF resource.
- JSON parsing errors in custom profiles require validating the JSON syntax and structure.
Resolutions:
- Double-check input property values and ensure the PDF file is correctly provided.
- Validate barcode text against the chosen barcode symbology requirements.
- Use valid page range formats.
- Test with default output options before applying custom profiles.
Links and References
- PDF4me API Documentation — for details on custom profile JSON and advanced PDF processing options.
- Barcode Symbologies Reference: Various barcode types supported, consult barcode standards for correct usage.