Test in a live environment
Test in production without watermarks.
Works wherever you need it to.
Barcodes can be used to present data in a visible, computer-readable format. To represent data in barcodes, parallel lines were initially spaced, made wider, and sized differently. There are various types of specialized optical scanners known as barcode readers that can read these contemporary linear or one-dimensional (1D) barcodes. Later, two-dimensional (2D) variants of linear barcodes that don't really employ bars were developed and are known as matrix codes or 2D barcodes. Instead of using the standard barcodes, these versions make use of rectangles, dots, hexagons, and other patterns. There are various configurations of 2D optical scanners made exclusively to read 2D barcodes available. A digital camera connected to a computer running software that takes a photo of the barcode and decodes it using the image is another way to read 2D barcodes. A mobile device with an inbuilt camera, such as a smartphone, can use the latter type of 2D barcode scanner by installing specific application software.
The IronBarcode Library makes it simple to create a dynamic barcode. It helps us to encode barcode images with just a few lines of code, this straightforward library can create a barcode. Strong barcode generators built inside IronBarcode barcode readers allow them to create high-quality barcodes. IronBarcode allows us to create barcodes in vb.net, C# etc. With various Dot net libraries around, this barcode generator makes reading your barcode using the barcode scanner simple.
Open Visual Studio, choose "New Project" from the file menu, then "Console App," "Windows Forms," or "WPF Application." In the article, we will be making a Visual Basic Console App.
In the relevant text box, type the project name and choose the file path. Click on the "Next" button.
Next, select the necessary .NET framework for our tutorial we are selecting .NET 6.0 and then click on the "Create" button to create the project.
If you choose a console application, the project will now construct the structure for that application and open the program.cs file. You can now enter code and compile the program.
Next, download and install the IronBarcode library using the next NuGet Package Manager command:
Install-Package BarCode
As an alternative, you can search for and download the "Barcode" package using the NuGet Package Manager, which will display all the search results. You can then choose the necessary package to download from them into the application.
Here is sample VB code for generating a barcode label using IronBarcode.
Imports System
Imports IronBarCode
Module Program
Sub Main(args As String())
BarcodeWriter.CreateBarcode("Hello world", BarcodeWriterEncoding.Code128, 500, 500).AddBarcodeValueTextBelowBarcode().SaveAsPng("demo.png")
End Sub
End Module
Imports System
Imports IronBarCode
Module Program
Sub Main(args As String())
BarcodeWriter.CreateBarcode("Hello world", BarcodeWriterEncoding.Code128, 500, 500).AddBarcodeValueTextBelowBarcode().SaveAsPng("demo.png")
End Sub
End Module
The barcode data that has to be encoded in the code image (a string or a Stream
that object we are passed as first parameter) is the sole argument required for the CreateBarcode
() function which allows us to create barcode image. Three other optional parameters are also accepted by the method:
AddBarcodeValueTextBelowBarcode
is a function which allows us to add the barcode text at the bottom of the barcode image. We also have another option to add the barcode text at the top of the barcode image using the AddBarcodeValueTextAboveBarcode
method.The example above creates a 500 by 500 pixel graphic using the Given barcode format. By using the SaveAsPng
function on the custom Barcode code that was generated, we can print generated Barcode code as a PNG image file at a designated file location which we hard coded in the code on the above sample code.
IronBarcode provides various type options to create barcode images with various features to add images and change the color of the generated barcode image. IronBarcode helps us adjust and correct the barcode image to provide a high quality image. We can also generate barcode from texts, streams, URLs, and other sources.
The output of the above code to generate barcodes in vb.net using IronBarcode, will look like below:
To know more about generating Barcodes click here for the tutorial.
Due to its effectiveness and adaptability to different operating systems, the IronBarcode library is one of the best choices for creating and identifying barcodes.
It provides a number of tools for designing and modifying various barcode kinds, including the option to change the text, barcode data's color, line width, and height. Using VB.NET Crystal Reports is also supported by this barcode generator SDK. Barcode creation & drawing in VB.NET.
The IronBarcode website, which offers both commercial and free versions for developers, contains licensing information about the library. For a year, updates and support are offered without charge.
9 .NET API products for your office documents