COMPARE TO OTHER COMPONENTS

A Comparison between IronBarcode and Aspose.Barcode

A barcode is a machine-readable visual representation of data. Barcodes were first used to express data by changing the lengths and spacings of parallel lines. These linear or one-dimensional (1D) barcodes may be scanned using special optical scanners known as barcode readers, of which there are various types. Later, two-dimensional (2D) variations using rectangles, dots, hexagons, and other patterns were developed and dubbed matrix codes, despite the fact that they do not use bars. Purpose-built 2D optical scanners, which come in a variety of configurations, can read 2D barcodes. A digital camera attached to a microcomputer can take a photographic image of a barcode while running software that scans 2D barcodes — it deconstructs and then decodes the barcode by analyzing the image. Using specialized application software, a mobile device with an inbuilt camera, such as a smartphone, can act as the latter sort of 2D barcode scanner.

In this article, we are going to compare two popular barcode libraries:

  • Aspose.Barcode
  • IronBarcode

Both libraries can be used for the generation and recognition of barcodes. There is support for all .NET frameworks, and barcode images can be easily saved.

Features

Aspose.Barcode

Aspose.BarCode for .NET is a sophisticated tool that allows you to create and recognize 1D and 2D barcodes from a variety of picture sources at any angle. Barcode creation and scanning capability may be simply added to .NET applications by developers. It also allows for the exporting of created barcodes to multiple high-quality picture formats and APIs for creating new barcodes and recognizing old barcodes from a variety of angles. There is support for over 60 different 1D, 2D, and postal barcode symbologies.

Aspose.BarCode for .NET allows you to change the background color, bar color, rotation angle, x-dimension, image quality, resolution, captions, size, and more for the created barcodes. The API also supports a variety of identification and imaging features, as well as a variety of symbologies.

  • Aspose allows us to generate and recognize 40+ barcode symbologies with just a few lines of code.
  • Read barcodes at any angle.
  • Easily print barcode labels to physical or virtual printers.
  • Checksum and barcode supplement data are supported.
  • Code128 encoding has been improved.
  • Set the image area where the barcode will be scanned.
  • Create images that are dependent on the device's resolution.
  • Recognition formats and images: JPEG, TIFF, PNG, BMP, GIF, EXIF Save BarCode Labels as Images: EMF, SVG Platform Independence, 2D, and postal barcodes.

IronBarcode

IronBarcode for .NET allows programmers to read and write barcodes and QR codes from within .NET apps and websites. IronBarcode simply requires a single line of code to read or write barcodes. Most barcode and QR standards can be read and written using the .NET barcode library. Code 39/93/128, UPC A/E, EAN 8/13, ITF, RSS 14 / Expanded, Databar, CodaBar, Aztec, Data Matrix, MaxiCode, PDF417, MSI, Plessey, USPS, and QR are some of the most common. Type, text, binary data, page, and picture files are all included in the barcode result data. The IronBarcode's API features are as follows:

  • IronBarcode reads and writes most barcode types and QR standards, including UPC A/E, EAN 8/13, Code 39/93/128, ITF, MSI, RSS 14/Expanded, Databar, CodaBar, QR, Styled QR, Data Matrix, MaxiCode, PDF417, Plessey, and Aztec. The barcode data, type, page, text, and barcode picture provided by the results are perfect for archiving or indexing systems.
  • Image pre-processing improves reading speed and accuracy — IronBarcode automatically pre-processes barcode pictures to increase reading speed and accuracy. It can read scans or live video frames, as well as correct rotation, noise, distortion, and skewing. Batch-processing server applications can take advantage of several cores and threads. Find one or more barcodes in single and multi-page documents automatically. Without needing to use complicated APIs, you can search for specific barcode kinds or document locations.
  • Designed for use with .NET projects — get up and running in minutes with just a few lines of code. Built for the .NET Framework as a single DLL with no dependencies; supports 32 and 64-bit, and may be used in any .NET and dot net core language. Supports mobile and desktop devices in web, cloud, desktop, and console applications.
  • Create barcodes and QR codes for a variety of document formats — save and print to a file or stream in a variety of file and stream formats, including PDF, JPG, TIFF, GIF, BMP, PNG, and HTML. Color, quality, rotation, size, and text can all be changed.

1. Creating a New Project

Open Visual Studio, go to the file menu, and select "new project", then select console application/Windows Forms/WPF Application. Barcodes can also be used on all types of applications. You can also use apps such as Webform/MVC/MVC Core.

Aspose Barcode Generator Alternative 1 related to 1. Creating a New Project

Enter the project name and select the file path in the appropriate text box. Then, click the create button and select the required dot net framework. The project will now generate the structure for the selected application, and, if you have selected the console application, it will open the program.cs file where you can enter the code and build/run the application.

Aspose Barcode Generator Alternative 1 related to 1. Creating a New Project

2. Install the Barcode Library

2.1 Using IronBarcode

The IronBarcode library can be downloaded and installed in four ways.

These are:

  • Using Visual Studio
  • Using the Visual Studio Command-Line
  • Direct download from the NuGet website
  • Direct download from the IronBarcode website

2.1.1 Using Visual Studio

Visual Studio provides the NuGet Package manager option to install the package directly to the solution. The below screenshot shows how to open the NuGet Package Manager.

Aspose Barcode Generator Alternative 1 related to 2.1.1 Using Visual Studio

It provides a search box to show the list of the packages from the NuGet website. In the package manager, we need to search for the keyword "Barcode", as in the screenshot below:

Aspose Barcode Generator Alternative 4 related to 2.1.1 Using Visual Studio

From the above image, we will get the list of the related search results. We need to select the required option to install the package to the solution.

2.1.2 Using the Visual Studio Command-Line

In Visual Studio, go to Tools -> NuGet Package Manager -> Package Manager Console.

Enter the following command in the console tab:

Install-Package BarCode

The package will now download/install in the current project and be ready to use.

2.1.3 Direct Download from the NuGet Website

The third way is to download the package directly from the website.

  • Navigate to the NuGet Link
  • Select the download package option from the menu on the right-hand side.
  • Double-click the downloaded package. It will be installed automatically.
  • Next, reload the solution and start using it in the project.

2.1.4 Direct Download from the IronBarcode Website

Click the link here to download the latest package directly from the website. Once downloaded, follow the steps below to add the package to the project.

  • Right-click the project from the solution window.
  • Next, select the option reference and then browse the location of the downloaded reference.
  • Next, click OK to add the reference.

2.2 Using Aspose.BarCode

The Aspose.BarCode library can be downloaded and installed in four ways.

These are:

  • Using Visual Studio
  • Using the Visual Studio Command-Line
  • Direct download from the NuGet website
  • Direct download from the Aspose website

2.2.1 Using Visual Studio

This method is similar to that described above for IronBarcode. The only thing we need to change is the search criteria, as shown in the image below.

Aspose Barcode Generator Alternative 4 related to 2.2.1 Using Visual Studio

Select the first option which will download the Aspose.Barcode library.

2.2.2 Using the Visual Studio Command-Line

In Visual Studio, go to Tools > NuGet Package Manager > Package Manager Console

Enter the following line in the package manager console tab.

Install-Package Aspose.BarCode

The package will now download/install in the current project and be ready to use.

2.2.3 Direct Download from the NuGet Website

The third way is to download the package directly from the website.

Just click here and it will redirect to the NuGet website where you can download the package.

2.2.4 Direct Download from the Aspose Website

Click the link here and it will redirect to the list of package versions where we can choose the required version to download. Once downloaded, follow the steps below to add the package to the project.

  • Right-click the project from the solution window.
  • Next, select option reference and then browse the location of the downloaded reference.
  • Next, click OK to add the reference.

3. Barcode Generation

Barcode generation can be done easily with IronBarcode and Aspose.Barcode. Let us take a look at this using an example.

3.1 Using IronBarcode

IronBarcode can be used to create a barcode label that can be saved in a variety of image formats. We can also pass the type of barcode that we need to generate. Below is the following snippet for barcode generation:

using IronBarCode;

// Create a barcode using IronBarcode
var MyBarCode = BarcodeWriter.CreateBarcode("123456", BarcodeEncoding.Code128);

// Add annotation text below the barcode
MyBarCode.AddAnnotationTextBelowBarcode("123456");

// Save the barcode as a JPEG image
MyBarCode.SaveAsImage("MyBarCode.jpeg");
using IronBarCode;

// Create a barcode using IronBarcode
var MyBarCode = BarcodeWriter.CreateBarcode("123456", BarcodeEncoding.Code128);

// Add annotation text below the barcode
MyBarCode.AddAnnotationTextBelowBarcode("123456");

// Save the barcode as a JPEG image
MyBarCode.SaveAsImage("MyBarCode.jpeg");
Imports IronBarCode

' Create a barcode using IronBarcode
Private MyBarCode = BarcodeWriter.CreateBarcode("123456", BarcodeEncoding.Code128)

' Add annotation text below the barcode
MyBarCode.AddAnnotationTextBelowBarcode("123456")

' Save the barcode as a JPEG image
MyBarCode.SaveAsImage("MyBarCode.jpeg")
$vbLabelText   $csharpLabel

The BarcodeWriter.CreateBarcode is a method available in the IronBarcode library. We need to pass two parameters to the CreateBarcode function: the text to encode and the barcode type to generate. After calling this method, it returns a barcode object which can be used to set various properties such as adding annotation text and saving the image in different formats.

// Create a QR code with a logo image
var QRWithLogo = QRCodeWriter.CreateQrCodeWithLogo("Hello World", "logo.png", 500);

// Change the color of the barcode to dark green
QRWithLogo.ChangeBarCodeColor(System.Drawing.Color.DarkGreen);

// Save the QR code with a logo as a JPEG image
QRWithLogo.SaveAsJpeg("Logoqr.jpeg");
// Create a QR code with a logo image
var QRWithLogo = QRCodeWriter.CreateQrCodeWithLogo("Hello World", "logo.png", 500);

// Change the color of the barcode to dark green
QRWithLogo.ChangeBarCodeColor(System.Drawing.Color.DarkGreen);

// Save the QR code with a logo as a JPEG image
QRWithLogo.SaveAsJpeg("Logoqr.jpeg");
' Create a QR code with a logo image
Dim QRWithLogo = QRCodeWriter.CreateQrCodeWithLogo("Hello World", "logo.png", 500)

' Change the color of the barcode to dark green
QRWithLogo.ChangeBarCodeColor(System.Drawing.Color.DarkGreen)

' Save the QR code with a logo as a JPEG image
QRWithLogo.SaveAsJpeg("Logoqr.jpeg")
$vbLabelText   $csharpLabel

The above example demonstrates how to generate a QR code with a logo image using IronBarcode. The CreateQrCodeWithLogo function allows us to create a QR code with an embedded logo, and we can change the color of the barcode using the ChangeBarCodeColor method.

3.2 Using Aspose.Barcode

Aspose.BarCode can be used for barcode generation, and we can generate different barcode types using the following code snippet:

using Aspose.BarCode.Generation;

// Create a BarcodeGenerator object and specify the barcode type and text
BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.Code128, "123456");

// Save the generated barcode as a JPEG image
generator.Save("output.jpg", BarCodeImageFormat.Jpeg);
using Aspose.BarCode.Generation;

// Create a BarcodeGenerator object and specify the barcode type and text
BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.Code128, "123456");

// Save the generated barcode as a JPEG image
generator.Save("output.jpg", BarCodeImageFormat.Jpeg);
Imports Aspose.BarCode.Generation

' Create a BarcodeGenerator object and specify the barcode type and text
Private generator As New BarcodeGenerator(EncodeTypes.Code128, "123456")

' Save the generated barcode as a JPEG image
generator.Save("output.jpg", BarCodeImageFormat.Jpeg)
$vbLabelText   $csharpLabel

The above code uses BarcodeGenerator from Aspose.Barcode to create a barcode. We specify the barcode type and text through the constructor. The Save method allows us to save the generated barcode in the desired image format, such as JPEG.

Aspose.BarCode also supports customizing the bar height and width using the Parameters.Barcode.XDimension.Millimeters property to specify line height and width.

Result:

Aspose Barcode Generator Alternative 8 related to 3.2 Using Aspose.Barcode

The above image is the performance comparison of these libraries. Time is calculated in milliseconds.

4. Recognize Barcodes

IronBarcode and Aspose.Barcodes allow us to recognize barcodes from different image formats and the types to which they belong. Let's take a look in detail.

4.1 Using IronBarcode

IronBarcode helps to read barcodes from different image formats and can be defined in three ways: as a string, as a stream, or as an image such as JPEG, TIFF, Bitmap, etc. The following example is for reading a barcode from an image using the string method.

using IronBarCode;

// Read a barcode from an image file
BarcodeResult QRResult = BarcodeReader.QuicklyReadOneBarcode("MyBarCode.jpg");

if (QRResult != null)
{
    // Output the barcode value and type
    Console.WriteLine(QRResult.Value);
    Console.WriteLine(QRResult.BarcodeType);
}
using IronBarCode;

// Read a barcode from an image file
BarcodeResult QRResult = BarcodeReader.QuicklyReadOneBarcode("MyBarCode.jpg");

if (QRResult != null)
{
    // Output the barcode value and type
    Console.WriteLine(QRResult.Value);
    Console.WriteLine(QRResult.BarcodeType);
}
Imports IronBarCode

' Read a barcode from an image file
Private QRResult As BarcodeResult = BarcodeReader.QuicklyReadOneBarcode("MyBarCode.jpg")

If QRResult IsNot Nothing Then
	' Output the barcode value and type
	Console.WriteLine(QRResult.Value)
	Console.WriteLine(QRResult.BarcodeType)
End If
$vbLabelText   $csharpLabel

The above code snippet uses BarcodeReader from IronBarcode to read a barcode from an image file. The QuicklyReadOneBarcode method reads the barcode from the specified image and converts it into a BarcodeResult object, which contains properties such as Value (the encoded text) and BarcodeType (the type of the recognized barcode).

4.2 Using Aspose.Barcode

In Aspose.BarCode for .NET, the source for barcode recognition can be defined in three ways: as an image file, a stream, or a bitmap. The implementation details for reading a barcode from a file in JPEG format are provided below.

using Aspose.BarCode.BarCodeRecognition;

// Read a barcode using Aspose.BarCode
using (BarCodeReader reader = new BarCodeReader(@"MyBarCode.jpg"))
{
    // Iterate through recognized barcodes
    foreach (BarCodeResult result in reader.ReadBarCodes())
    {
        // Output the barcode type and text
        Console.WriteLine("Type: " + result.CodeType);
        Console.WriteLine("CodeText: " + result.CodeText);
    }
}
using Aspose.BarCode.BarCodeRecognition;

// Read a barcode using Aspose.BarCode
using (BarCodeReader reader = new BarCodeReader(@"MyBarCode.jpg"))
{
    // Iterate through recognized barcodes
    foreach (BarCodeResult result in reader.ReadBarCodes())
    {
        // Output the barcode type and text
        Console.WriteLine("Type: " + result.CodeType);
        Console.WriteLine("CodeText: " + result.CodeText);
    }
}
Imports Aspose.BarCode.BarCodeRecognition

' Read a barcode using Aspose.BarCode
Using reader As New BarCodeReader("MyBarCode.jpg")
	' Iterate through recognized barcodes
	For Each result As BarCodeResult In reader.ReadBarCodes()
		' Output the barcode type and text
		Console.WriteLine("Type: " & result.CodeType)
		Console.WriteLine("CodeText: " & result.CodeText)
	Next result
End Using
$vbLabelText   $csharpLabel

The above example shows how to read barcodes using Aspose.BarCode. The BarCodeReader class is used to read the barcode image using the path as a parameter. Then the ReadBarCodes method fetches all recognized barcodes from the image, and the foreach loop is used to access each barcode result, providing the barcode type and text encoded within.

5. Conclusion

IronBarcode is one of the most powerful libraries to help us generate and recognize barcodes. It is also one of the fastest libraries for generating and recognizing barcodes. The library is supported by various operating systems. It supports a wide variety of barcode formats and is easy to create. Users can change color, line height, width, barcode text, etc. The licensing details can be found here.

Aspose.BarCode is also a powerful library for generating and reading barcodes with different image formats. We can use various image formats to read and create. Aspose also provides options for customizing the barcode's appearance, such as height, width, barcode text, etc. Licensing details can be found here.

IronBarcode does enjoy several advantages over Aspose.Barcode. When comparing the processing times for the recognition and generation of barcodes, IronBarcode is faster. IronBarcode also has various properties which allow not only for the reading of barcodes from different image formats but also for reading barcodes from PDF documents. Users can add images inside barcodes and QR codes, a feature not available in many libraries.

Frequently Asked Questions

What is a barcode?

A barcode is a machine-readable visual representation of data. It can be either one-dimensional (1D) or two-dimensional (2D), used for encoding information in a format that can be read by specialized scanners or digital cameras.

What are Aspose.Barcode and IronBarcode?

Aspose.Barcode and IronBarcode are .NET libraries used to create and recognize barcodes. They support various barcode symbologies and can be integrated into .NET applications to handle barcode generation and recognition.

What barcode symbologies are supported by Aspose.Barcode?

Aspose.Barcode supports over 60 different 1D, 2D, and postal barcode symbologies, including Code128, QR Codes, and more.

How can I install IronBarcode in a .NET project?

IronBarcode can be installed in a .NET project via Visual Studio using NuGet Package Manager, Visual Studio Command-Line, direct download from the NuGet website, or direct download from the IronBarcode website.

Can IronBarcode read barcodes from PDF documents?

Yes, IronBarcode can read barcodes from different image formats, as well as from PDF documents, providing flexibility in barcode recognition.

What are the advantages of using IronBarcode over Aspose.Barcode?

IronBarcode is generally faster in barcode recognition and generation. It also supports reading barcodes from PDF documents and allows embedding images inside barcodes and QR codes, features not available in many other libraries.

How can I customize barcode appearance using Aspose.Barcode?

Aspose.Barcode allows customization of barcode appearance by adjusting properties like background color, bar color, rotation angle, x-dimension, image quality, resolution, and more.

What image formats can IronBarcode save barcodes in?

IronBarcode can save barcodes in a variety of image formats including JPEG, TIFF, PNG, BMP, GIF, and more. It also supports saving as PDF and HTML.

How do you create a barcode using IronBarcode?

To create a barcode using IronBarcode, you can use the `BarcodeWriter.CreateBarcode` method, specifying the text to encode and the barcode type. The generated barcode can then be saved in various image formats.

What platforms are supported by IronBarcode?

IronBarcode supports both 32 and 64-bit .NET and .NET Core languages, and can be used in web, cloud, desktop, and console applications on mobile and desktop devices.

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 IronBarcode and ZXing.NET
NEXT >
A Comparison between IronBarcode and Spire Barcode