ZXingCpp 0.5.4
dotnet add package ZXingCpp --version 0.5.4
NuGet\Install-Package ZXingCpp -Version 0.5.4
<PackageReference Include="ZXingCpp" Version="0.5.4" />
<PackageVersion Include="ZXingCpp" Version="0.5.4" />
<PackageReference Include="ZXingCpp" />
paket add ZXingCpp --version 0.5.4
#r "nuget: ZXingCpp, 0.5.4"
#:package ZXingCpp@0.5.4
#addin nuget:?package=ZXingCpp&version=0.5.4
#tool nuget:?package=ZXingCpp&version=0.5.4
ZXingCpp
ZXingCpp is a high-performance .NET barcode reader and writer powered by zxing-cpp, with a modern API. It supports all major linear and matrix barcode formats like QRCode, DataMatrix, PDF417, EAN/UPC, Code128, etc. It is 5x-50x faster than ZXing.NET, supports more barcode formats (symbologies) and has a higher detection rate on difficult images.
Read barcodes
SkiaSharp is used here because it works consistently across Windows, Linux, and macOS.
using SkiaSharp;
using ZXingCpp;
using var img = SKBitmap.Decode(args[0]).Copy(SKColorType.Gray8);
using var reader = new BarcodeReader {
Formats = args.Length > 1 ? BarcodeFormats.Parse(args[1]) : BarcodeFormat.All,
TryInvert = false,
// see the ReaderOptions for more available options
};
var barcodes = reader.Read(img.GetPixels(), img.RowBytes * img.Info.Height,
img.Info.Width, img.Info.Height, ImageFormat.Lum, img.RowBytes);
foreach (var b in barcodes) {
Console.WriteLine($"{b.Format}: {b.Text}");
b.Dispose();
}
BarcodeReader.Read accepts byte arrays on all targets and ReadOnlySpan<byte> on .NET 5 and later.
These overloads do not copy pixels; managed buffers are pinned only for the synchronous scan. Do not modify the pixels during a scan.
For native image buffers, pass the pointer, available byte count, dimensions, format, and row stride. The caller must keep the
buffer and its owner alive and unchanged until the call returns. Dispose readers, options, images, and returned barcodes when finished.
Executing this sample code from the command line would look like this:
dotnet run -- <image-file-name> [barcode-format-list]
Write barcodes
using ZXingCpp;
using var barcode = new Barcode(args[1], BarcodeFormat.Parse(args[0]));
File.WriteAllText(args[2], barcode.ToSVG());
Executing this sample code from the command line would look like this:
dotnet run -- <barcode-format> <text> <out-svg-file-name>
Why ZXingCpp
- Fast native-core decoding and encoding (5x-50x faster than ZXing.Net).
- Strong real-world detection performance, especially for QRCode.
- Broad format support (QRCode, DataMatrix, PDF417, EAN/UPC, Code128, and more).
- Standards-compliant binary and ECI handling (
bytesECI()). - Apache-2.0 licensed and free for commercial use (Commercial Support available).
For comparative results with other .NET barcode libraries, see zxing-bench.
Platform support
The NuGet package includes native libraries for x64 and arm64 on Windows, Linux, and macOS. Version 0.5.4 includes zxing-cpp-v3.2.0
If you need to override native loading, ensure .NET can find [lib]ZXing[.dll|.so|.dylib]
(for example via PATH on Windows or LD_LIBRARY_PATH on Linux).
More examples
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 is compatible. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
-
net5.0
- No dependencies.
NuGet packages (4)
Showing the top 4 NuGet packages that depend on ZXingCpp:
| Package | Downloads |
|---|---|
|
BarcodeScanning.Native.Maui
Barcode scanning library for .NET MAUI |
|
|
ZplCore
zplCore.com – High Performance .NET Labelprint Engine. Cross-platform ZPL II / EPL label rendering engine for .NET: parses Zebra label code and renders it to PNG/PDF/bitmaps with SkiaSharp, including 1D/2D barcodes and embedded fonts. |
|
|
ZplCore.VectorLift
zplCore.com Vector-Lift: converts PDF and SVG labels (e.g. carrier label PDFs) into native ZPL – real text fields, native barcodes, boxes, lines and circles instead of a ^GF raster – with a measured fidelity report. PDF parsing and reference rendering via PDFium (BSD-3-Clause). |
|
|
LifeOS.Pdf.Barcode.Scanning
Read QR codes and barcodes (zxing-cpp) from images and PDF documents. |
GitHub repositories (2)
Showing the top 2 popular GitHub repositories that depend on ZXingCpp:
| Repository | Stars |
|---|---|
|
afriscic/BarcodeScanning.Native.Maui
Barcode scanning library for .NET MAUI
|
|
|
guitarrapc/FeatherQR
High-performance QR code generator/reader with renderes support
|
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 0.5.4 | 0 | 11/24/2026 | |
| 0.5.4-rc1 | 134 | 11/13/2026 | |
| 0.5.3 | 45,075 | 7/29/2026 | |
| 0.5.2 | 25,553 | 7/7/2026 | |
| 0.5.1 | 30,249 | 2/17/2026 | |
| 0.5.0 | 19,984 | 2/13/2026 | |
| 0.4.0-alpha | 17,089 | 1/4/2025 | |
| 0.3.0-alpha | 401 | 11/5/2024 | |
| 0.2.2-alpha | 2,920 | 9/8/2024 |