Runnable C# examples for IronBarcode, a .NET barcode and QR code library that reads and generates Code 39/93/128, UPC-A/E, EAN-8/13, PDF417, Aztec, Data Matrix, QR, Micro QR, and 20+ other symbologies from images, PDFs, and streams.
dotnet add package BarCodeusing IronBarCode;
// Generate a barcode and save it
var barcode = BarcodeWriter.CreateBarcode("PKG-2026-88421", BarcodeEncoding.Code128);
barcode.ResizeTo(400, 100);
barcode.SaveAsPng("shipping-label.png");
// Read barcodes back from an image or PDF
var results = BarcodeReader.Read("shipping-label.png");
foreach (var result in results)
{
Console.WriteLine($"{result.BarcodeType}: {result.Value}");
}For QR codes, swap in QRCodeWriter.CreateQrCode("https://example.com", 300), which supports error correction levels and CreateQrCodeWithLogo for branded codes. To read barcodes from PDFs, use BarcodeReader.ReadPdf("document.pdf").
For production use, set a license key via License.LicenseKey = "YOUR-KEY". Without one, generated barcodes include a watermark.
Each folder contains a self-contained .NET project you can open and run:
examples/— focused snippets demonstrating individual featuresget-started/— minimal first projects covering installation and basic generationhow-to/— task-oriented guides for specific barcode operationsquickstart/— end-to-end project scaffoldstutorials/— longer walkthroughs combining multiple features
- Generating linear barcodes: Code 39, Code 93, Code 128, EAN-8, EAN-13, UPC-A, UPC-E, ITF, Codabar, MSI Plessey
- Generating 2D barcodes: QR, Micro QR, Aztec, Data Matrix, PDF417, MaxiCode
- Reading barcodes from images, PDFs, bitmaps, and streams
- Multi-barcode scanning with automatic detection
- Image preprocessing: deskew, denoise, sharpen, threshold, contrast adjustment
- Fluent styling: colors, margins, annotation text, resizing
- QR code customization: error correction levels, embedded logos, color theming
- Export formats: PNG, JPEG, BMP, TIFF, GIF, PDF, HTML, SVG
- Reading with
BarcodeReaderOptionsfor parallel multi-threaded scanning
.NET 8, 7, 6, 5, .NET Core, .NET Standard, and .NET Framework. Windows, macOS, Linux, Docker, Azure, and AWS. See the installation docs for environment-specific notes.
- Full documentation: ironsoftware.com/csharp/barcode/docs
- API reference: ironsoftware.com/csharp/barcode/object-reference/api
- Issues with these examples: file directly on this repository
- Product support: support@ironsoftware.com
This repository is maintained by Iron Software. IronBarcode is a commercial library — see licensing for terms and trial details.