A Comparison Between ZXing Decoder & IronBarcode

Barcodes are everywhere. Barcode scanning implementations are used by authors to sign their products, and most book signatures are powered by barcode scanning implementations. For our applications however, a barcode scanner may not always be appropriate. You may have digital images and videos of barcodes and want to know what they stand for in English text. Additionally, only 1-D barcodes, which can only be used in the Windows RT Class library and have a limited amount of data, can be read by a barcode scanner. 2-D barcodes, also referred to as QR codes, are widely used today and can store a lot more data in their data matrix.

ZXing (Zebra Crossing) is an open-source, multi-format 1D/2D barcode image processing library implemented in Java, with ports to other languages. It can read and write data in many different barcode formats, including QR codes and UPC codes on computers.

IronBarcode is a C# .NET software library that allows developers to read and write barcode images using the ZXing library for web application testing. It is designed to be simple to use and easy to integrate into any .NET application, and it can be used with the Windows Forms, WPF, and ASP.NET frameworks.

IronBarcode's library provides a simple API for reading and writing barcode images, making it easy for developers to add barcode scanning and generation functionality to their software. IronBarcode supports reading and writing many different barcode formats, including QR codes, UPC codes, UPC-A codes, EAN codes, RSS expanded, and more, which are used to sign products.

A Comparison Between IronBarcode and ZXing .NET, Figure 1: Supported Barcode Formats

Supported Barcode Formats

The library has well-written documentation and sample code that shows how to get started with IronBarcode, how to scan and decode barcodes, how to generate and encode barcodes, and how to customize the reading and writing process.

One of the most important features of IronBarcode is its support for barcode recognition and QR code recognition from PDF documents or image files, with the ability to read barcodes from a file path or a bitmap object.

IronBarcode is easy to use, powerful, and fast. It is a great tool for anyone who needs to add barcode scanning or generation functionality to their software. And since it is built on top of the popular and reliable ZXing library, you can be confident that it is a reliable and high-quality solution.

A Comparison Between IronBarcode and ZXing .NET, Figure 2: Supported Barcode Formats

IronBarcode C# Library & its Features

How IronBarcode was Created from ZXing Decoder

IronBarcode is a commercial, third-party .NET library for decoding barcodes in C# and VB.NET, which uses the open-source ZXing library as its underlying engine. The library provides a simplified, easy-to-use API for working with barcodes, as well as additional functionality such as the ability to read barcodes from images and PDFs, and the ability to create barcodes in a variety of formats.

IronBarcode was created by a team of developers who wanted to build a more user-friendly and feature-rich barcode decoding library for the .NET ecosystem. They leveraged the ZXing library, which is a mature, open-source library with a wide range of supported barcode formats, as the foundation of their library. They then built their own custom wrapper around the ZXing codebase, providing a simpler and more consistent API for developers to use, as well as additional features such as support for reading barcodes from images and PDFs.

Comparing IronBarcode to ZXing Decoder

IronBarcode and ZXing are both libraries for decoding barcode images, but they have some important differences that make IronBarcode a more advanced and versatile option.

IronBarcode offers a wider range of supported Web barcode formats than ZXing. IronBarcode can decode supported formats such as QR codes, Code 39, Code 128, EAN -8, EAN -13, UPC-A, UPC-E, Codabar, ITF, Data Matrix, PDF-417, RSS expanded and more. Android users are not excluded; IronBarcode can be easily integrated into mobile applications to make barcode scanning easier for Android users. ZXing supports many of the same formats, but does not have full support for certain formats such as ITF and Codabar, and does not offer support for certain 2D barcode formats such as PDF-417.

// Generate a Simple BarCode image and save as PDF
QRCodeWriter.CreateQrCode("hello world", 500, QRCodeWriter.QrErrorCorrectionLevel.Medium).SaveAsPng("MyQR.png");
// Generate a Simple BarCode image and save as PDF
QRCodeWriter.CreateQrCode("hello world", 500, QRCodeWriter.QrErrorCorrectionLevel.Medium).SaveAsPng("MyQR.png");
' Generate a Simple BarCode image and save as PDF
QRCodeWriter.CreateQrCode("hello world", 500, QRCodeWriter.QrErrorCorrectionLevel.Medium).SaveAsPng("MyQR.png")
VB   C#
A Comparison Between IronBarcode and ZXing .NET, Figure 3: Generating Barcode

Generating a Simple QR Code Image using IronBarcode

Another advantage of IronBarcode is its more user-friendly web API. The library is designed to be simple to use and easy to integrate into existing projects, with a high-level Web API that abstracts away many of the complex details of barcode decoding.

IronBarcode also has better performance than ZXing. The library was developed in C# and is able to use parallel processing to decode barcodes faster than the ZXing library. In addition, IronBarcode can read barcodes from image file types not supported by ZXing, such as GIF, TIFF, and JPEG-XR.

A Comparison Between IronBarcode and ZXing .NET, Figure 4: Generating Barcode

Generating a Simple QR Code Image using IronBarcode

In summary, IronBarcode is a more advanced and versatile barcode decoding library than ZXing. It offers a wider range of supported barcode formats, a more user-friendly API and better performance, making it a good choice for developers working with the .NET framework.

How to use ZXing Decoder and IronBarcode in C#

ZXing .NET is a port of the ZXing library, an open source library for processing 1D/2D barcodes in multiple formats, originally implemented in Java. It has been ported to C# and is available through the NuGet package manager. IronBarcode is a C# .NET Library that can read and write barcodes. It is a wrapper around the ZXing library and is also available via NuGet.

In this tutorial, we will use both ZXing decoder online and IronBarcode to decode barcodes in a C# .NET Web application to decode barcodes. We will use Visual Studio for this tutorial, but the concepts should apply to any C# development environment.

Step 1: Create a new C# .NET project in Visual Studio

Create a new C# project in Visual Studio by going to File > New > Project. Select "Windows Forms App" and give your project a name.

Step 2: Install the ZXing .NET and IronBarcode NuGet packages

In the Solution Explorer, right-click on the project and select "Manage NuGet Packages." Search for ZXing.NET and "IronBarcode" and install them to the project.

Step 3: Add a PictureBox and a Button to the Form

In the Design view of the Form, add a PictureBox and a Button to the Form. The PictureBox will be used to display the image that we will be decoding, and the Button will be used to initiate the decoding process.

Step 4: Add the following using statements to the top of the Form's code:

using IronBarCode;
using ZXing;
using IronBarCode;
using ZXing;
Imports IronBarCode
Imports ZXing
VB   C#

Step 5: Handle the Button's click event

Double-click on the Button in the Design view to create a click event handler. In the handler, add the following code to open an OpenFileDialog and let the user select an image to decode:

private void button1_Click(object sender, EventArgs e) {
    OpenFileDialog ofd = new OpenFileDialog();
    ofd.Filter = "Images (*.BMP;*.JPG;*.GIF;*.PNG)|*.BMP;*.JPG;*.GIF;*.PNG|All files (*.*)|*.*";
    ofd.FilterIndex = 1;
    if (ofd.ShowDialog() == DialogResult.OK) {
        pictureBox1.Image = Image.FromFile(ofd.FileName);
        // Decode the barcode from the image here
    }
}
private void button1_Click(object sender, EventArgs e) {
    OpenFileDialog ofd = new OpenFileDialog();
    ofd.Filter = "Images (*.BMP;*.JPG;*.GIF;*.PNG)|*.BMP;*.JPG;*.GIF;*.PNG|All files (*.*)|*.*";
    ofd.FilterIndex = 1;
    if (ofd.ShowDialog() == DialogResult.OK) {
        pictureBox1.Image = Image.FromFile(ofd.FileName);
        // Decode the barcode from the image here
    }
}
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
	Dim ofd As New OpenFileDialog()
	ofd.Filter = "Images (*.BMP;*.JPG;*.GIF;*.PNG)|*.BMP;*.JPG;*.GIF;*.PNG|All files (*.*)|*.*"
	ofd.FilterIndex = 1
	If ofd.ShowDialog() = DialogResult.OK Then
		pictureBox1.Image = Image.FromFile(ofd.FileName)
		' Decode the barcode from the image here
	End If
End Sub
VB   C#

Step 6: Decode the barcode from the image

After the following line:

pictureBox1.Image = Image.FromFile(ofd.FileName); 
pictureBox1.Image = Image.FromFile(ofd.FileName); 
pictureBox1.Image = Image.FromFile(ofd.FileName)
VB   C#

Add the following code block to decode the barcode from the image in the button click event handler.

var BarcodeReader = new BarcodeReader();
var Result = BarcodeReader.Decode((Bitmap)pictureBox1.Image);
if (Result != null) {
    MessageBox.Show(Result.Text);
} else {
    MessageBox.Show("No barcode found.");
}
var BarcodeReader = new BarcodeReader();
var Result = BarcodeReader.Decode((Bitmap)pictureBox1.Image);
if (Result != null) {
    MessageBox.Show(Result.Text);
} else {
    MessageBox.Show("No barcode found.");
}
Dim BarcodeReader As New BarcodeReader()
Dim Result = BarcodeReader.Decode(CType(pictureBox1.Image, Bitmap))
If Result IsNot Nothing Then
	MessageBox.Show(Result.Text)
Else
	MessageBox.Show("No barcode found.")
End If
VB   C#

This code creates a new instance of the BarcodeReader class from ZXing.NET and then uses the Decode method to decode the barcode from the image. The Decode method returns a Result object, which contains information about the barcode that was decoded.

A Comparison Between IronBarcode and ZXing .NET, Figure 5: Create QR Code with Logo Image

Create QR Code with Logo Image

IronBarcode's Benefits Compared to ZXIng Decoder Online

IronBarcode and ZXing are both barcode and QR code reading libraries for the C# programming language. Both libraries have their own advantages and disadvantages, and the choice between them will depend on the specific requirements of your project.

One of the main advantages of IronBarcode over ZXing is its ease of use. IronBarcode has a simple and intuitive API that makes it easy for developers to quickly start working with barcodes and QR codes. With a few lines of code, you can read and write barcodes and QR codes with minimal effort. In contrast, ZXing has a more complex API that can be challenging for developers, especially if they are new to reading barcodes and QR codes.

Another advantage of IronBarcode is its high performance. IronBarcode uses advanced algorithms to quickly read and decode barcodes and QR codes, making it faster than other libraries like ZXing. This makes it a good choice for projects that require fast scanning and decoding of barcodes and QR codes.

IronBarcode also provides better support for reading and writing barcodes from a variety of image formats, including JPEG, PNG, GIF, BMP and TIFF. In contrast, ZXing's support for image formats is more limited, and it may not be able to read or write barcodes from certain types of images.

using IronBarCode;
using System;
using System.Drawing;
// All BarcodeResult.Read methods provide the developer with control to correct image and photograph correction and straightening rotation and perspective from skewed images
// * RotationCorrection   e.g BarcodeReader.BarcodeRotationCorrection.Extreme  un-rotates and removes perspective from barcode images.
// * ImageCorrection      e.g BarcodeReader.BarcodeImageCorrection.DeepCleanPixels  separates Barcodes from background imagery and digital noise.
// * BarcodeEncoding      e.g. BarcodeEncoding.Code128  Setting a specific Barcode format improves speed and reduces the risk of false positive results
// Example with a photo image
var PhotoResult = BarcodeReader.ReadASingleBarcode("Photo.png", BarcodeEncoding.Code128, BarcodeReader.BarcodeRotationCorrection.Medium, BarcodeReader.BarcodeImageCorrection.DeepCleanPixels);
string Value = PhotoResult.Value;
System.Drawing.Bitmap Img = PhotoResult.BarcodeImage;
BarcodeEncoding BarcodeType = PhotoResult.BarcodeType;
byte[] Binary = PhotoResult.BinaryValue;
Console.WriteLine(PhotoResult.Value);  
using IronBarCode;
using System;
using System.Drawing;
// All BarcodeResult.Read methods provide the developer with control to correct image and photograph correction and straightening rotation and perspective from skewed images
// * RotationCorrection   e.g BarcodeReader.BarcodeRotationCorrection.Extreme  un-rotates and removes perspective from barcode images.
// * ImageCorrection      e.g BarcodeReader.BarcodeImageCorrection.DeepCleanPixels  separates Barcodes from background imagery and digital noise.
// * BarcodeEncoding      e.g. BarcodeEncoding.Code128  Setting a specific Barcode format improves speed and reduces the risk of false positive results
// Example with a photo image
var PhotoResult = BarcodeReader.ReadASingleBarcode("Photo.png", BarcodeEncoding.Code128, BarcodeReader.BarcodeRotationCorrection.Medium, BarcodeReader.BarcodeImageCorrection.DeepCleanPixels);
string Value = PhotoResult.Value;
System.Drawing.Bitmap Img = PhotoResult.BarcodeImage;
BarcodeEncoding BarcodeType = PhotoResult.BarcodeType;
byte[] Binary = PhotoResult.BinaryValue;
Console.WriteLine(PhotoResult.Value);  
Imports IronBarCode
Imports System
Imports System.Drawing
' All BarcodeResult.Read methods provide the developer with control to correct image and photograph correction and straightening rotation and perspective from skewed images
' * RotationCorrection   e.g BarcodeReader.BarcodeRotationCorrection.Extreme  un-rotates and removes perspective from barcode images.
' * ImageCorrection      e.g BarcodeReader.BarcodeImageCorrection.DeepCleanPixels  separates Barcodes from background imagery and digital noise.
' * BarcodeEncoding      e.g. BarcodeEncoding.Code128  Setting a specific Barcode format improves speed and reduces the risk of false positive results
' Example with a photo image
Private PhotoResult = BarcodeReader.ReadASingleBarcode("Photo.png", BarcodeEncoding.Code128, BarcodeReader.BarcodeRotationCorrection.Medium, BarcodeReader.BarcodeImageCorrection.DeepCleanPixels)
Private Value As String = PhotoResult.Value
Private Img As System.Drawing.Bitmap = PhotoResult.BarcodeImage
Private BarcodeType As BarcodeEncoding = PhotoResult.BarcodeType
Private Binary() As Byte = PhotoResult.BinaryValue
Console.WriteLine(PhotoResult.Value)
VB   C#
A Comparison Between IronBarcode and ZXing .NET, Figure 6: Reading a barcode from a phone camera in C#

Reading a barcode from a phone camera image in C#

IronBarcode offers more options for customization, such as fine-tuning barcode reading, supporting multi-page documents, and various barcode formats, such as DataMatrix, Aztec, and PDF-417. This can be useful if you need to work with different types of barcodes or have specific requirements.

On the other hand, ZXing is an open-source library that is free to use. This may be a significant advantage for projects with budget constraints.

In conclusion, both IronBarcode and ZXing are powerful libraries for working with barcodes and QR codes in C#, but IronBarcode offers several advantages over ZXing, such as ease of use, high performance, better image format support, and more customization options. It is best to evaluate both libraries and choose the one that best fits the needs of your project.

IronBarcode and ZXing are both popular libraries for working with barcodes and QR codes in C#. Both libraries have their own advantages and disadvantages, and the choice between them will depend on the specific requirements of your project. In this article, we will take a detailed look at the benefits of using IronBarcode over ZXing, with examples to help illustrate the key differences.

One of the main advantages of IronBarcode is its ease of use. IronBarcode has a straightforward and intuitive API that makes it easy for developers to quickly start working with barcodes and QR codes. With just a few lines of code, you can read and write barcodes and QR codes with minimal effort. For example, to read a barcode from an image file using IronBarcode, you can use the following code:

var reader = new BarcodeReader();
var result = reader.Read("image.jpg");
Console.WriteLine(result.Text);
var reader = new BarcodeReader();
var result = reader.Read("image.jpg");
Console.WriteLine(result.Text);
Dim reader = New BarcodeReader()
Dim result = reader.Read("image.jpg")
Console.WriteLine(result.Text)
VB   C#

In contrast, ZXing has a more complex API that can be challenging for developers to work with, particularly if they are new to barcode and QR code reading. The example provided above would have taken more lines of code to achieve the same result using ZXing.

Another advantage of IronBarcode is its high performance. IronBarcode uses advanced algorithms to quickly read and decode barcodes and QR codes, making it faster than other libraries like ZXing. This makes it a good choice for projects that require high-speed scanning and decoding of barcodes and QR codes. For example, IronBarcode can read and decode a barcode from an image in less than a second, making it an ideal choice for large-scale scanning and decoding operations.

IronBarcode also provides better support for reading and writing barcodes from various image formats, including JPEG, PNG, GIF, BMP, and TIFF. This allows developers to easily work with barcodes in different image formats without having to worry about compatibility issues. In contrast, ZXing's support for image formats is more limited and it may not be able to read or write barcodes from certain types of images.

using IronBarCode;
using System;
using System.Drawing;
// Multiple barcodes may be scanned up from a single document or image.  A PDF document may also used as the input image
PagedBarcodeResult[] PDFResults = BarcodeReader.ReadBarcodesFromPdf("MultipleBarcodes.pdf");
// Work with the results
foreach (var PageResult in PDFResults)
{
    string Value = PageResult.Value;
    int PageNum = PageResult.PageNumber;
    System.Drawing.Bitmap Img = PageResult.BarcodeImage;
    BarcodeEncoding BarcodeType = PageResult.BarcodeType;
    byte[] Binary = PageResult.BinaryValue;
    Console.WriteLine(PageResult.Value + " on page " + PageNum);
}     
using IronBarCode;
using System;
using System.Drawing;
// Multiple barcodes may be scanned up from a single document or image.  A PDF document may also used as the input image
PagedBarcodeResult[] PDFResults = BarcodeReader.ReadBarcodesFromPdf("MultipleBarcodes.pdf");
// Work with the results
foreach (var PageResult in PDFResults)
{
    string Value = PageResult.Value;
    int PageNum = PageResult.PageNumber;
    System.Drawing.Bitmap Img = PageResult.BarcodeImage;
    BarcodeEncoding BarcodeType = PageResult.BarcodeType;
    byte[] Binary = PageResult.BinaryValue;
    Console.WriteLine(PageResult.Value + " on page " + PageNum);
}     
Imports IronBarCode
Imports System
Imports System.Drawing
' Multiple barcodes may be scanned up from a single document or image.  A PDF document may also used as the input image
Private PDFResults() As PagedBarcodeResult = BarcodeReader.ReadBarcodesFromPdf("MultipleBarcodes.pdf")
' Work with the results
For Each PageResult In PDFResults
	Dim Value As String = PageResult.Value
	Dim PageNum As Integer = PageResult.PageNumber
	Dim Img As System.Drawing.Bitmap = PageResult.BarcodeImage
	Dim BarcodeType As BarcodeEncoding = PageResult.BarcodeType
	Dim Binary() As Byte = PageResult.BinaryValue
	Console.WriteLine(PageResult.Value & " on page " & PageNum)
Next PageResult
VB   C#
A Comparison Between IronBarcode and ZXing .NET, Figure 7: Reading Barcodes from a Multi-frame TIFF Image

Reading Barcodes from a Multi-frame TIFF Image

IronBarcode also offers more options for customization, allowing developers to fine-tune the barcode reading process to suit their specific needs. For example, you can use IronBarcode to specify different barcode formats, such as DataMatrix, Aztec, and PDF-417. This can be useful if you need to work with barcodes in different formats or with specific requirements. Additionally, IronBarcode offers multi-page document support, which allows developers to read and extract barcode information from multiple pages of a document.

One more thing, IronBarcode has better error handling and is better suited for enterprise-level applications.

Here is a sample of how to decode multiple barcodes from an image file:

var barcodeResults = IronBarCode.BarcodeReader.ReadMultiple("multibarcode.png");
foreach (var result in barcodeResults)
{
    Console.WriteLine(result.Text);
}
var barcodeResults = IronBarCode.BarcodeReader.ReadMultiple("multibarcode.png");
foreach (var result in barcodeResults)
{
    Console.WriteLine(result.Text);
}
Dim barcodeResults = IronBarCode.BarcodeReader.ReadMultiple("multibarcode.png")
For Each result In barcodeResults
	Console.WriteLine(result.Text)
Next result
VB   C#

On the other hand, ZXing is an open source library and can be used for free. This could be a significant advantage for projects with limited budgets. However, it should be noted that the cost of using IronBarcode may be offset by the time and effort saved by using a more user-friendly and powerful library.

A Comparison Between IronBarcode and ZXing .NET, Figure 8: Reading Barcodes from a Multi-frame TIFF Image

Use C# to create an annotated and styled barcode image

In conclusion, both IronBarcode and ZXing are powerful libraries for working with barcodes and QR codes in C#. However, IronBarcode offers a number of advantages over ZXing, such as ease of use, high performance, better support for image formats, and more options for customization. If your project requires fast and efficient barcode scanning and decoding, or if you need more control over the barcode reading process, IronBarcode is an excellent choice.

Pricing and Licensing

ZXing is released under the Apache 2.0 open source license, which means it can be freely used, distributed, and modified. There is no cost associated with using the library in your software projects. However, if you use the library in a commercial product, you must comply with the terms of the Apache 2.0 license, which includes prominently displaying the license notice and disclaimer.

IronBarcode is software that offers a free developer license. Pricing starts at $749 for the Lite package and includes a perpetual license, the ability to use the software in development, staging and production environments, a 30-day money-back guarantee and one year of software support and upgrades. For more information on IronBarcode pricing and licensing, visit the company's website.

A Comparison Between IronBarcode and ZXing .NET, Figure 9: Reading Barcodes from a Multi-frame TIFF Image

IronBarcode Licensing Prices

Why Choose IronBarcode

IronBarcode was developed specifically for .NET Applications and is based on the ZXing library. IronBarcode is also written entirely in C#, which can be an advantage if your application is also written in C# and you want to use it in your .NET Ecosystem.

IronBarcode aims to provide a more user-friendly and easy-to-use interface for decoding and encoding barcodes, while ZXing is primarily focused on providing the underlying algorithms and libraries.

IronBarcode provides several additional features on top of the ZXing library, such as the ability to automatically correct common scanning errors, support for different types of barcode reading and scanning, and the ability to read the contents of barcodes directly from image files or bitmaps.

In summary, IronBarcode can be a good choice if your application is written in C# and you are looking for an easy-to-use, powerful library that can read and write a variety of barcode formats. However, if you are looking for a more universal, lower-level library that can be used in multiple languages, ZXing may be a better choice.

Conclusion

In summary, IronBarcode is a flexible and efficient software library that supports a wide range of barcode formats, symbols and characters. It is compatible with various operating systems and offers reliable licensing and support.

IronBarcode and ZXing are both libraries for reading and writing barcodes in the .NET Framework. IronBarcode uses the ZXing library as a dependency to perform barcode reading and writing operations. IronBarcode provides a simple, easy-to-use API for reading and writing barcodes in C# and VB.NET, while ZXing is a low-level library that provides a lot of flexibility and customization. IronBarcode uses ZXing to perform the underlying barcode processing and decoding, but provides a simpler and more convenient interface for developers.

IronBarcode is a C# / VB.NET wrapper around the ZXing library, meaning it provides a C# / VB.NET interface to the functions provided by ZXing. IronBarcode facilitates the use of ZXing by providing a more convenient and easier API for reading and writing barcodes.

Compared to ZXing.NET, IronBarcode provides more features and faster processing times for barcode recognition and generation, and has the added ability to read barcodes from various image formats and PDF documents.

A Comparison Between IronBarcode and ZXing .NET, Figure 10: Iron Suite Prices

Iron Suite Licensing Prices

In addition, IronBarcode is available for free for early-stage development and offers a free trial for commercial use. With its different pricing tiers, developers can choose the solution that best fits their needs and budget. There is also an offer to purchase a suite of 5 Iron software products for the price of 2. Overall, IronBarcode has a clear advantage over ZXing.NET