1D Barcode Encode
Generates 1D barcode images from text data. Supports multiple barcode formats including Code 39, Code 93, Code 128, and CodaBar. The generated barcode can be saved as PNG, JPG, or JPEG image files.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.
Inputs
- Code - The text data to encode into the barcode. This cannot be empty.
- Image Width - Width of the output barcode image in pixels. Default is 250 pixels.
- Image Height - Height of the output barcode image in pixels. Default is 50 pixels.
- Barcode Path - File path where the barcode image will be saved. Must include a valid file extension (PNG, JPG, or JPEG).
Options
- Encoding Type - The barcode format to generate. Options include:
- Code 128 (default) - High-density barcode, supports full ASCII character set
- Code 39 - Alphanumeric barcode, widely used in industry
- Code 93 - Compact barcode, improved version of Code 39
- CodaBar - Numeric barcode, commonly used in libraries and blood banks
How It Works
The 1D Barcode Encode node creates barcode images by:
- Taking the input text data from the Code parameter
- Validating the barcode path and ensuring proper file extension
- Using the selected encoding type to generate the barcode
- Creating an image with the specified width and height dimensions
- Saving the barcode image to the specified path in the chosen format
Barcode Format Characteristics
Code 128
- Supports all ASCII characters (0-127)
- High density encoding
- Good for alphanumeric data
- Widely supported across industries
Code 39
- Supports uppercase letters (A-Z), digits (0-9), and special characters (- . $ / + % space)
- Lower density than Code 128
- Easy to print and scan
- Common in automotive and defense industries
Code 93
- Similar to Code 39 but more compact
- Better data density
- Full ASCII support with extended mode
- Improved security features
CodaBar
- Supports digits 0-9 and special characters (- $ : / . +)
- Self-checking format
- Commonly used in logistics, libraries, and blood banks
- Simple implementation
Practical Examples
Example 1: Generate Product Barcode
Generate a Code 128 barcode for a product SKU:
- Code:
PROD-12345-XYZ - Image Width:
300 - Image Height:
80 - Barcode Path:
C:\barcodes\product_barcode.png - Encoding Type:
Code 128
Example 2: Create Inventory Label
Generate a Code 39 barcode for inventory tracking:
- Code:
INV-2024-001 - Image Width:
250 - Image Height:
60 - Barcode Path:
/tmp/inventory_label.jpg - Encoding Type:
Code 39
Example 3: Library Book Barcode
Generate a CodaBar barcode for library management:
- Code:
A123456789B - Image Width:
280 - Image Height:
70 - Barcode Path:
/library/barcodes/book_12345.png - Encoding Type:
CodaBar
Tips for Effective Use
- Choose the right format: Use Code 128 for general purpose, Code 39 for simple alphanumeric, CodaBar for numeric-only applications
- Image dimensions: Ensure sufficient width for the data length. Longer codes need wider images
- Aspect ratio: Maintain proper width-to-height ratio. Generally, barcodes should be 4-6 times wider than they are tall
- Resolution: Use higher dimensions (300+ width) for printing to ensure scannability
- File format: Use PNG for better quality and transparency support, JPG for smaller file sizes
- Test scanning: Always test generated barcodes with actual scanners before production use
- Character limitations: Verify your data is compatible with the selected encoding type
- Quiet zones: Ensure adequate white space around barcodes when printing (handled automatically)
Common Errors and Solutions
Error: "Code cannot be empty"
Solution: Ensure the Code input parameter has a value before encoding.
Error: "Barcode path cannot be empty"
Solution: Provide a valid file path including filename and extension.
Error: "Invalid File Extension"
Solution: Use only .png, .jpg, or .jpeg extensions for the barcode path.
Error: "Invalid encoding type"
Solution: Select one of the supported encoding types: Code 128, Code 39, Code 93, or CodaBar.
Barcode not scanning properly
Solution:
- Increase image width for longer codes
- Ensure sufficient height (minimum 50 pixels)
- Verify the data is compatible with the chosen encoding type
- Check that special characters are supported by the encoding format
Poor print quality
Solution:
- Use larger dimensions (400+ width, 100+ height)
- Save as PNG instead of JPG for better quality
- Ensure printer resolution is at least 300 DPI
- Test with different barcode readers
RPA Use Cases
- E-commerce fulfillment: Generate shipping labels and package tracking barcodes
- Inventory management: Create product SKU barcodes for warehouse automation
- Document processing: Add unique identifiers to scanned documents
- Asset tracking: Generate equipment and asset identification labels
- Batch processing: Automatically create barcodes for bulk data from spreadsheets
- Print automation: Integrate with label printers for automated barcode label production