How to Generate Codabar and Code 11 Barcodes for Healthcare and Library Applications in .NET

How to Generate Codabar and Code 11 Barcodes for Healthcare and Library Applications in .NET

What Are Codabar and Code 11 Barcodes?

Codabar is a numeric barcode widely used in blood banks, libraries, and parcel services, supporting digits 0-9 plus A-D for start/stop symbols. Code 11 is used for telecom inventory and identification, supporting digits 0-9 and dash (-). Both are simple, scanner-friendly, and ideal for institutional workflows.


Quick Start (Minimal Example)

using Aspose.BarCode.Generation;
var generator = new BarcodeGenerator(EncodeTypes.Codabar, "A123456B");
generator.Save("codabar-bloodbank.png", BarCodeImageFormat.Png);

Table of Contents

  1. Introduction
  2. What Are Codabar and Code 11 Barcodes?
  3. Quick Start (Minimal Example)
  4. Prerequisites
  5. Step-by-Step Implementation
  6. Check Digit and Customization Options
  7. Customizing Barcode Appearance
  8. Supported Output Formats
  9. Troubleshooting & Common Issues
  10. FAQs
  11. Use Cases and Applications
  12. Best Practices
  13. Related Articles
  14. Conclusion

Introduction

This article covers how to generate Codabar and Code 11 barcodes for healthcare, library, telecom, and parcel tracking using Aspose.BarCode for .NET. C# code and workflow tips are included.


Prerequisites

  • Visual Studio 2019 or later
  • .NET 6.0+ or .NET Framework 4.6.2+
  • Aspose.BarCode for .NET (NuGet)
  • Basic C# knowledge
PM> Install-Package Aspose.BarCode 

Step-by-Step Implementation

Codabar Example:

using Aspose.BarCode.Generation;
BarcodeGenerator gen = new BarcodeGenerator(EncodeTypes.Codabar, "A123456B");
gen.Save("codabar-bloodbank.png", BarCodeImageFormat.Png);

Code 11 Example:

BarcodeGenerator gen = new BarcodeGenerator(EncodeTypes.Code11, "12345-6789");
gen.Save("code11-telecom.png", BarCodeImageFormat.Png);

Check Digit and Customization Options

  • Code 11 Check Digit: csgen.Parameters.Barcode.Code11.EnableChecksum = true;
  • Bar Height/Width: csgen.Parameters.Barcode.BarHeight.Pixels = 80; gen.Parameters.Barcode.XDimension.Pixels = 2;
  • Color/Background: csgen.Parameters.Barcode.BarColor = Color.MidnightBlue; gen.Parameters.Barcode.BackColor = Color.White;
  • Caption: csgen.Parameters.CaptionBelow\.Visible = true;

Customizing Barcode Appearance

  • See above for bar height, width, and color
  • Adjust XDimension and BarHeight for label size
  • Use SVG or PNG for crisp printing

Supported Output Formats

  • PNG, JPEG, BMP – Print and digital
  • TIFF – Archival or medical/lab printers
  • SVG, EMF – Large-scale or digital labels

Troubleshooting & Common Issues

  • Barcode not scanning?

    • Use only valid characters; ensure proper start/stop symbols for Codabar.
  • Checksum errors?

    • Enable/disable checksum to match scanner or app expectations.
  • Small label not fitting?

    • Lower BarHeight and XDimension.

FAQs

Q: Are these barcodes accepted in modern healthcare and libraries? A: Yes—both are used worldwide for legacy and new workflows.

Q: Can I encode text with Codabar? A: No—Codabar is numeric with A-D for start/stop only.


Use Cases and Applications

  • Blood bank labeling (Codabar)
  • Library and lending management
  • Parcel and mail tracking
  • Telecom asset/inventory (Code 11)

Best Practices: Quick Reference Table

TipDoDon’t
CharsetCodabar: 0-9,A-D; Code 11: 0-9,-Use letters or symbols
Start/StopUse A-D for CodabarOmit start/stop characters
Output FormatSVG/PNG for crisp outputLow-res JPG for printing
Check DigitEnable if workflow requiresEnable randomly

Conclusion

Codabar and Code 11 remain essential for healthcare, library, and legacy tracking workflows. Aspose.BarCode for .NET makes their generation and integration simple. See the Aspose.BarCode API Reference for more examples and options.

 English