Part 8 Supported Barcode Symbologies and Their Internal Implementations |
8.1 Overview of Symbology Coverage Philosophy |
8.1 BarcodeLib approach to barcode symbology support is guided by practicality rather than exhaustive completeness. Instead of attempting to implement every barcode standard ever published, the library focuses on symbologies that are widely used in business, logistics, retail, healthcare, and internal enterprise systems. |
8.2 This selective coverage reflects the library original target audience: .NET developers who need reliable, standards-compliant barcode generation without the overhead, licensing complexity, or learning curve of commercial SDKs. |
8.3 BarcodeLib primarily emphasizes linear (1D) barcode symbologies, with limited or experimental support for certain stacked or matrix-style codes depending on the version and community contributions. |
8.4 Each supported symbology is implemented with a consistent internal pattern: |
* Symbology-specific validation |
* Data preprocessing |
* Encoding rule application |
* Check digit computation (if applicable) |
* Logical pattern generation |
* Rendering translation |

|
8.2 Code 39 (Code 3 of 9) |
8.5 Code 39 is one of the most commonly supported symbologies in BarcodeLib and serves as a canonical example of how linear barcodes are implemented within the library. |
8.6 Internally, Code 39 encoding relies on a fixed mapping between characters and bar-space patterns. Each character is represented by a sequence of nine elements, consisting of five bars and four spaces, with three wide elements per character. |
8.7 BarcodeLib stores these mappings in arrays or lookup structures that associate each valid character with its corresponding pattern. Encoding proceeds by iterating through the input string and concatenating patterns sequentially. |
8.8 Optional features such as start/stop characters and inter-character gaps are handled explicitly in code, rather than being implicitly assumed. This explicitness improves readability and reduces ambiguity. |
8.9 BarcodeLib typically supports both standard Code 39 and extended Code 39, where extended mode allows encoding of the full ASCII character set through character pair expansion. |

|
8.3 Code 128 |
8.10 Code 128 is a high-density linear symbology widely used in logistics, shipping, and inventory systems. BarcodeLib implementation of Code 128 is more complex than Code 39 due to its multiple code sets and dynamic switching rules. |
8.11 Internally, BarcodeLib supports the three Code 128 code sets (commonly referred to as A, B, and C), each optimized for different character ranges. |
8.12 The encoding logic includes: |
* Automatic or manual code set selection |
* Detection of numeric sequences suitable for Code Set C compression |
* Insertion of code set switch symbols |
* Computation of the weighted checksum |
8.13 BarcodeLib Code 128 encoder typically follows a greedy or rule-based approach rather than an exhaustive optimization algorithm. While this may not always produce the absolute shortest possible encoding, it balances performance with acceptable barcode length. |
8.14 The final output is a sequence of module widths that represent bars and spaces, which are then rendered according to the configured image parameters. |

|
8.4 Code 93 |
8.15 Code 93 is a compact linear symbology designed as an improvement over Code 39. BarcodeLib includes Code 93 support primarily for compatibility with legacy systems and specialized industrial applications. |
8.16 Internally, Code 93 encoding involves: |
* Character-to-pattern mapping |
* Mandatory checksum calculation using two weighted check characters |
* Start and stop character handling |
8.17 BarcodeLib implements the checksum calculation explicitly, with clear loops and weighting logic that closely follow the published specification. |
8.18 Extended Code 93 support may be present depending on the version, allowing encoding of a broader character set through multi-character expansion. |

|
8.5 Interleaved 2 of 5 (ITF) |
8.19 Interleaved 2 of 5 is a numeric-only symbology commonly used in packaging and warehouse environments. BarcodeLib ITF implementation enforces numeric-only input validation early in the encoding process. |
8.20 Encoding proceeds by processing digits in pairs, interleaving the bar patterns of the first digit with the space patterns of the second digit. |
8.21 BarcodeLib explicitly handles: |
* Even-length enforcement |
* Optional check digit calculation |
* Start and stop pattern insertion |
8.22 The interleaving logic is implemented in a way that mirrors the conceptual description of the symbology, making the code relatively easy to follow for developers studying barcode encoding principles. |

|
8.6 UPC-A and UPC-E |
8.23 BarcodeLib includes support for UPC-A, a fixed-length numeric symbology widely used in retail environments. |
8.24 The UPC-A implementation enforces strict input length requirements and numeric-only validation. Check digit calculation is performed automatically unless explicitly disabled. |
8.25 The encoding logic divides the barcode into left-hand and right-hand halves, applying different parity patterns as required by the standard. |
8.26 UPC-E, a compressed variant of UPC-A, is also supported in many BarcodeLib versions. UPC-E encoding involves expansion and compression rules that determine how the original UPC-A data is represented. |
8.27 BarcodeLib UPC-E logic includes explicit handling of zero-suppression rules, which are among the more error-prone aspects of UPC encoding. |

|
8.7 EAN-8 and EAN-13 |
8.28 EAN symbologies are international counterparts to UPC and are commonly used outside North America. BarcodeLib supports both EAN-8 and EAN-13 formats. |
8.29 EAN-13 encoding includes: |
* Country code and manufacturer code handling |
* Parity pattern determination based on the leading digit |
* Check digit computation |
8.30 BarcodeLib implementation uses parity lookup tables to determine how each digit should be encoded on the left-hand side of the symbol. |
8.31 EAN-8 follows a simpler structure but still includes mandatory checksum handling and strict length validation. |

|
8.8 Codabar |
8.32 Codabar is a numeric symbology with limited alphanumeric support, traditionally used in libraries, blood banks, and logistics. |
8.33 BarcodeLib Codabar implementation supports configurable start and stop characters, which are essential for proper decoding. |
8.34 The encoding logic maps each character to a sequence of bars and spaces with specific width patterns. BarcodeLib typically allows developers to include or exclude start/stop characters from the human-readable text. |
8.35 Codabar relatively loose specification means that BarcodeLib implementation may include configuration options to accommodate variations used by different industries. |

|
8.9 MSI (Modified Plessey) |
8.36 MSI is a numeric-only symbology commonly used for inventory and warehouse labeling. |
8.37 BarcodeLib supports MSI with multiple checksum options, including: |
* No checksum |
* Mod 10 |
* Mod 11 |
* Dual checksum combinations |
8.38 The checksum logic is modular, allowing developers to select the desired variant through configuration settings. |
8.39 Internally, the encoding logic concatenates digit patterns sequentially and appends checksum patterns as required. |

|
8.10 Postnet and Planet |
8.40 Postal symbologies such as Postnet and Planet are included primarily for compatibility with older mailing systems. |
8.41 BarcodeLib implementation focuses on correct bar height representation and check digit calculation, which are critical for postal barcode accuracy. |
8.42 These symbologies are simpler in structure but require precise rendering to ensure scannability, especially with height-differentiated bars. |

|
8.11 Internal Pattern Representation |
8.43 Across all linear symbologies, BarcodeLib typically represents barcode patterns as sequences of integers or booleans indicating bar and space widths. |
8.44 This intermediate representation decouples encoding from rendering, allowing the same encoding logic to be reused across different output formats. |
8.45 Pattern generation code is usually deterministic and stateless, operating solely on the validated input data and configuration parameters. |

|
8.12 Limitations in Two-Dimensional Symbology Support |
8.46 BarcodeLib is primarily a 1D barcode generation library. While some versions or forks may include limited support for two-dimensional codes, such support is not the library primary focus. |
8.47 The absence of full-featured QR Code, Data Matrix, or PDF417 support reflects the increased complexity of 2D barcode encoding and error correction. |
8.48 Developers requiring robust 2D barcode generation often supplement BarcodeLib with specialized libraries rather than extending BarcodeLib itself. |

|
8.13 Symbology Compliance and Specification Fidelity |
8.49 BarcodeLib generally adheres closely to published barcode specifications, but its implementations prioritize practical usability over exhaustive edge-case coverage. |
8.50 In most real-world scenarios, the generated barcodes are fully compliant and scannable by standard barcode readers. |
8.51 Because BarcodeLib is open source, discrepancies or improvements to symbology implementations can be reviewed, discussed, and corrected by the community. |

|
8.14 Performance Characteristics of Symbology Encoding |
8.52 Encoding performance varies by symbology complexity. Simple numeric symbologies such as ITF or MSI encode extremely quickly, even for large batch operations. |
8.53 More complex symbologies like Code 128 incur additional processing overhead due to code set selection and checksum computation, but remain efficient for typical enterprise workloads. |
8.54 BarcodeLib encoding performance is generally sufficient for real-time generation in web applications and high-volume batch processing in desktop or server environments. |

|
8.15 Summary of Part 8 |
8.55 Part 8 has examined the range of barcode symbologies supported by BarcodeLib and the internal principles guiding their implementation. |
8.56 The library symbology coverage reflects a deliberate focus on practical, widely used formats rather than exhaustive standard inclusion. |
8.57 Its clear and readable encoding logic makes BarcodeLib both a production-ready tool and an educational reference for understanding barcode technologies. |