COMPARE TO OTHER COMPONENTS

What is ZXing.NET

ZXing.NET is a library that decodes and generates barcodes (like QR Code, PDF 417, EAN, UPC, Aztec, Data Matrix, Codabar). ZXing, which stands for "zebra crossing," is a Java-based, open-source library that supports a variety of 1D and 2D barcode formats.

Its essential characteristics are as follows:

  • It has the ability to store URLs, contact details, calendar events, and more
  • It is tailored to Java SE applications
  • It allows for barcode scanner integration via intent
  • It is a straightforward Google Glass app

What is IronBarcode

IronBarcode is a C# library that allows programmers to read and generate barcodes. As a leading barcode library, IronBarcode supports a wide variety of 1-dimensional and 2-dimensional barcodes, including decorated (colored and branded) QR codes. It supports .NET Standard and Core Versions 2 and higher, allowing it to be used cross-platform on Azure, Linux, macOS, Windows and Web. IronBarcode is a well-known class library or component for the .NET system that allows C#, VB.NET, and F# developers to work with standardized programming languages. It allows customers to browse scanner tags and create new standardized labels. It works exceptionally well with 2D barcodes and other 3D standardized barcodes.

IronBarcode now supports 2D barcodes. It provides functionality for optimizing the coloring, styling, and pixelation of these codes and the ability to add logos to them for use in print or advertising material. This library can also read skewed and deformed barcodes, something which other barcode software may not be able to read.

Installing IronBarcode and ZXing.NET

Installation of ZXing.NET

To use the ZXing.NET library, install the following two packages in your ASP.NET Core application using the NuGet Package Manager Console:

1. ZXing.Net

Install-Package ZXing.Net

2. ZXing.Net.Bindings.CoreCompat.System.Drawing

Install-Package ZXing.Net.Bindings.CoreCompat.System.Drawing -Version 0.16.5-beta

Alternatively, install ZXing.NET in your project using the NuGet Package Manager. To do so, go to Tools > NuGet Package Manager > Manage NuGet packages for solutions..., then switch to the "Browse" tab and search for "ZXing.NET".

A Comparison between IronBarcode and Zxing.NET, Figure 1: ASP.NET Web Application

ASP.NET Web Application

Installation of IronBarcode

Install IronBarcode using the NuGet Package Manager or by downloading the DLL directly from the product website. The IronBarcode namespace contains all the IronBarcode classes.

IronBarcode can be installed using the NuGet Package Manager for Visual Studio: the package name is "Barcode".

Install-Package BarCode

Creating 2D Barcode

Using ZXing.NET

First, make a new folder called 'qrr' inside the root folder of the project file.

We will then proceed to create QR files and store the image system files inside the 'qrr' folder.

Inside the Controller, add the GenerateFile() method as shown below in the source code.

public ActionResult GenerateFile()
{
    return View();
}

[HttpPost]
public ActionResult GenerateFile(string qrText)
{
    Byte [] byteArray;
    var width = 250; // width of the QR Code
    var height = 250; // height of the QR Code
    var margin = 0;

    // BarcodeWriterPixelData acts as a QR code generator
    var qrCodeWriter = new ZXing.BarcodeWriterPixelData
    {
        Format = ZXing.BarcodeFormat.QR_CODE,
        Options = new QrCodeEncodingOptions
        {
            Height = height,
            Width = width,
            Margin = margin
        }
    };
    var pixelData = qrCodeWriter.Write(qrText);

    // creating a PNG bitmap from the raw pixel data; if only black and white colors are used it makes no difference if the raw pixel data is BGRA oriented and the bitmap is initialized with RGB
    using (var bitmap = new System.Drawing.Bitmap(pixelData.Width, pixelData.Height, System.Drawing.Imaging.PixelFormat.Format32bppRgb))
    {
        using (var ms = new MemoryStream())
        {
            var bitmapData = bitmap.LockBits(new System.Drawing.Rectangle(0, 0, pixelData.Width, pixelData.Height), System.Drawing.Imaging.ImageLockMode.WriteOnly, System.Drawing.Imaging.PixelFormat.Format32bppRgb);
            try
            {
                // we assume that the row stride of the bitmap is aligned to 4 byte multiplied by the width of the image
                System.Runtime.InteropServices.Marshal.Copy(pixelData.Pixels, 0, bitmapData.Scan0, pixelData.Pixels.Length);
            }
            finally
            {
                bitmap.UnlockBits(bitmapData);
           }

            // Save to folder
            string fileGuid = Guid.NewGuid().ToString().Substring(0, 4);
            bitmap.Save(Server.MapPath("~/qrr") + "/file-" + fileGuid + ".png", System.Drawing.Imaging.ImageFormat.Png);

            // Save to stream as PNG
            bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
            byteArray = ms.ToArray();
        }
    }
    return View(byteArray);
}
public ActionResult GenerateFile()
{
    return View();
}

[HttpPost]
public ActionResult GenerateFile(string qrText)
{
    Byte [] byteArray;
    var width = 250; // width of the QR Code
    var height = 250; // height of the QR Code
    var margin = 0;

    // BarcodeWriterPixelData acts as a QR code generator
    var qrCodeWriter = new ZXing.BarcodeWriterPixelData
    {
        Format = ZXing.BarcodeFormat.QR_CODE,
        Options = new QrCodeEncodingOptions
        {
            Height = height,
            Width = width,
            Margin = margin
        }
    };
    var pixelData = qrCodeWriter.Write(qrText);

    // creating a PNG bitmap from the raw pixel data; if only black and white colors are used it makes no difference if the raw pixel data is BGRA oriented and the bitmap is initialized with RGB
    using (var bitmap = new System.Drawing.Bitmap(pixelData.Width, pixelData.Height, System.Drawing.Imaging.PixelFormat.Format32bppRgb))
    {
        using (var ms = new MemoryStream())
        {
            var bitmapData = bitmap.LockBits(new System.Drawing.Rectangle(0, 0, pixelData.Width, pixelData.Height), System.Drawing.Imaging.ImageLockMode.WriteOnly, System.Drawing.Imaging.PixelFormat.Format32bppRgb);
            try
            {
                // we assume that the row stride of the bitmap is aligned to 4 byte multiplied by the width of the image
                System.Runtime.InteropServices.Marshal.Copy(pixelData.Pixels, 0, bitmapData.Scan0, pixelData.Pixels.Length);
            }
            finally
            {
                bitmap.UnlockBits(bitmapData);
           }

            // Save to folder
            string fileGuid = Guid.NewGuid().ToString().Substring(0, 4);
            bitmap.Save(Server.MapPath("~/qrr") + "/file-" + fileGuid + ".png", System.Drawing.Imaging.ImageFormat.Png);

            // Save to stream as PNG
            bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
            byteArray = ms.ToArray();
        }
    }
    return View(byteArray);
}
Public Function GenerateFile() As ActionResult

	Return View()

End Function



<HttpPost>

Public Function GenerateFile(ByVal qrText As String) As ActionResult

	Dim byteArray() As Byte

	Dim width = 250 ' width of the QR Code

	Dim height = 250 ' height of the QR Code

	Dim margin = 0



	' BarcodeWriterPixelData acts as a QR code generator

	Dim qrCodeWriter = New ZXing.BarcodeWriterPixelData With {

		.Format = ZXing.BarcodeFormat.QR_CODE,

		.Options = New QrCodeEncodingOptions With {

			.Height = height,

			.Width = width,

			.Margin = margin

		}

	}

	Dim pixelData = qrCodeWriter.Write(qrText)



	' creating a PNG bitmap from the raw pixel data; if only black and white colors are used it makes no difference if the raw pixel data is BGRA oriented and the bitmap is initialized with RGB

	Using bitmap = New System.Drawing.Bitmap(pixelData.Width, pixelData.Height, System.Drawing.Imaging.PixelFormat.Format32bppRgb)

		Using ms = New MemoryStream()

			Dim bitmapData = bitmap.LockBits(New System.Drawing.Rectangle(0, 0, pixelData.Width, pixelData.Height), System.Drawing.Imaging.ImageLockMode.WriteOnly, System.Drawing.Imaging.PixelFormat.Format32bppRgb)

			Try

				' we assume that the row stride of the bitmap is aligned to 4 byte multiplied by the width of the image

				System.Runtime.InteropServices.Marshal.Copy(pixelData.Pixels, 0, bitmapData.Scan0, pixelData.Pixels.Length)

			Finally

				bitmap.UnlockBits(bitmapData)

			End Try



			' Save to folder

			Dim fileGuid As String = Guid.NewGuid().ToString().Substring(0, 4)

			bitmap.Save(Server.MapPath("~/qrr") & "/file-" & fileGuid & ".png", System.Drawing.Imaging.ImageFormat.Png)



			' Save to stream as PNG

			bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Png)

			byteArray = ms.ToArray()

		End Using

	End Using

	Return View(byteArray)

End Function
$vbLabelText   $csharpLabel

The only change left is to save the QR code file inside the 'qrr' folder. This is performed using the two lines of code below.

string fileGuid = Guid.NewGuid().ToString().Substring(0, 4);
bitmap.Save(Server.MapPath("~/qrr") + "/file-" + fileGuid + ".png", System.Drawing.Imaging.ImageFormat.Png);
string fileGuid = Guid.NewGuid().ToString().Substring(0, 4);
bitmap.Save(Server.MapPath("~/qrr") + "/file-" + fileGuid + ".png", System.Drawing.Imaging.ImageFormat.Png);
Dim fileGuid As String = Guid.NewGuid().ToString().Substring(0, 4)

bitmap.Save(Server.MapPath("~/qrr") & "/file-" & fileGuid & ".png", System.Drawing.Imaging.ImageFormat.Png)
$vbLabelText   $csharpLabel

Next, you must create the GenerateFile view and include the following code in it. The GenerateFile view is identical to the Index view.

@model Byte []
@using (Html.BeginForm(null, null, FormMethod.Post))
{
    <table>
        <tbody>
            <tr>
                <td>
                    <label>Enter text for creating QR Code</label>
                </td>
                <td>
                <input type="text" name="qrText" />
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <button>Submit</button>
                </td>
            </tr>
        </tbody>
    </table>
}
@{
    if (Model != null)
    {
        <h3>QR Code Successfully Generated</h3>
        <img src="@String.Format("data:image/png;base64,{0}", Convert.ToBase64String(Model))" />
    }
}
@model Byte []
@using (Html.BeginForm(null, null, FormMethod.Post))
{
    <table>
        <tbody>
            <tr>
                <td>
                    <label>Enter text for creating QR Code</label>
                </td>
                <td>
                <input type="text" name="qrText" />
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <button>Submit</button>
                </td>
            </tr>
        </tbody>
    </table>
}
@{
    if (Model != null)
    {
        <h3>QR Code Successfully Generated</h3>
        <img src="@String.Format("data:image/png;base64,{0}", Convert.ToBase64String(Model))" />
    }
}
model Function [using](Html.BeginForm ByVal As (Nothing, Nothing, FormMethod.Post)) As Byte()

'INSTANT VB WARNING: An assignment within expression was extracted from the following statement:

'ORIGINAL LINE: <table> <tbody> <tr> <td> <label> Enter text for creating QR Code</label> </td> <td> <input type="text" name="qrText" /> </td> </tr> <tr> <td colspan="2"> <button> Submit</button> </td> </tr> </tbody> </table>

	"qrText" /> </td> </tr> (Of tr) <td colspan="2"> (Of button) Submit</button> </td> </tr> </tbody> </table>

'INSTANT VB WARNING: An assignment within expression was extracted from the following statement:

'ORIGINAL LINE: <table> <tbody> <tr> <td> <label> Enter text for creating QR Code</label> </td> <td> <input type="text" name="qrText" /> </td> </tr> <tr> <td colspan

	"text" name="qrText" /> </td> </tr> (Of tr) <td colspan

	(Of table) (Of tbody) (Of tr) (Of td) (Of label) Enter text for creating QR Code</label> </td> (Of td) <input type="text" name

End Function

@

If True Then

	If Model IsNot Nothing Then

'INSTANT VB WARNING: Instant VB cannot determine whether both operands of this division are integer types - if they are then you should use the VB integer division operator:

		(Of h3) QR Code Successfully Generated</h3> <img src="@String.Format("data:image/png

		base64,

		If True Then

			0

		End If

		", Convert.ToBase64String(Model))" />

	End If

End If
$vbLabelText   $csharpLabel

Enter any value in the text box and click the 'Submit' button. The QR Code will be generated and saved as a .PNG file in the 'qrr' folder.

A Comparison between IronBarcode and ZXing.NET, Figure 2: QR Code Generator

QR Code Generator

A Comparison between IronBarcode and ZXing.NET, Figure 3: QR Code Files Displayed

QR Code Files Displayed

Supported Barcode Formats

IronBarcode supports a wide range of commonly used barcode formats, including:

  • QR codes with logos and colors (including decorated and branded codes)
  • Multi-format barcodes including Aztec, Data Matrix, CODE 93, CODE 128, RSS Expanded Databar, UPS MaxiCode, and USPS, IMB (OneCode) barcodes
  • RSS-14 and PDF-417 stacked linear barcodes
  • UPCA, UPCE, EAN-8, EAN-13, Codabar, ITF, MSI, and Plessey are traditional numerical barcode formats.

Create and Save Barcode

using IronBarCode;
// Create a barcode and save it in various formats
var MyBarCode = BarcodeWriter.CreateBarcode("https://ironsoftware.com/csharp/barcode", BarcodeEncoding.Code128);
MyBarCode.SaveAsImage("MyBarCode.png");
MyBarCode.SaveAsGif("MyBarCode.gif");
MyBarCode.SaveAsHtmlFile("MyBarCode.html");
MyBarCode.SaveAsJpeg("MyBarCode.jpg");
MyBarCode.SaveAsPdf("MyBarCode.Pdf");
MyBarCode.SaveAsPng("MyBarCode.png");
MyBarCode.SaveAsTiff("MyBarCode.tiff");
MyBarCode.SaveAsWindowsBitmap("MyBarCode.bmp");

// Convert barcode to different image formats and obtain binary data
System.Drawing.Image MyBarCodeImage = MyBarCode.Image;
System.Drawing.Bitmap MyBarCodeBitmap = MyBarCode.ToBitmap();
string DataURL = MyBarCode.ToDataUrl();
string ImgTagForHTML = MyBarCode.ToHtmlTag();
byte[] PngBytes = MyBarCode.ToPngBinaryData();

// Save barcode in PDF stream
using (System.IO.Stream PdfStream = MyBarCode.ToPdfStream())
{
    // The Stream barcode image output also works for GIF, JPEG, PDF, PNG, BMP and TIFF
}

// Stamp barcode onto an existing PDF at a specific position
MyBarCode.StampToExistingPdfPage("ExistingPDF.pdf", 1, 200, 50);
using IronBarCode;
// Create a barcode and save it in various formats
var MyBarCode = BarcodeWriter.CreateBarcode("https://ironsoftware.com/csharp/barcode", BarcodeEncoding.Code128);
MyBarCode.SaveAsImage("MyBarCode.png");
MyBarCode.SaveAsGif("MyBarCode.gif");
MyBarCode.SaveAsHtmlFile("MyBarCode.html");
MyBarCode.SaveAsJpeg("MyBarCode.jpg");
MyBarCode.SaveAsPdf("MyBarCode.Pdf");
MyBarCode.SaveAsPng("MyBarCode.png");
MyBarCode.SaveAsTiff("MyBarCode.tiff");
MyBarCode.SaveAsWindowsBitmap("MyBarCode.bmp");

// Convert barcode to different image formats and obtain binary data
System.Drawing.Image MyBarCodeImage = MyBarCode.Image;
System.Drawing.Bitmap MyBarCodeBitmap = MyBarCode.ToBitmap();
string DataURL = MyBarCode.ToDataUrl();
string ImgTagForHTML = MyBarCode.ToHtmlTag();
byte[] PngBytes = MyBarCode.ToPngBinaryData();

// Save barcode in PDF stream
using (System.IO.Stream PdfStream = MyBarCode.ToPdfStream())
{
    // The Stream barcode image output also works for GIF, JPEG, PDF, PNG, BMP and TIFF
}

// Stamp barcode onto an existing PDF at a specific position
MyBarCode.StampToExistingPdfPage("ExistingPDF.pdf", 1, 200, 50);
Imports IronBarCode

' Create a barcode and save it in various formats

Private MyBarCode = BarcodeWriter.CreateBarcode("https://ironsoftware.com/csharp/barcode", BarcodeEncoding.Code128)

MyBarCode.SaveAsImage("MyBarCode.png")

MyBarCode.SaveAsGif("MyBarCode.gif")

MyBarCode.SaveAsHtmlFile("MyBarCode.html")

MyBarCode.SaveAsJpeg("MyBarCode.jpg")

MyBarCode.SaveAsPdf("MyBarCode.Pdf")

MyBarCode.SaveAsPng("MyBarCode.png")

MyBarCode.SaveAsTiff("MyBarCode.tiff")

MyBarCode.SaveAsWindowsBitmap("MyBarCode.bmp")



' Convert barcode to different image formats and obtain binary data

Dim MyBarCodeImage As System.Drawing.Image = MyBarCode.Image

Dim MyBarCodeBitmap As System.Drawing.Bitmap = MyBarCode.ToBitmap()

Dim DataURL As String = MyBarCode.ToDataUrl()

Dim ImgTagForHTML As String = MyBarCode.ToHtmlTag()

Dim PngBytes() As Byte = MyBarCode.ToPngBinaryData()



' Save barcode in PDF stream

Using PdfStream As System.IO.Stream = MyBarCode.ToPdfStream()

	' The Stream barcode image output also works for GIF, JPEG, PDF, PNG, BMP and TIFF

End Using



' Stamp barcode onto an existing PDF at a specific position

MyBarCode.StampToExistingPdfPage("ExistingPDF.pdf", 1, 200, 50)
$vbLabelText   $csharpLabel

On the other hand, ZXing is a Java-based open-source 1D/2D barcode image processing library. UPC-A, UPC-E, EAN-8, Code 93, Code 128, QR Code, Data Matrix, Aztec, PDF 417, and other barcode formats are supported.

A Comparison between IronBarcode and Zxing.NET, Figure 4: Supported Barcode Formats

Supported Barcode Formats

Create QR Code files using IronBarcode

To create QR codes with IronBarcode, we can use the QRCodeWriter class rather than the BarcodeWriter class. This class introduces some novel and intriguing features to create QR codes. It enables us to set the QR error correction level, allowing you to strike a balance between the size and readability of your QR code.

using IronBarCode;
// Generate a simple QR Code image and save as PNG
QRCodeWriter.CreateQrCode("hello world", 500, QRCodeWriter.QrErrorCorrectionLevel.Medium).SaveAsPng("MyQR.png");
using IronBarCode;
// Generate a simple QR Code image and save as PNG
QRCodeWriter.CreateQrCode("hello world", 500, QRCodeWriter.QrErrorCorrectionLevel.Medium).SaveAsPng("MyQR.png");
Imports IronBarCode

' Generate a simple QR Code image and save as PNG

QRCodeWriter.CreateQrCode("hello world", 500, QRCodeWriter.QrErrorCorrectionLevel.Medium).SaveAsPng("MyQR.png")
$vbLabelText   $csharpLabel

Error correction allows us to specify how easy it will be to read a QR code in real-world situations. Higher levels of error correction result in larger QR codes with more pixels and complexity. In the below image, we see the QR code file displayed.

A Comparison between IronBarcode and ZXing.NET, Figure 5: Supported Barcode Formats

QR Code Image

We begin by specifying the barcode's value and the barcode format from the IronBarcode.BarcodeWriterEncoding enum. We can then save as an image, a System.Drawing.Image, or a Bitmap code object.

using IronBarCode;
using System.Diagnostics;

// Generate a simple BarCode image and save as PNG using the following namespaces
GeneratedBarcode MyBarCode = IronBarcode.BarcodeWriter.CreateBarcode("https://ironsoftware.com/csharp/barcode", BarcodeWriterEncoding.Code128);
MyBarCode.SaveAsPng("MyBarCode.png");

// This line opens the image in your default image viewer
Process.Start("MyBarCode.png");
using IronBarCode;
using System.Diagnostics;

// Generate a simple BarCode image and save as PNG using the following namespaces
GeneratedBarcode MyBarCode = IronBarcode.BarcodeWriter.CreateBarcode("https://ironsoftware.com/csharp/barcode", BarcodeWriterEncoding.Code128);
MyBarCode.SaveAsPng("MyBarCode.png");

// This line opens the image in your default image viewer
Process.Start("MyBarCode.png");
Imports IronBarCode

Imports System.Diagnostics



' Generate a simple BarCode image and save as PNG using the following namespaces

Private MyBarCode As GeneratedBarcode = IronBarcode.BarcodeWriter.CreateBarcode("https://ironsoftware.com/csharp/barcode", BarcodeWriterEncoding.Code128)

MyBarCode.SaveAsPng("MyBarCode.png")



' This line opens the image in your default image viewer

Process.Start("MyBarCode.png")
$vbLabelText   $csharpLabel
A Comparison between IronBarcode and ZXing.NET, Figure 6: Create a Barcode Image in C# Example

Create a Barcode Image in C# Example

IronBarcode also supports stylizing QR codes, such as having a logo graphic placed and snapped to a grid in the exact center of the image. It can also be colored to match a specific brand or graphic identity.

For testing, create a logo in the following code sample below and see how simple it is to use the QRCodeWriter.CreateQRCodeWithLogo method.

using IronBarCode;

// Adding a Logo
var MyQRWithLogo = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/csharp/barcode/", "visual-studio-logo.png", 500);
MyQRWithLogo.ChangeBarCodeColor(System.Drawing.Color.DarkGreen);
using IronBarCode;

// Adding a Logo
var MyQRWithLogo = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/csharp/barcode/", "visual-studio-logo.png", 500);
MyQRWithLogo.ChangeBarCodeColor(System.Drawing.Color.DarkGreen);
Imports IronBarCode



' Adding a Logo

Private MyQRWithLogo = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/csharp/barcode/", "visual-studio-logo.png", 500)

MyQRWithLogo.ChangeBarCodeColor(System.Drawing.Color.DarkGreen)
$vbLabelText   $csharpLabel
A Comparison between IronBarcode and ZXing.NET, Figure 7: Create QR Code With Logo Image

Create QR Code With Logo Image

Finally, we save the generated QR code as a PDF file. For your convenience, the final line of code saves QR code as an HTML file.

using IronBarCode;

// Adding a Logo
var MyQRWithLogo = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/csharp/barcode/", "visual-studio-logo.png", 500);
MyQRWithLogo.ChangeBarCodeColor(System.Drawing.Color.DarkGreen);

// Save as PDF
MyQRWithLogo.SaveAsPdf("MyQRWithLogo.pdf");

// Also Save as HTML
MyQRWithLogo.SaveAsHtmlFile("MyQRWithLogo.html");
using IronBarCode;

// Adding a Logo
var MyQRWithLogo = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/csharp/barcode/", "visual-studio-logo.png", 500);
MyQRWithLogo.ChangeBarCodeColor(System.Drawing.Color.DarkGreen);

// Save as PDF
MyQRWithLogo.SaveAsPdf("MyQRWithLogo.pdf");

// Also Save as HTML
MyQRWithLogo.SaveAsHtmlFile("MyQRWithLogo.html");
Imports IronBarCode



' Adding a Logo

Private MyQRWithLogo = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/csharp/barcode/", "visual-studio-logo.png", 500)

MyQRWithLogo.ChangeBarCodeColor(System.Drawing.Color.DarkGreen)



' Save as PDF

MyQRWithLogo.SaveAsPdf("MyQRWithLogo.pdf")



' Also Save as HTML

MyQRWithLogo.SaveAsHtmlFile("MyQRWithLogo.html")
$vbLabelText   $csharpLabel

Below, we see how to create, style, and export a barcode with just one line of code.

IronBarcode includes a fluent API that is similar to System.Linq. We create a barcode, set its margins, and export it to bitmap in a single line by chaining method calls. This can be very useful and makes the code easier to read.

using IronBarCode;
using System.Drawing;

// Fluent API for Barcode image generation
string MyValue = "https://ironsoftware.com/csharp/barcode";
Bitmap BarcodeBmp = IronBarcode.BarcodeWriter.CreateBarcode(MyValue, BarcodeEncoding.PDF417)
    .ResizeTo(300, 200)
    .SetMargins(100)
    .ToBitmap();
using IronBarCode;
using System.Drawing;

// Fluent API for Barcode image generation
string MyValue = "https://ironsoftware.com/csharp/barcode";
Bitmap BarcodeBmp = IronBarcode.BarcodeWriter.CreateBarcode(MyValue, BarcodeEncoding.PDF417)
    .ResizeTo(300, 200)
    .SetMargins(100)
    .ToBitmap();
Imports IronBarCode

Imports System.Drawing



' Fluent API for Barcode image generation

Private MyValue As String = "https://ironsoftware.com/csharp/barcode"

Private BarcodeBmp As Bitmap = IronBarcode.BarcodeWriter.CreateBarcode(MyValue, BarcodeEncoding.PDF417).ResizeTo(300, 200).SetMargins(100).ToBitmap()
$vbLabelText   $csharpLabel

As a result, a System.Drawing.Image of a PDF417 barcode appears as shown below:

A Comparison between IronBarcode and ZXing.NET, Figure 8: Simple, fluent PDF417 Barcode Generation in C#

Simple, fluent PDF417 Barcode Generation in C#

Reading QR Code Files

Reading QR Codes with IronBarcode

Reading a barcode or QR code is a breeze when you use the IronBarcode class library in conjunction with the .NET barcode reader. In our first example, we can see how to read a barcode using only one line of code.

A Comparison between IronBarcode and ZXing.NET, Figure 9: Code128 Barcode Image to be Scanned with C#

Code128 Barcode Image to be Scanned with C#

We can get the barcode's value, image, encoding type, and binary data (if any) and then output it to the console.

using IronBarCode;
using System;

// Read a barcode or QR code from an image
BarcodeResult Result = BarcodeReader.QuicklyReadOneBarcode("GetStarted.png");
if (Result != null && Result.Text == "https://ironsoftware.com/csharp/barcode/")
{
    Console.WriteLine("GetStarted was a success.  Read Value: " + Result.Text);
}
using IronBarCode;
using System;

// Read a barcode or QR code from an image
BarcodeResult Result = BarcodeReader.QuicklyReadOneBarcode("GetStarted.png");
if (Result != null && Result.Text == "https://ironsoftware.com/csharp/barcode/")
{
    Console.WriteLine("GetStarted was a success.  Read Value: " + Result.Text);
}
Imports IronBarCode

Imports System



' Read a barcode or QR code from an image

Private Result As BarcodeResult = BarcodeReader.QuicklyReadOneBarcode("GetStarted.png")

If Result IsNot Nothing AndAlso Result.Text = "https://ironsoftware.com/csharp/barcode/" Then

	Console.WriteLine("GetStarted was a success.  Read Value: " & Result.Text)

End If
$vbLabelText   $csharpLabel

Reading Barcodes Inside PDFs

We'll look at reading a scanned PDF document and finding all the one-dimensional barcodes in a few lines of code.

As you can see, it's very similar to reading a single barcode from a single document, except we now know what page number the barcode was discovered on.

using IronBarCode;
using System;
using System.Drawing;

// Multiple barcodes may be scanned up from a single document or image. A PDF document may also be 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 be 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 be 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
$vbLabelText   $csharpLabel

You will get result data with all bitmap barcodes in the PDF.

A Comparison between IronBarcode and ZXing.NET, Figure 10: Reading Barcodes Stored Inside PDF Results

Reading Barcodes Stored Inside PDF Results

Reading Barcodes from GIF and TIFF

using IronBarCode;
using System;

// Multi-frame TIFF and GIF images can also be scanned, and multiple threads will be used automatically in the background for improved performance
PagedBarcodeResult[] MultiFrameResults = BarcodeReader.ReadBarcodesFromMultiFrameTiff("Multiframe.tiff", BarcodeEncoding.Code128, BarcodeReader.BarcodeRotationCorrection.High, BarcodeReader.BarcodeImageCorrection.MediumCleanPixels);
foreach (var PageResult in MultiFrameResults)
{
    // Process each page result
}
using IronBarCode;
using System;

// Multi-frame TIFF and GIF images can also be scanned, and multiple threads will be used automatically in the background for improved performance
PagedBarcodeResult[] MultiFrameResults = BarcodeReader.ReadBarcodesFromMultiFrameTiff("Multiframe.tiff", BarcodeEncoding.Code128, BarcodeReader.BarcodeRotationCorrection.High, BarcodeReader.BarcodeImageCorrection.MediumCleanPixels);
foreach (var PageResult in MultiFrameResults)
{
    // Process each page result
}
Imports IronBarCode

Imports System



' Multi-frame TIFF and GIF images can also be scanned, and multiple threads will be used automatically in the background for improved performance

Private MultiFrameResults() As PagedBarcodeResult = BarcodeReader.ReadBarcodesFromMultiFrameTiff("Multiframe.tiff", BarcodeEncoding.Code128, BarcodeReader.BarcodeRotationCorrection.High, BarcodeReader.BarcodeImageCorrection.MediumCleanPixels)

For Each PageResult In MultiFrameResults

	' Process each page result

Next PageResult
$vbLabelText   $csharpLabel
A Comparison between IronBarcode and ZXing.NET, Figure 11: Reading Barcodes from a Multi-frame TIFF Image

Reading Barcodes from a Multi-frame TIFF Image

The following example shows how to read QR codes and PDF-417 barcodes from a scanned PDF. We have set an appropriate level of barcode rotation correction and barcode image correction to lightly clean the document without incurring a significant performance penalty.

using IronBarCode;
using System;

// PDF documents can also be scanned, and multiple threads will be used automatically in the background for improved performance
var ScanResults = BarcodeReader.ReadBarcodesFromPdf("Scan.pdf", BarcodeEncoding.All, BarcodeReader.BarcodeRotationCorrection.Low, BarcodeReader.BarcodeImageCorrection.LightlyCleanPixels);

// Work with the results
foreach (var PageResult in ScanResults)
{
    string Value = PageResult.Value;
    //...
}
using IronBarCode;
using System;

// PDF documents can also be scanned, and multiple threads will be used automatically in the background for improved performance
var ScanResults = BarcodeReader.ReadBarcodesFromPdf("Scan.pdf", BarcodeEncoding.All, BarcodeReader.BarcodeRotationCorrection.Low, BarcodeReader.BarcodeImageCorrection.LightlyCleanPixels);

// Work with the results
foreach (var PageResult in ScanResults)
{
    string Value = PageResult.Value;
    //...
}
Imports IronBarCode

Imports System



' PDF documents can also be scanned, and multiple threads will be used automatically in the background for improved performance

Private ScanResults = BarcodeReader.ReadBarcodesFromPdf("Scan.pdf", BarcodeEncoding.All, BarcodeReader.BarcodeRotationCorrection.Low, BarcodeReader.BarcodeImageCorrection.LightlyCleanPixels)



' Work with the results

For Each PageResult In ScanResults

	Dim Value As String = PageResult.Value

	'...

Next PageResult
$vbLabelText   $csharpLabel
A Comparison between IronBarcode and ZXing.NET, Figure 12: Reading Barcodes from a Scanned PDF Document

Reading Barcodes from a Scanned PDF Document

Reading CORRUPTED QR Codes from Bitmap Images

The example below shows that this C# barcode library can even read a corrupted barcode thumbnail.

Correction of barcode thumbnail size is done automatically. IronBarcode in C# makes a file readable.

The reader methods automatically detect barcode images that are too small to be a legitimate barcode and upscale them. They clean all the digital noise associated with working with thumbnails, making them readable again.

using IronBarCode;

// Small or 'Thumbnail' barcode images are automatically detected by IronBarcode and corrected wherever possible even if they have much digital noise.
BarcodeResult SmallResult = BarcodeReader.QuicklyReadOneBarcode("ThumbnailOfBarcode.gif", BarcodeEncoding.Code128);
using IronBarCode;

// Small or 'Thumbnail' barcode images are automatically detected by IronBarcode and corrected wherever possible even if they have much digital noise.
BarcodeResult SmallResult = BarcodeReader.QuicklyReadOneBarcode("ThumbnailOfBarcode.gif", BarcodeEncoding.Code128);
Imports IronBarCode



' Small or 'Thumbnail' barcode images are automatically detected by IronBarcode and corrected wherever possible even if they have much digital noise.

Private SmallResult As BarcodeResult = BarcodeReader.QuicklyReadOneBarcode("ThumbnailOfBarcode.gif", BarcodeEncoding.Code128)
$vbLabelText   $csharpLabel
A Comparison between IronBarcode and ZXing.NET, Figure 13: Automatic Barcode Thumbnail Size Correction

Automatic Barcode Thumbnail Size Correction

Reading Barcodes from Imperfect Images

In real-world scenarios, we might want to read barcodes from imperfect images. They could be skewed images or photographs with digital noise. This would be impossible with most open-source .NET barcode generation and reading libraries. IronBarcode, on the other hand, makes reading barcodes from imperfect images a breeze.

We'll now look at the ReadASingleBarcode method. With its RotationCorrection parameter, IronBarcode attempts to de-skew and read barcodes from imperfect digital samples.

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)
$vbLabelText   $csharpLabel
A Comparison between IronBarcode and ZXing.NET, Figure 14: Reading a Barcode From a Phone Camera

Reading a Barcode From a Phone Camera

IronBarcode can also read multiple barcodes at the same time. We get better results from IronBarcode when we create a list of documents and use the barcode reader to read numerous documents. The ReadBarcodesMultithreaded method for the barcode scanning process uses multiple threads and potentially all cores of your CPU, which can be exponentially faster than reading barcodes one at a time.

using IronBarCode;

// The BarcodeResult.ReadBarcodesMultiThreaded method allows for faster barcode scanning of multiple images or PDFs. All threads are automatically managed by IronBarcode.
var ListOfDocuments = new[] { "Image1.png", "image2.JPG", "image3.pdf" };
PagedBarcodeResult[] BatchResults = BarcodeReader.ReadBarcodesMultiThreaded(ListOfDocuments);

// Work with the results
foreach (var Result in BatchResults)
{
    string Value = Result.Value;
    //...
}
using IronBarCode;

// The BarcodeResult.ReadBarcodesMultiThreaded method allows for faster barcode scanning of multiple images or PDFs. All threads are automatically managed by IronBarcode.
var ListOfDocuments = new[] { "Image1.png", "image2.JPG", "image3.pdf" };
PagedBarcodeResult[] BatchResults = BarcodeReader.ReadBarcodesMultiThreaded(ListOfDocuments);

// Work with the results
foreach (var Result in BatchResults)
{
    string Value = Result.Value;
    //...
}
Imports IronBarCode



' The BarcodeResult.ReadBarcodesMultiThreaded method allows for faster barcode scanning of multiple images or PDFs. All threads are automatically managed by IronBarcode.

Private ListOfDocuments = { "Image1.png", "image2.JPG", "image3.pdf" }

Private BatchResults() As PagedBarcodeResult = BarcodeReader.ReadBarcodesMultiThreaded(ListOfDocuments)



' Work with the results

For Each Result In BatchResults

	Dim Value As String = Result.Value

	'...

Next Result
$vbLabelText   $csharpLabel

Reading and Decoding QR Codes with ZXing.NET

To read the QR code files, add a ViewFile action method to your controller, as shown below.

public ActionResult ViewFile()
{
    List<KeyValuePair<string, string>> fileData = new List<KeyValuePair<string, string>>();
    KeyValuePair<string, string> data;

    string[] files = Directory.GetFiles(Server.MapPath("~/qrr"));
    foreach (string file in files)
    {
        // Create a barcode reader instance
        IBarcodeReader reader = new BarcodeReader();

        // Load a bitmap
        var barcodeBitmap = (Bitmap)Image.FromFile(Server.MapPath("~/qrr") + "/" + Path.GetFileName(file));

        // Detect and decode the barcode inside the bitmap
        var result = reader.Decode(barcodeBitmap);

        // Do something with the result
        data = new KeyValuePair<string, string>(result.ToString(), "/QR/" + Path.GetFileName(file));
        fileData.Add(data);
    }
    return View(fileData);
}
public ActionResult ViewFile()
{
    List<KeyValuePair<string, string>> fileData = new List<KeyValuePair<string, string>>();
    KeyValuePair<string, string> data;

    string[] files = Directory.GetFiles(Server.MapPath("~/qrr"));
    foreach (string file in files)
    {
        // Create a barcode reader instance
        IBarcodeReader reader = new BarcodeReader();

        // Load a bitmap
        var barcodeBitmap = (Bitmap)Image.FromFile(Server.MapPath("~/qrr") + "/" + Path.GetFileName(file));

        // Detect and decode the barcode inside the bitmap
        var result = reader.Decode(barcodeBitmap);

        // Do something with the result
        data = new KeyValuePair<string, string>(result.ToString(), "/QR/" + Path.GetFileName(file));
        fileData.Add(data);
    }
    return View(fileData);
}
Public Function ViewFile() As ActionResult

	Dim fileData As New List(Of KeyValuePair(Of String, String))()

	Dim data As KeyValuePair(Of String, String)



	Dim files() As String = Directory.GetFiles(Server.MapPath("~/qrr"))

	For Each file As String In files

		' Create a barcode reader instance

		Dim reader As IBarcodeReader = New BarcodeReader()



		' Load a bitmap

		Dim barcodeBitmap = CType(Image.FromFile(Server.MapPath("~/qrr") & "/" & Path.GetFileName(file)), Bitmap)



		' Detect and decode the barcode inside the bitmap

		Dim result = reader.Decode(barcodeBitmap)



		' Do something with the result

		data = New KeyValuePair(Of String, String)(result.ToString(), "/QR/" & Path.GetFileName(file))

		fileData.Add(data)

	Next file

	Return View(fileData)

End Function
$vbLabelText   $csharpLabel
A Comparison between IronBarcode and ZXing.NET, Figure 15: Reading and Decoding QR Code

Reading and Decoding QR Code

A Comparison between IronBarcode and ZXing.NET, Figure 16: Decoded QR Code

Decoded QR Code

Decoding a Barcode Inside a Bitmap

using ZXing;
using System.Drawing;

// Create a barcode reader instance
BarcodeReader reader = new BarcodeReader();

// Load a bitmap
var barcodeBitmap = (Bitmap)Image.FromFile("C:\\sample-barcode-image.png");

// Detect and decode the barcode inside the bitmap
var result = reader.Decode(barcodeBitmap);

// Do something with the result
if (result != null)
{
    txtDecoderType.Text = result.BarcodeFormat.ToString();
    txtDecoderContent.Text = result.Text;
}
using ZXing;
using System.Drawing;

// Create a barcode reader instance
BarcodeReader reader = new BarcodeReader();

// Load a bitmap
var barcodeBitmap = (Bitmap)Image.FromFile("C:\\sample-barcode-image.png");

// Detect and decode the barcode inside the bitmap
var result = reader.Decode(barcodeBitmap);

// Do something with the result
if (result != null)
{
    txtDecoderType.Text = result.BarcodeFormat.ToString();
    txtDecoderContent.Text = result.Text;
}
Imports ZXing

Imports System.Drawing



' Create a barcode reader instance

Private reader As New BarcodeReader()



' Load a bitmap

Private barcodeBitmap = CType(Image.FromFile("C:\sample-barcode-image.png"), Bitmap)



' Detect and decode the barcode inside the bitmap

Private result = reader.Decode(barcodeBitmap)



' Do something with the result

If result IsNot Nothing Then

	txtDecoderType.Text = result.BarcodeFormat.ToString()

	txtDecoderContent.Text = result.Text

End If
$vbLabelText   $csharpLabel

ZXing Decoder Online

ZXing Decoder Online is a barcode and QR code scanner available online that supports decoding. Upload a PNG or other format of the QR code image, and it will begin decoding. Similarly, you can generate a QR code for any data. Most of the time, that information will be a URL or text you want to encode in a QR code.

Navigate to the ZXing Decoder website.

A Comparison between IronBarcode and ZXing.NET, Figure 17: Decoded QR Code

ZXing Decoder Website

A Comparison between IronBarcode and ZXing.NET, Figure 18: Decoded QR Code

ZXing Decode Result

Pricing and Licensing

The ZXing.NET library is a free open-source library which allows you to build barcode reading applications, but is built on an Apache license which doesn't allow it to be freely used for commercial purposes.

A developer's license for IronBarcode is offered without charge. IronBarcode has a unique pricing scheme: the Lite bundle starts at $749 with no additional costs. SaaS and OEM items may also be distributed again. Each license includes a perpetual license, dev/staging/production validity, a 30-day money-back guarantee, and a year of software support and upgrades (one-time purchase). Visit this page to view IronBarcode's complete pricing and license information.

Why Choose IronBarcode?

IronBarcode includes an easy-to-use API for developers to read and write barcodes in .NET, which optimizes accuracy and a low error rate in real-world use cases.

The BarcodeWriter class, for example, will validate and correct 'checksums' on UPCA and UPCE barcodes. It will also 'zero-pad' numbers too short to be entered into a specific numeric format. If your data is incompatible with the specified data format, IronBarcode will notify the developer of a more suitable barcode format that they may use.

IronBarcode excels at reading barcodes when the barcode has been scanned or read from a photographic image in other words, when the image isn't perfect graphically and isn't a machine-generated screenshot.

How is IronBarcode Different from ZXing.NET?

IronBarcode is built from the ZXing.NET (Zebra Crossing) core, with improved processing capability. It comes with an easy-to-use API and a low error rate compared to the ZXing.NET core library. Not only that, but IronBarcode also supports a wider range of barcode formats than the usual ZXing.NET library supports.

IronBarcode is a more improved version of ZXing.NET, giving the user the platform for commercial use and the possibility of using the same package on multiple platforms. It also has full tech support, always ready to help you wherever needed.

IronBarcode includes automatic rotation, perspective correction, and digital noise correction and can detect the type of barcode encoded in an image.

Conclusion

In conclusion, IronBarcode is a versatile .NET software library and C# QR Code generator for reading a wide range of barcode formats, whether they are screenshots, photographs, scans, or other imperfect real-world images.

IronBarcode is one of the most effective libraries for creating and identifying barcodes. In terms of creating and identifying barcodes, it is also among the swiftest libraries. Different operating systems are compatible with the library. It is easy to design and supports a wide range of barcode formats. Additionally, various symbols, formats, and characters are supported.

ZXing.NET barcode is a powerful library that generates and recognizes barcodes in various image formats. We can read and create images in a variety of formats. ZXing.NET also allows you to change the appearance of a barcode, altering its height, width, barcode text, and so on.

In comparison to ZXing.NET, IronBarcode packages offer a reliable licensing and support. IronBarcode costs $749. Although ZXing is free, it gives you no possibility for commercial use and also lacks an all-present support. In addition to being more flexible than ZXing.NET, Iron Barcode solution also has more functionality too. Thus, it is evident that IronBarcode has a strong edge over ZXing.NET.

When comparing the processing times for recognizing and generating barcodes, IronBarcode outperforms ZXing.NET. IronBarcode also has several properties that allow us to read barcodes from different image formats and PDF documents. It also allows us to include images within the barcode or QR code, which is not available in any other library.

IronBarcode is free for the early stages of development. You can acquire a free trial for production level or commercial use. According to the requirements of the developer, IronBarcode offers three pricing tiers. You can pick the solution that best satisfies your demands. You may now get a suite of five Iron Software products for the price of two Iron Software items. Visit this website for further information.

Frequently Asked Questions

What are the main differences between IronBarcode and ZXing.NET?

IronBarcode is an improved version of ZXing.NET with enhanced processing capabilities, a wider range of supported barcode formats, and features like automatic rotation, perspective correction, and digital noise correction. It is more suitable for commercial use and offers full tech support.

How can I generate a barcode in C# using ZXing.NET?

To generate a barcode in C# using ZXing.NET, install the necessary libraries, create a BarcodeWriterPixelData object, set the barcode type, customize encoding options, and use the Write method to generate the barcode.

What barcode formats does IronBarcode support?

IronBarcode supports a wide range of formats including QR codes with logos and colors, Aztec, Data Matrix, CODE 93, CODE 128, RSS Expanded Databar, UPS MaxiCode, USPS IMB barcodes, RSS-14, PDF-417, and traditional numerical barcode formats like UPCA, UPCE, EAN-8, EAN-13, Codabar, ITF, MSI, and Plessey.

Is IronBarcode free to use?

IronBarcode offers a developer's license without charge for the early stages of development. For production-level or commercial use, a free trial is available, and there are three pricing tiers according to developer requirements.

How does IronBarcode handle reading imperfect barcode images?

IronBarcode is capable of reading barcodes from imperfect images by using methods that handle rotation correction, perspective correction, and digital noise. It is particularly effective at reading barcodes from scanned or photographic images.

Can ZXing.NET be used for commercial applications?

ZXing.NET is an open-source library under the Apache license, which does not allow free use for commercial purposes. For commercial use, IronBarcode may be a more suitable choice due to its licensing options.

How can I read a QR code from an image using IronBarcode?

To read a QR code using IronBarcode, use the BarcodeReader.QuicklyReadOneBarcode method and provide the image file path. It will return the decoded information if the QR code is successfully read.

What are the installation steps for ZXing.NET?

To install ZXing.NET, use the NuGet Package Manager Console to install ZXing.Net and ZXing.Net.Bindings.CoreCompat.System.Drawing packages. Alternatively, use the NuGet Package Manager UI in Visual Studio.

What unique features does IronBarcode offer for QR code creation?

IronBarcode offers features like optimizing the coloring, styling, and pixelation of QR codes, adding logos for branding, and setting error correction levels to balance size and readability.

What are the advantages of using IronBarcode over ZXing.NET?

IronBarcode offers a more robust API, supports more barcode formats, provides commercial licensing, includes better error handling and support, and integrates cross-platform capabilities for .NET applications.

Jordi Bardia
Software Engineer
Jordi is most proficient in Python, C# and C++, when he isn’t leveraging his skills at Iron Software; he’s game programming. Sharing responsibilities for product testing, product development and research, Jordi adds immense value to continual product improvement. The varied experience keeps him challenged and engaged, and he says it’s one of his favorite aspects of working with Iron Software. Jordi grew up in Miami, Florida and studied Computer Science and Statistics at University of Florida.
< PREVIOUS
A Comparison Between ZXing Decoder & IronBarcode
NEXT >
A Comparison between IronBarcode and Aspose.Barcode