1D Barcode Decode
Reads and decodes 1D barcode images to extract the encoded text data. Supports multiple barcode formats including Code 39, Code 93, Code 128, and CodaBar. Accepts 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
- Barcode Path - File path to the barcode image to decode. Must be a valid PNG, JPG, or JPEG file.
Options
- Encoding Type - The barcode format to decode. 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
Output
- result - The decoded text content from the barcode image.
How It Works
The 1D Barcode Decode node extracts data from barcode images by:
- Loading the barcode image from the specified path
- Validating the file format (PNG, JPG, or JPEG)
- Converting the image to a binary bitmap for processing
- Using the selected decoding algorithm to read the barcode
- Extracting and returning the encoded text data
Decoding Capabilities
The node can decode the following 1D barcode formats:
- Code 128 - Full ASCII characters, commonly used for shipping and packaging
- Code 39 - Alphanumeric with special characters, used in automotive and defense
- Code 93 - Compact alphanumeric encoding with better density
- CodaBar - Numeric with special characters, used in libraries and healthcare
Practical Examples
Example 1: Read Product Barcode
Decode a product SKU barcode from a scanned image:
- Barcode Path:
C:\scans\product_barcode.png - Encoding Type:
Code 128 - Result:
PROD-12345-XYZ
Use case: Extract product information from scanned warehouse labels for inventory updates.
Example 2: Process Shipping Labels
Decode tracking numbers from shipping label images:
- Barcode Path:
/tmp/shipping_label.jpg - Encoding Type:
Code 128 - Result:
1Z999AA10123456784
Use case: Automate package sorting by reading tracking barcodes from label images.
Example 3: Library Book Scanner
Read book identification from library barcode:
- Barcode Path:
/library/scans/book_barcode.png - Encoding Type:
CodaBar - Result:
A123456789B
Use case: Automated book check-in/check-out system by scanning book barcodes.
Example 4: Document Processing
Extract document IDs from scanned forms:
- Barcode Path:
C:\documents\form_001.jpg - Encoding Type:
Code 39 - Result:
DOC-2024-001
Use case: Automatically classify and route scanned documents based on barcode identifiers.
Example 5: Batch Processing
Process multiple barcode images in a loop:
For each file in folder "C:\barcodes\":
- Barcode Path: {{file.path}}
- Encoding Type: Code 128
- Store result in data table
Use case: Bulk process scanned inventory labels and update database.
Tips for Effective Use
- Match encoding type: Ensure the encoding type matches the barcode format in the image
- Image quality: Use clear, high-resolution images for better decoding accuracy
- Proper lighting: Ensure barcodes are scanned with good contrast and even lighting
- Orientation: Keep barcodes properly aligned (horizontal orientation works best)
- No distortion: Avoid skewed, warped, or distorted barcode images
- Adequate size: Use images with sufficient resolution (minimum 200x50 pixels for standard barcodes)
- Clean images: Remove noise, shadows, or artifacts that might interfere with decoding
- Try different formats: If decoding fails, try different encoding type options
- Error handling: Always use error handling for production workflows in case of unreadable barcodes
Common Errors and Solutions
Error: "Barcode path cannot be empty"
Solution: Provide a valid file path to the barcode image.
Error: "Invalid File Extension"
Solution: Ensure the image file has a .png, .jpg, or .jpeg extension.
Error: "OpenBarcode" - File not found
Solution:
- Verify the file path is correct and the file exists
- Check file permissions and access rights
- Use absolute paths instead of relative paths
Error: "DecodeFile" - Cannot decode image
Solution:
- Verify the image format is valid
- Check if the image is corrupted
- Ensure the image contains a readable barcode
Error: "Decode" - Cannot read barcode
Solution:
- Verify the encoding type matches the barcode format
- Check image quality and resolution
- Ensure the barcode is not damaged or obscured
- Try enhancing image contrast before decoding
- Verify the barcode is not too small in the image
Barcode not detected
Solution:
- Increase image resolution or size
- Improve image contrast and brightness
- Remove background noise from the image
- Ensure proper barcode orientation
- Try cropping the image to focus on the barcode area
- Verify the barcode is not damaged or partially visible
Incorrect decoding results
Solution:
- Confirm the correct encoding type is selected
- Check for image compression artifacts (use PNG instead of JPG)
- Ensure the barcode meets minimum size requirements
- Verify the barcode is not blurry or out of focus
RPA Use Cases
- Warehouse automation: Scan and process inventory barcodes from photos or screenshots
- Document management: Extract document IDs from scanned forms with barcode identifiers
- E-commerce returns: Process return labels by reading tracking barcodes
- Quality control: Verify product barcodes match expected values in automated testing
- Shipping automation: Read package tracking numbers from label images
- Asset management: Track equipment by scanning asset tag barcodes
- Healthcare records: Process patient wristbands or sample labels with barcode identification
- Library systems: Automate book cataloging and circulation by reading ISBN barcodes
- Retail POS: Extract product codes from barcode images for price lookup
- Access control: Validate entry passes by decoding barcode credentials from images
Best Practices
- Preprocessing: Use image enhancement nodes (brightness, contrast, crop) before decoding for better results
- Validation: Verify decoded results match expected patterns or formats
- Fallback logic: Implement retry mechanisms with different encoding types if first attempt fails
- Logging: Log both successful and failed decode attempts for troubleshooting
- Batch processing: Use loops to process multiple barcode images efficiently
- Data validation: Check decoded results against database or validation rules
- Error reporting: Track and report unreadable barcodes for manual review