Test in a live environment
Test in production without watermarks.
Works wherever you need it to.
What is a barcode? A barcode is a square or rectangular image that can be read by a scanner and consists of a series of parallel black lines and white gaps of varying widths. Barcodes are used on products to make them easier to identify. They're used at retail stores as part of the buying process, in warehouses to track inventory, and on invoices to help with accounting, among other things.
Can you read and generate barcodes using the .NET platform? Yes, you can generate and read barcodes using the .NET platform. In this article, we will discuss how a developer can create barcodes and read them in .NET platform-supported programming languages. We will discuss and compare two sets of software that developers use to deal with barcodes. These tools are as follows:
OnBarcode is a market-leading provider of barcode generators, reader controls, and components for all major corporate development platforms, including ASP.NET, Windows Forms, WPF, Java, Android, and iOS (iPhone projects, Mac). OnBarcode offers a full barcode solution for constructing business applications when combined with its primary reporting barcode tools, the Microsoft Office (Excel & Word) barcode add-on, and barcode fonts.
OnBarcode software offers a wide variety of barcode-related features such as generating barcode images, printing barcode images in SQL Server, reading barcodes, completely coded in Visual Studio C#, compatible with the latest barcode symbology, and printing and drawing barcode images in .NET Crystal Reports. It also supports a variety of standard codes to represent textual strings.
For OnBarcode, only the contained backend (aka ZINT shared library) provides QR code generation services in all .NET platforms. OnBarcode also supports these other platforms:
Barcode Types Generation
The OnBarcode tool barcode encoding library offers two different types of barcode generators.
OnBarcode is better than any other open-source barcode library because it offers support for rotating barcodes (it can create barcodes at 0, 90, 180, and 270 degrees).
.NET Technology Barcode Generator
Visual Studio C# .NET 2005 was used to write this. Barcodes are simple to draw and print with VB.NET, C#, Managed C++, and Borland Delphi for .NET. Barcodes are printed in memory and then encoded into image files.
Installation and Deployment
It supports .NET 2.0, 3.0, 3.5 or later versions of .NET platforms. Deployment of barcodes is easy using Simple Xcopy Deployment. OnBarcode also provides royalty-free redistribution.
Barcode Image Generating, Encoding, and Printing
This allows you to draw a barcode object to an image file and encode it in GIF, BMP, PNG, JPEG, and TIFF image formats. It also supports different browsers such as Internet Explorer, Firefox, Chrome, Safari, and Opera. With a thermal printer, you can print high-quality barcode pictures.
IronBarcode is a .NET library that allows programmers to read and create barcodes. IronBarcode is a leading .NET barcode library that supports a broad range of 1 and 2-dimensional barcodes, as well as customized (colored and branded) QR codes. IronBarcode allows developers to use all .NET-related Languages.
Creating, formatting, and exporting barcodes as pictures using IronBarcode is exceedingly straightforward, and can frequently be accomplished with just a single line of code.
IronBarcode supports .NET Core 2x & 3x, .NET Standard, .NET Framework 4x, and Full Azure. It creates postscript output and accepts a variety of standard codes to convert text strings.
Barcode Formats
Barcode Reading Features
Barcode Writing Features
The BarcodeWriter and QRCodeWriter static classes are used to create a fault-tolerant barcode and QR-writing API. Barcode data can usually be extracted in two lines of code.
IronBarCode allows its users to export as images, export to HTML pages, and export to PDF or add to an existing PDF.
The Class QRCodeWriter provides advanced support for rendering QR codes with advanced features.
Open the Visual Studio software and go to the File menu. Select "new project" and then select console application.
Enter the project name and select the path in the appropriate text box. Then, click the Create button. Select the required .NET framework, as in the screenshot below:
The Visual Studio project will now generate the structure for the selected application, and if you have selected the console, Windows, and web application, it will open the program.cs file where you can enter the code and build/run the application.
Now we can add the library and test the program.
The IronBarcode library can be downloaded and installed in four different ways. These are:
The Visual Studio software 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.
It provides the search box to show the list of available package libraries from the NuGet site. In the package manager, we need to search for the keyword "IronBarCode", as in the below screenshot:
From the above image, we can see the list of the related packages in the search list. We need to select the IronBarcode option and install the package in our solution.
In the Visual Studio menu, Go to Tools-> NuGet Package manager -> Package manager console.
Enter the following line in the package manager console tab:
Install-Package BarCode
Now the package will download/install to the current project and be ready to use.
The third way is to download the package directly from the website.
Click the link to download the latest package from the website. After the download, follow the steps below to add the package to the project.
Unlike IronBarcode, OnBarcode does not provide multiple installation options, nor is it available on the NuGet website. OnBarcode provides separate services for barcode generators and barcode readers. To download the barcode generator use this link, and for the barcode reader use this link. After downloading, follow these steps:
A QR code is a two-dimensional variant of a barcode consisting of black and white pixel patterns.
OnBarcode's Barcode for .NET Generation Controls enables the generating and printing of QR codes and 2D bar codes for C# applications. The OnBarcode C# Barcode Generator makes it easy to generate and create QR codes.
The following code shows how to create QR codes using OnBarcode.
using System;
using System.Collections.Generic;
using System.Text;
using OnBarcode.Barcode;
using System.Drawing.Imaging;
using System.Drawing;
QRCode qrcode = new QRCode();
qrcode.Data = "ONBARCODE";
qrcode.DataMode = QRCodeDataMode.AlphaNumeric;
qrcode.UOM = UnitOfMeasure.PIXEL;
qrcode.X = 3;
qrcode.LeftMargin = 0;
qrcode.RightMargin = 0;
qrcode.TopMargin = 0;
qrcode.BottomMargin = 0;
qrcode.Resolution = 72;
qrcode.Rotate = Rotate.Rotate0;
qrcode.ImageFormat = System.Drawing.Imaging.ImageFormat.Gif;
qrcode.drawBarcode("C:\\qrcode.gif");
using System;
using System.Collections.Generic;
using System.Text;
using OnBarcode.Barcode;
using System.Drawing.Imaging;
using System.Drawing;
QRCode qrcode = new QRCode();
qrcode.Data = "ONBARCODE";
qrcode.DataMode = QRCodeDataMode.AlphaNumeric;
qrcode.UOM = UnitOfMeasure.PIXEL;
qrcode.X = 3;
qrcode.LeftMargin = 0;
qrcode.RightMargin = 0;
qrcode.TopMargin = 0;
qrcode.BottomMargin = 0;
qrcode.Resolution = 72;
qrcode.Rotate = Rotate.Rotate0;
qrcode.ImageFormat = System.Drawing.Imaging.ImageFormat.Gif;
qrcode.drawBarcode("C:\\qrcode.gif");
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports OnBarcode.Barcode
Imports System.Drawing.Imaging
Imports System.Drawing
Private qrcode As New QRCode()
qrcode.Data = "ONBARCODE"
qrcode.DataMode = QRCodeDataMode.AlphaNumeric
qrcode.UOM = UnitOfMeasure.PIXEL
qrcode.X = 3
qrcode.LeftMargin = 0
qrcode.RightMargin = 0
qrcode.TopMargin = 0
qrcode.BottomMargin = 0
qrcode.Resolution = 72
qrcode.Rotate = Rotate.Rotate0
qrcode.ImageFormat = System.Drawing.Imaging.ImageFormat.Gif
qrcode.drawBarcode("C:\qrcode.gif")
Iron Barcode gives developers more choices when making QR codes than they do when creating regular barcodes. We may, for example, adjust the amount of QR error correction, decide to add color QR codes, or add logos.
When a logo is added to a QR code, it is automatically shrunk to an appropriate size so that the QR code can be read, and then snapped to grid so that it is properly aligned with the black-and-white squares on the QR image.
Simple QR code generation
using IronBarCode;
using System;
using System.Drawing;
using System.Linq;
QRCodeWriter.CreateQrCode("hello world", 500, QRCodeWriter.QrErrorCorrectionLevel.Medium).SaveAsPng("MyQR.png");
using IronBarCode;
using System;
using System.Drawing;
using System.Linq;
QRCodeWriter.CreateQrCode("hello world", 500, QRCodeWriter.QrErrorCorrectionLevel.Medium).SaveAsPng("MyQR.png");
Imports IronBarCode
Imports System
Imports System.Drawing
Imports System.Linq
QRCodeWriter.CreateQrCode("hello world", 500, QRCodeWriter.QrErrorCorrectionLevel.Medium).SaveAsPng("MyQR.png")
Advanced QR code generation
using IronBarCode;
using System;
using System.Drawing;
using System.Linq;
var MyQRWithLogo = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/csharp/barcode/", "visual-studio-logo.png", 500);
MyQRWithLogo.ChangeBarCodeColor(System.Drawing.Color.DarkGreen);
using IronBarCode;
using System;
using System.Drawing;
using System.Linq;
var MyQRWithLogo = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/csharp/barcode/", "visual-studio-logo.png", 500);
MyQRWithLogo.ChangeBarCodeColor(System.Drawing.Color.DarkGreen);
Imports IronBarCode
Imports System
Imports System.Drawing
Imports System.Linq
Private MyQRWithLogo = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/csharp/barcode/", "visual-studio-logo.png", 500)
MyQRWithLogo.ChangeBarCodeColor(System.Drawing.Color.DarkGreen)
Reading barcodes to get the information hidden inside can be incredibly useful. In this section, we will discuss how these tools read different barcodes.
The Barcode Reader is a script that reads barcodes. The IronBarCode namespace's QuicklyReadOneBarcode function is a fantastic tool for reading barcodes in the .NET framework. We can considerably enhance speed by choosing a barcode encoding scheme, and we can force it to automatically adjust for perspective and digital noise by setting the TryHarder option to True.
The QuicklyReadAllBarcodes technique is similar, but it can scan multiple barcodes for multipage documents like PDFs and multipage TIFFs.
QuicklyReadOneBarcode
using IronBarCode;
using System;
using System.Drawing;
BarcodeResult QRResult = BarcodeReader.QuicklyReadOneBarcode("QR.png");
using IronBarCode;
using System;
using System.Drawing;
BarcodeResult QRResult = BarcodeReader.QuicklyReadOneBarcode("QR.png");
Imports IronBarCode
Imports System
Imports System.Drawing
Private QRResult As BarcodeResult = BarcodeReader.QuicklyReadOneBarcode("QR.png")
TryHarder
using IronBarCode;
using System;
using System.Drawing;
BarcodeResult QRBetterResult = BarcodeReader.QuicklyReadOneBarcode("QR.png", BarcodeEncoding.QRCode, true);
using IronBarCode;
using System;
using System.Drawing;
BarcodeResult QRBetterResult = BarcodeReader.QuicklyReadOneBarcode("QR.png", BarcodeEncoding.QRCode, true);
Imports IronBarCode
Imports System
Imports System.Drawing
Private QRBetterResult As BarcodeResult = BarcodeReader.QuicklyReadOneBarcode("QR.png", BarcodeEncoding.QRCode, True)
QuicklyReadAllBarcodes
using IronBarCode;
using System;
using System.Drawing;
BarcodeResult [] PDFResults = BarcodeReader.QuicklyReadAllBarcodes("MultipleBarcodes.pdf", BarcodeEncoding.AllOneDimensional, true);
using IronBarCode;
using System;
using System.Drawing;
BarcodeResult [] PDFResults = BarcodeReader.QuicklyReadAllBarcodes("MultipleBarcodes.pdf", BarcodeEncoding.AllOneDimensional, true);
Imports IronBarCode
Imports System
Imports System.Drawing
Private PDFResults() As BarcodeResult = BarcodeReader.QuicklyReadAllBarcodes("MultipleBarcodes.pdf", BarcodeEncoding.AllOneDimensional, True)
TryHarder
using IronBarCode; using System; using System.Drawing; BarcodeResult QRBetterResult = BarcodeReader.QuicklyReadOneBarcode("QR.png", BarcodeEncoding.QRCode, true);
QuicklyReadAllBarcodes
using IronBarCode; using System; using System.Drawing; BarcodeResult [] PDFResults = BarcodeReader.QuicklyReadAllBarcodes("MultipleBarcodes.pdf", BarcodeEncoding.AllOneDimensional, true);
In Visual C# .NET applications, the OnBarcode .NET Barcode Reader is a C# .NET component (DLL) that reads and scans barcode images.
Read linear barcodes
using IronBarCode;
using System;
using System.Drawing;
using System.Linq;
String [] barcodes = BarcodeScanner.Scan("code39image.gif", BarcodeType.Code39);
using IronBarCode;
using System;
using System.Drawing;
using System.Linq;
String [] barcodes = BarcodeScanner.Scan("code39image.gif", BarcodeType.Code39);
Imports IronBarCode
Imports System
Imports System.Drawing
Imports System.Linq
Private barcodes() As String = BarcodeScanner.Scan("code39image.gif", BarcodeType.Code39)
Scan defined areas in the image
using IronBarCode;
using System;
using System.Drawing;
using System.Linq;
List<SRegion> areas = new List<SRegion>();
SRegion area = new SRegion(0, 0, 50, 60);
areas.Add(area);
string [] barcodes = BarcodeScanner.ScanRegions("code39image.gif", BarcodeType.Code39, areas);
using IronBarCode;
using System;
using System.Drawing;
using System.Linq;
List<SRegion> areas = new List<SRegion>();
SRegion area = new SRegion(0, 0, 50, 60);
areas.Add(area);
string [] barcodes = BarcodeScanner.ScanRegions("code39image.gif", BarcodeType.Code39, areas);
Imports IronBarCode
Imports System
Imports System.Drawing
Imports System.Linq
Private areas As New List(Of SRegion)()
Private area As New SRegion(0, 0, 50, 60)
areas.Add(area)
Dim barcodes() As String = BarcodeScanner.ScanRegions("code39image.gif", BarcodeType.Code39, areas)
IronBarcode is a library that provides a developer's license for free. IronBarcode also has a distinct pricing structure: the Lite bundle starts at $749 with no hidden fees. The redistribution of SaaS and OEM products is also possible. All licenses have a 30-day money-back guarantee, a year of software support and upgrades, dev/staging/production validity, and a perpetual license (one-time purchase). To see IronBarcode's entire price structure and license, go here.
The OnBarcode reader and barcode generator are not offered in a single package. This means that you have to purchase two different packages.
The .NET Barcode Generator Suite License
The .NET Barcode Generator Suite includes a set of dependable barcode controls that are simple to use in Visual Studio .NET. In .NET apps, you may use this suite to produce, print, and draw high-quality barcodes.
Its single-developer license with both linear and 2D support starts from $1,690, and the Unlimited Developer License is available for the price of $3,990.
Single Developer License: This license allows a single developer to distribute an infinite number of user licenses with no licensing fees, and to install the Barcode component for .NET on an unlimited number of servers.
5-Developer License: this license allows 5 developers to distribute an infinite number of user licenses with no royalties, and install the Barcode component for .NET on an unlimited number of servers.
Unlimited Developer License: this allows unlimited developers to distribute infinite user licenses with no royalties, and install the Barcode component for .NET on an unlimited number of servers.
The .NET Barcode Reader SDK License
Single-Server Distribution License: this allows an infinite number of developers in your business to use our .NET Barcode Reader and deploy derivative products on a single server.
Three-Server Distribution License: this license allows your company an unlimited number of developers to utilize our .NET Barcode Reader and deploy derivative products on three servers.
Five-Server Distribution License: this allows your company an unlimited number of developers to utilize our .NET Barcode Reader and deploy derivative products on up to five servers.
Unlimited-Server Distribution License: this allows an infinite number of developers in your organization to utilize our .NET Barcode Reader and deploy the resulting product on an unlimited number of servers.
Windows Application Distribution License: this allows an infinite number of developers in your organization to use our .NET Barcode Reader and deploy the generated product on an unlimited number of machines (not servers).
IronBarcode is a leading .NET barcode library that allows programmers to read and create barcodes. It supports a broad range of 1 and 2-dimensional barcodes, as well as customized (colored and branded) QR codes. IronBarcode allows developers to use all .NET-related language. IronBarcode is faster than any other C# Barcode reader and generator. It supports Supports .NET Core 2x & 3x, .NET Standard, .NET Framework 4x and Full Azure support.
OnBarcode is a market-leading provider of barcode generators, reader controls, and components for all major corporate development platforms, including ASP.NET, Windows Forms, WPF, Java, Android, and iOS (iPhone projects, mac). The company also offers a full barcode solution when combined with Microsoft Office (Excel & Word) barcode add-ons and barcode fonts. OnBarcode software offers a wide variety of barcode-related features such as generating barcode images, reading barcodes, and compatibility with the latest barcode symbology. As well as printing and drawing in .NET. It supports a variety of standard codes to represent textual strings.
The IronBarcode pricing structure is relatively more cost-effective than that of OnBarcode. IronBarcode provides all its features under a single license with a one-time purchase and no ongoing costs, whereas OnBarcode does not provide a single license for its barcode-related features, instead, it provides separate licenses for barcode generation and barcode reading. Its separate licensing strategy makes it three times more expensive than IronBarcode, thus making it unattractive to users.
After comparing the two, we can conclude that IronBarcode provides more features than OnBarcode, and also that OnBarcode is considerably more expensive than IronBarcode. The integration of IronBarcode is relatively easy due to its availability in the NuGet Package manager. On the other hand, OnBarcode is not available in NuGet, making it quite difficult to integrate with projects. For .NET programming, IronBarcode offers all the functions in only a few lines of code, something its competitor fails to provide. On top of all that, Iron Software is currently offering all of its five software tools for the price of just two! These five tools are the following:
Please visit this link to explore IronSuite.
9 .NET API products for your office documents