DRIT.Barcode 26.9.1329

dotnet add package DRIT.Barcode --version 26.9.1329
                    
NuGet\Install-Package DRIT.Barcode -Version 26.9.1329
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DRIT.Barcode" Version="26.9.1329" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DRIT.Barcode" Version="26.9.1329" />
                    
Directory.Packages.props
<PackageReference Include="DRIT.Barcode" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DRIT.Barcode --version 26.9.1329
                    
#r "nuget: DRIT.Barcode, 26.9.1329"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DRIT.Barcode@26.9.1329
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DRIT.Barcode&version=26.9.1329
                    
Install as a Cake Addin
#tool nuget:?package=DRIT.Barcode&version=26.9.1329
                    
Install as a Cake Tool

DRIT.Barcode

Pure-Managed .NET Barcode Generation and Recognition Library

Generate and Recognize 60+ Barcode Symbologies with Vector SVG/EMF Output

DRIT.Barcode is a pure-managed .NET library for generating and recognizing barcodes across 60+ symbologies — 1D linear, 2D matrix, GS1 DataBar, postal, and complex barcodes — with all encoding and decoding algorithms implemented from scratch. Rendering is powered by DRIT.Drawing, so any barcode can be emitted as raster (PNG, JPEG, BMP, GIF, TIFF) or true vector (SVG, EMF) output, with no embedded rasters.

Key Benefits

  • Zero external barcode dependencies – all symbology engines and the recognition pipeline are implemented in source
  • 60+ symbologies – 1D, 2D, GS1 DataBar, postal, and complex barcodes (Swiss QR Bill, HIBC, Mailmark)
  • Generation and recognition – BarcodeGenerator produces images; BarCodeReader decodes from images with quality presets
  • True vector output – SVG and EMF with vector bar geometry, not embedded rasters
  • GS1-first – Application Identifier parsing, GS1-128, GS1 DataMatrix, GS1 QR, and GS1 Composite Bar
  • Familiar API – follows established .NET barcode library conventions, easy to pick up

Cross-Platform Barcode Library

DRIT.Barcode targets .NET 8.0, so it runs on:

  • Operating Systems: Windows, Linux, macOS
  • Frameworks: .NET 8.0+
  • Dependencies: DRIT.Drawing (rendering + codecs), DRIT.Pdf (PDF output)

Features

Barcode Generation

Generate barcode images for 60+ symbologies via BarcodeGenerator with full visual customization:

  • 1D linear barcodes – Code 39/93/128, EAN/UPC, Codabar, ITF, 2-of-5 family, Code 16K, Codablock-F, Patch Code
  • GS1 DataBar – Omnidirectional, Truncated, Stacked, Stacked Omnidirectional, Limited, Expanded, Expanded Stacked
  • 2D matrix barcodes – QR, DataMatrix, PDF417 (Micro/Macro/Compact), Aztec, MaxiCode, Han Xin, DotCode
  • Postal barcodes – Australia Post, POSTNET, PLANET, OneCode, RM4SCC, Singapore Post, Dutch KIX, Mailmark
  • Complex barcodes – Swiss QR Bill, HIBC LIC/PAS, Mailmark codetext, MaxiCode codetext

Barcode Recognition

Read barcodes from images via BarCodeReader with flexible quality and search controls:

  • 1D recognition – Code 39/93/128, GS1-128, Codabar, EAN-13/8, UPC-A/E, Interleaved 2 of 5, HIBC
  • 2D recognition – QR, GS1 QR, DataMatrix, GS1 DataMatrix, PDF417, Aztec
  • Quality presets – HighPerformance, NormalQuality, HighQuality, MaxQuality, MaxBarCodes
  • Multi-region search – target specific areas of the image
  • Inverted-image recognition – detect white-on-black barcodes
  • Checksum validation and GS1/HIBC text formatting on decoded results

GS1 Support

Full GS1 Application Identifier handling on both generation and recognition:

  • Parse parentheses/bracket notation into FNC1-separated raw codetext
  • Format decoded GS1 data back to human-readable parentheses notation
  • GS1-128, GS1 DataMatrix, GS1 QR, and GS1 Composite Bar symbologies

Visual Customization

Control every aspect of barcode appearance:

  • Bar and background colors
  • Code text font, size, placement (above/below/none), and alignment
  • Captions above and below the barcode
  • Borders with dash styles, width, and color
  • Padding, rotation angle, resolution (DPI)
  • X-dimension, bar height, bar width reduction
  • Auto-sizing modes (Nearest, Interpolation)

Output Formats

Format Type Description
PNG Raster Lossless, alpha — default
JPEG Raster Lossy
BMP Raster Uncompressed
GIF Raster 256-color, LZW
TIFF Raster Lossless
TIFF (CMYK) Raster CMYK color space for print
SVG Vector True vector — scalable, no embedded raster
EMF Vector Enhanced Metafile — true vector
PDF Document Via DRIT.Pdf

Supported Symbologies

Category Symbologies
1D Linear Code 11, Code 39 Std/Ext, Code 93 Std/Ext, Code 128, GS1-128, Codabar, Code 16K, Codablock-F, Patch Code, Interleaved 2 of 5, Standard/IATA/Matrix/Italian Post/COOP 2 of 5, EAN-13, EAN-8, UPC-A, UPC-E, EAN-14, ISBN, ISSN, Bookland EAN, Supplement, Deutsche Post Identcode/Leitcode
GS1 DataBar Omnidirectional, Truncated, Stacked, Stacked Omnidirectional, Limited, Expanded, Expanded Stacked
2D QR, GS1 QR, PDF417, Micro PDF417, Macro PDF417, Compact PDF417, DataMatrix, GS1 DataMatrix, Aztec, Aztec Rune, MaxiCode, Han Xin, DotCode, GS1 Composite Bar, UPC-A GS1 Coupon
Postal Australia Post, POSTNET, PLANET, OneCode, RM4SCC, Singapore Post, Dutch KIX, Mailmark
Complex Swiss QR Bill, HIBC LIC (Code 128/39), HIBC PAS (Code 128/39), Mailmark, MaxiCode codetext

Installation

1. Install via NuGet

  • Open Microsoft Visual Studio and the NuGet package manager
  • Search for "DRIT.Barcode"
  • Click Install to download and reference it in your project

2. Install via Package Manager Console

Install-Package DRIT.Barcode

3. Install via .NET CLI

dotnet add package DRIT.Barcode

Code Examples

Generate a Barcode

using DRIT.Barcode;
using DRIT.Barcode.Generation;

// Create a barcode generator for Code 128
using var gen = new BarcodeGenerator(EncodeTypes.Code128, "DRIT.Barcode");

// Configure bar dimensions
gen.Parameters.Barcode.XDimension.Pixels = 2f;
gen.Parameters.Barcode.BarHeight.Pixels = 80f;

// Save as PNG
gen.Save("barcode.png", BarCodeImageFormat.Png);

Recognize Barcodes

using DRIT.Barcode;
using DRIT.Barcode.Recognition;

// Create a reader for Code 128
using var reader = new BarCodeReader("barcode.png", DecodeType.Code128);

// Read all barcodes in the image
BarCodeResult[] results = reader.ReadBarCodes();

foreach (BarCodeResult result in results)
{
    Console.WriteLine("Type:   {0}", result.CodeTypeName);
    Console.WriteLine("Text:   {0}", result.CodeText);
}

Generate to Vector SVG and EMF

using DRIT.Barcode;
using DRIT.Barcode.Generation;

// Any barcode can be emitted as true vector output
using var gen = new BarcodeGenerator(EncodeTypes.QR, "https://github.com/dritsoftware/DRIT.Barcode");
gen.Parameters.Barcode.XDimension.Pixels = 4f;

// True vector — bars are drawn as vector rectangles, not embedded rasters
gen.Save("qr.svg", BarCodeImageFormat.Svg);
gen.Save("qr.emf", BarCodeImageFormat.Emf);

GS1 Barcodes

using DRIT.Barcode;
using DRIT.Barcode.Generation;

// GS1-128 with Application Identifiers in parentheses notation
using var gen = new BarcodeGenerator(
    EncodeTypes.GS1Code128, "(01)12345678901231(10)LOT123(17)251231");
gen.Save("gs1-128.png", BarCodeImageFormat.Png);

// GS1 DataMatrix
using var dm = new BarcodeGenerator(
    EncodeTypes.GS1DataMatrix, "(01)04212345678905(11)250101");
dm.Save("gs1-dm.png", BarCodeImageFormat.Png);

Swiss QR Bill

using DRIT.Barcode;
using DRIT.Barcode.Complex;

var bill = new SwissQRBill
{
    CreditorIBAN = "CH4431999123000889012",
    CreditorName = "Robert Schneider",
    CreditorAddress = "Rue du Lac 1268",
    CreditorPostalCode = "2501",
    CreditorCity = "Biel",
    CreditorCountry = "CH",
    Amount = 199.95m,
    Currency = "CHF",
    ReferenceType = "QRR",
    Reference = "210000000003139471430009017",
    UnstructuredMessage = "Invoice 2025-001",
};

using var gen = new ComplexBarcodeGenerator(bill);
gen.Save("swiss-qr.png", BarCodeImageFormat.Png);

Visual Customization

using DRIT.Barcode;
using DRIT.Barcode.Generation;

using var gen = new BarcodeGenerator(EncodeTypes.EAN13, "5901234123457");

// Code text placement and font
gen.Parameters.CodeTextParameters.Visible = true;
gen.Parameters.CodeTextParameters.Location = CodeLocation.Below;
gen.Parameters.CodeTextParameters.Font.FamilyName = "Arial";
gen.Parameters.CodeTextParameters.Font.Size.Point = 8f;

// Captions
gen.Parameters.CaptionAbove.Text = "DRIT.Barcode";
gen.Parameters.CaptionAbove.Visible = true;
gen.Parameters.CaptionBelow.Text = "EAN-13";
gen.Parameters.CaptionBelow.Visible = true;

// Border and padding
gen.Parameters.Border.Visible = true;
gen.Parameters.Border.Width.Pixels = 2f;
gen.Parameters.Padding.Left.Pixels = 10f;
gen.Parameters.Padding.Right.Pixels = 10f;

// Resolution
gen.Parameters.Resolution = 300f;

gen.Save("ean13.png", BarCodeImageFormat.Png);

Recognition with Quality Presets

using DRIT.Barcode;
using DRIT.Barcode.Recognition;

using var reader = new BarCodeReader("photo.jpg", DecodeType.AllSupportedTypes);

// Maximize accuracy at the cost of speed
reader.QualitySettings = QualitySettings.MaxQuality;

BarCodeResult[] results = reader.ReadBarCodes();
Console.WriteLine("Found {0} barcode(s).", results.Length);

System Requirements

  • Target Frameworks: .NET 8.0+
  • Dependencies: DRIT.Drawing (rendering + codecs), DRIT.Pdf (PDF output)

Credits

DRIT.Barcode's encoding and decoding algorithms were developed using freely available knowledge sources — Wikipedia articles, public specifications (GS1, USPS, Swiss QR Bill), and the following open-source projects, whose source code served as a reference and was ported to C#:

Project License Used For
ZXing Apache 2.0 1D/2D encoding and recognition algorithms (Code 39/93/128, EAN/UPC, Codabar, ITF, QR, DataMatrix, PDF417, Aztec, MaxiCode)
Zint BSD-3-Clause Symbologies not in ZXing (Code 11, Code 16K, Codablock-F, Patch Code, 2-of-5 variants, DataBar, GS1 Composite, Han Xin, DotCode, postal barcodes, HIBC, Mailmark)
libdmtx BSD-2-Clause DataMatrix encoding reference
QRCoder MIT QR encoding reference
BarcodeLib Apache 2.0 Code 39 / Code 128 encoding reference

© 2026 DR-IT Ltd. All Rights Reserved.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
26.9.1329 58 9/15/2026

- Initial release.
     - 60+ barcode symbologies with generation and recognition support.
     - Raster, vector SVG/EMF, and PDF output.