How to Create Linear EAN13 Barcodes Images in .NET with Visual Basic
Easy to integrate EAN-13 barcode generation SDK into VB.NET program developing environment
Generate & draw linear EAN-13 barcode images in various VB.NET applications
Able to create EAN-13 barcodes in .NET Windows Forms with Visual Basic Class
Easy to adjust EAN-13 barcode image settings using simple VB.NET programming
Draw EAN-13 in SQL Server Reporting Service & Crystal Reports for .NET projects
Own high compatibility with .NET Framework 2.0, 3.0, 3.5 and later versions
This section provides an overview of generating EAN-13 barcodes using the BarcodeLib SDK within VB.NET. EAN-13, also known as European Article Number 13, UPC-13, GTIN-13, GS1-13, or EAN/UCC-13, is the standard barcode symbology for retail product identification worldwide. The BarcodeLib VB.NET EAN-13 Generator is designed for straightforward integration into Windows Forms (WinForms) and Windows Presentation Foundation (WPF) desktop applications, as well as class libraries and console projects.
Brief Introduction of VB.NET EAN-13 Barcode Image
EAN13, as the standard barcode of European Article Number, is widely used worldwide. This linear barcode can only encode numeric data like 0,1,2,3,4,5,6,7,8,9. And according to GS1 General Specification, EAN13 can encode 12 data and 1 check digit. As for the check digit, our VB.NET Barcode Generator Component could generate it automatically.
Quick to create, print EAN-13 barcode images using VB.NET
Using the BarcodeLib VB.NET Barcode Generator library, you can quickly create and print an EAN-13 barcode to an image file or an in memory image object within a Visual Basic application.
Create a Linear object in your VB.NET class.
Specify the barcode format by setting the Type property to BarcodeType.EAN13.
Assign the EAN-13 encoding digits to the Data property. You may enter either the first 12 digits or the complete 13 digit value.
Call the drawBarcode() method to output the EAN-13 barcode as a PNG image file.
How to generate, print EAN-13 barcode with add-on symbol using VB.NET
EAN-13 barcodes may include a 2 digit or 5 digit add on symbol, commonly used for publications or supplementary product information. This can be easily generated within VB.NET class libraries, console applications, and Windows Forms or WPF desktop applications.
For a 2 digit add on
Set the Type property to BarcodeType.EAN13_2.
Assign the 12 digit (or 13 digit) base data to the Data property.
Assign the 2 digit add on data to the SupData property.
Print EAN-13 barcode text with OCR-B font using VB.NET Barcode library
Customizing the human readable text font
The GS1 standard recommends using OCR B font for rendering EAN-13 human readable text to enhance optical character recognition. The BarcodeLib VB.NET EAN-13 generation library supports custom text fonts.
Note: Before using OCR B, ensure that the "OCR-B" font is installed on your system.
Set the TextFont property with a System.Drawing.Font object specifying the OCR B font.
Using the BarcodeLib VB.NET Barcode Generator API, you can customize EAN-13 barcodes with the following properties within VB.NET class libraries, console applications, Windows Forms, and WPF desktop applications.
ShowQuietZoneIndicator: Controls whether the quiet zone indicator (the > character) is displayed at the end of the EAN-13 barcode text.
UPCEANLeadDigitSpace: Defines the space between the first digit and the start character bar.
UPCEANTrailDigitSpace: Defines the space between the stop character bar and the quiet zone indicator.
EAN barcode quiet zone indicator
By default, the library prints a quiet zone indicator (>) at the end of the EAN-13 text. You can choose to hide this indicator using the ShowQuietZoneIndicator property.
barcode.ShowQuietZoneIndicator=False
EAN-13 the first and last digit space
You can increase the space between the first digit and the start bar, as well as the space between the stop bar and the quiet zone indicator, using the UPCEANLeadDigitSpace and UPCEANTrailDigitSpace properties.
' Encode EAN-13 barcode and output to HttpResponse object HttpResponse response = ...; ean13.drawBarcode(response);
' Encode EAN-13 barcode and output to Stream object Stream stream = ...; ean13.drawBarcode(stream);
Above Free EAN-13 sample codes are written in Visual Basic .NET
How to Create EAN-13 Images in VB.NET ASP.NET Web Applications?
Add Barcodelib.Barcode.ASP.NET.dll to your web project.
Add Barcodelib.Barcode.ASP.NET.dll to the Toolbox.
Copy files "linear.aspx" & "linear.aspx.cs" from the folder barcode in the downloaded trial package to the folder where your web project is created.
Drag LinearASPNET from the Toolbox to the split part of your aspx page. Then a Code 128 barcode image will appear.
Click the produced image and change its type to EAN13 and its other settings in the Properties Window or with above free VB sample codes.
How to Generate EAN-13 Barcodes in VB.NET Windows Forms Software?
Download and unzip the trial package, and find the Barcode WinForms Library.
Install .NET WinForms Barcode DLL (Barcodelib.Barcode.WinForms.dll) to your Windows Form project referrence or to Visual Studio Toolbox.
Drag LinearWinForm to your windows form and you will see a Code 128 barcode image.
Click the image and adjust its type to EAN13 in the Properties Window or with above free VB sample codes.
Summary
This guide has provided a comprehensive walkthrough for generating EAN-13 barcodes using the BarcodeLib SDK in VB.NET, covering basic generation, add on symbols, OCR B font customization, and advanced layout adjustments such as quiet zone indicators and digit spacing. These features are well suited for integration into Windows Forms (WinForms) and Windows Presentation Foundation (WPF) desktop applications, enabling developers to incorporate retail compliant barcode generation into their .NET projects. The included code examples serve as a practical reference for implementing EAN-13 barcodes across a variety of VB.NET application types.
Barcodes Supported by EAN13 VB.NET Barcode Generator