Part 3: Supported Barcode Symbologies in Barcode4J |
3.1 Overview of Symbology Support |
Barcode4J supports a variety of barcode types, both linear (1D) and two-dimensional (2D). Each symbology is implemented through a dedicated encoder class in the library, adhering to a standard interface that allows seamless integration with rendering and output layers. Linear barcodes are primarily used in logistics, retail, and inventory management, while 2D barcodes provide high-density encoding for applications requiring more information per code, such as shipping manifests, identification documents, and electronic ticketing. |
Barcode4J key symbologies include: |
* Linear (1D): Code 128, Code 39, Interleaved 2 of 5, EAN-13, EAN-8, UPC-A, UPC-E, Codabar. |
* 2D: PDF417. |
Each symbology is designed with specific rules, checksum calculations, and human-readable text options. |

|
3.2 Code 128 |
3.2.1 Overview |
Code 128 is one of the most versatile linear barcodes supported by Barcode4J. It can encode all 128 ASCII characters, making it suitable for alphanumeric, numeric, and special character encoding. This flexibility makes it ideal for logistics, inventory management, and complex labeling systems. |
3.2.2 Encoding Rules |
Code 128 uses three code sets*A, B, and C: |
* Code Set A: Encodes upper-case letters, numbers, and control characters. |
* Code Set B: Encodes upper- and lower-case letters, numbers, and special symbols. |
* Code Set C: Encodes numeric pairs (009) in double-density format for efficient numeric encoding. |
Barcode4J automatically selects the optimal code set for input data to minimize barcode length. Each barcode begins and ends with start/stop characters, and a modulo 103 checksum ensures data integrity. |
3.2.3 Applications |
* Shipping labels in courier systems. |
* Inventory tracking for alphanumeric product codes. |
* Financial documents requiring robust, scannable barcodes. |

|
3.3 Code 39 |
3.3.1 Overview |
Code 39, also known as Code 3 of 9, is widely used in industrial and logistics applications. It can encode upper-case letters, digits, and a few special characters (e.g., -, ., $, /, +, %). |
3.3.2 Encoding Rules |
* Each character is represented by 9 elements (5 bars and 4 spaces), hence the name Code 39. |
* Start and stop characters are represented by asterisks (*). |
* Optional modulo 43 checksum can be added for additional validation. |
3.3.3 Applications |
* Asset tagging in warehouses. |
* Vehicle identification and parts labeling. |
* Basic retail labeling where only uppercase letters and numbers are needed. |

|
3.4 Interleaved 2 of 5 (ITF) |
3.4.1 Overview |
Interleaved 2 of 5 is a numeric-only barcode widely used in logistics and industrial environments, particularly for carton and pallet labeling. |
3.4.2 Encoding Rules |
* Encodes numeric digits in pairs, interleaving bars for the first digit and spaces for the second. |
* Requires an even number of digits; a leading zero is often added if necessary. |
* Optional modulo 10 checksum enhances reliability during scanning. |
3.4.3 Applications |
* Shipping container labels. |
* Inventory tracking in warehouses. |
* Retail carton labeling. |

|
3.5 EAN-13 and EAN-8 |
3.5.1 Overview |
The European Article Number (EAN) barcodes are standardized for global retail, encoding numeric data to represent product identifiers. EAN-13 encodes 13 digits, while EAN-8 encodes 8 digits for smaller packages. |
3.5.2 Encoding Rules |
* EAN-13: Uses a 12-digit payload and a 13th checksum digit, calculated modulo 10. |
* EAN-8: Similar logic with 7 payload digits and 1 checksum. |
* Left and right halves of the barcode use different encoding patterns (odd/even parity), allowing scanners to distinguish orientation. |
3.5.3 Applications |
* Retail products in supermarkets and e-commerce. |
* Small consumer goods where label space is limited. |
* Point-of-sale systems globally, ensuring compatibility with scanners. |

|
3.6 UPC-A and UPC-E |
3.6.1 Overview |
The Universal Product Code (UPC) is a standardized linear barcode used primarily in the United States. UPC-A encodes 12 digits, while UPC-E is a compressed form for smaller products. |
3.6.2 Encoding Rules |
* UPC-A: 11 digits of data + 1 check digit, modulo 10. |
* UPC-E: Compacts UPC-A by suppressing redundant zeros. |
* Barcode4J automatically calculates check digits if missing. |
3.6.3 Applications |
* Consumer products in North American retail. |
* E-commerce packaging and logistics. |
* Integration with POS systems for automated checkout. |

|
3.7 Codabar |
3.7.1 Overview |
Codabar is an older linear barcode, primarily used in libraries, blood banks, and parcel services. It encodes digits and a few special symbols (-, $, :, /, ., +). |
3.7.2 Encoding Rules |
* Start and stop characters are mandatory (A, B, C, D, or N, E, *, T). |
* Each character consists of 7 elements, alternating bars and spaces. |
* Simple checksum algorithms may be applied depending on the application. |
3.7.3 Applications |
* Blood bank sample labeling. |
* Library book cataloging. |
* Courier service packages with legacy barcode requirements. |

|
3.8 PDF417 (2D Barcode) |
3.8.1 Overview |
PDF417 is a stacked linear 2D barcode, capable of encoding up to thousands of characters. It is used in applications requiring high-density data, including IDs, shipping labels, and electronic tickets. |
3.8.2 Encoding Rules |
* Encodes data in codewords, each representing 17 modules (bars and spaces). |
* Supports error correction using Reed-Solomon algorithms, configurable from level 0 to 8. |
* Human-readable text can optionally be included. |
3.8.3 Applications |
* Government-issued IDs and driver licenses. |
* Airline boarding passes and e-tickets. |
* Shipping labels for logistics companies. |

|
3.9 Summary of Symbology Support |
Barcode4J extensive symbology support makes it suitable for a wide range of enterprise applications. Linear barcodes cover everyday retail and logistics needs, while PDF417 provides high-capacity encoding for documents requiring embedded metadata and error correction. By standardizing the interface across symbologies, Barcode4J ensures consistent integration with rendering and output systems. |

|
3.10 Practical Considerations for Choosing Symbologies |
When selecting a symbology within Barcode4J, developers should consider: |
* Data Type: Numeric-only, alphanumeric, or full ASCII. |
* Space Constraints: Small products may require compact barcodes like UPC-E or EAN-8. |
* Scanning Environment: Industrial scanners may favor ITF or Code 128. |
* Error Correction Needs: PDF417 is preferred for applications requiring robust error recovery. |
* Compliance Requirements: Retail or government systems may mandate specific barcode types. |
Cited Reference |
* Barcode4J Official Website: [https://barcode4j.sourceforge.io/](https://barcode4j.sourceforge.io/) |