VB.NET EAN-13 Generator Introduction
EAN-13, also known as European Article Number 13, UPC-13, GTIN-13, GS1-13, EAN/UCC-13, is the standard barcode version of European Article Number.
Using VB.NET EAN-13 Generator to create EAN-13 barcodes in VB.NET program is a simple and easy job. VB.NET EAN-13 Generator control is easy to install with a single .NET Barcode generation control. It is easy to generate EAN-13 barcodes in VB.NET class with detailed VB.NET EAN-13 settings document and complete demo for EAN-13 generation in VB.NET provided in this article.
EAN-13 Generators
OnBarcode provides several EAN-13 Generator components and software, including EAN-13 .NET, EAN-13 Generator, EAN-13 Java, EAN-13 C#, EAN-13 ASP.NET.
Quick to create, print EAN-13 barcode images using VB.NET
Using VB.NET Barcode Generator library, you can quickly create and print an EAN-13 barcode to image file or image object in memory in Visual Basic application.
- Create a
Linearobject in Visual Basic class - Choose the barcode format in property
Typewith valueBarcodeType.EAN13 - Set the EAN-13 encoding digits in property
Data. You can enter the first 12 digits or the complete 13 digits. - Call method
drawBarcode()to print the EAN-13 barcode to a PNG image file.
Dim barcode = New Linear() barcode.Type = BarcodeType.EAN13 barcode.Data = "012345678912" barcode.drawBarcode("C://Output//vb-net-ean13-how-to-demo.png")
How to generate, print EAN-13 barcode with add-on symbol using VB.NET
EAN13 barcode may include 2 or 5 digits add-on symbol. You can easily create and draw EAN-13 barcode with add-on symbol in VB.NET class, console and Windows application.
- Create a
Linearobject in Visual Basic class - Choose the barcode format in property
Typewith valueBarcodeType.EAN13_2 - Set the EAN-13 encoding digits in property
Data. You can enter the first 12 digits or the complete 13 digits. - Set the 2 digits add-on data in property
SupData. - Call method
drawBarcode()to print the EAN-13 barcode with 2-digit addon to a PNG image file.
Dim barcode = New Linear() barcode.Type = BarcodeType.EAN13_2 barcode.Data = "012345678912" barcode.SupData = "12" barcode.drawBarcode("C://Output//vb-net-ean13-addon-2-digits-demo.png")
- Choose the barcode format in property
Typewith valueBarcodeType.EAN13_5 - Set the 5 digits add-on data in property
SupData.
Dim barcode = New Linear() barcode.Type = BarcodeType.EAN13_5 barcode.Data = "012345678912" barcode.SupData = "12345" barcode.drawBarcode("C://Output//vb-net-ean13-addon-5-digits-demo.png")
Print EAN-13 barcode text with OCR-B font using VB.NET Barcode library
GS1 standard recommends to use OCR-B font to render EAN-13 human readable text. VB.NET EAN-13 barcode generation library supports
EAN-13 barcode generation with text font customized in visual basic .net class.
To draw EAN-13 barcode with OCR-B font printed, your system need install the "OCR-B" font first.
To draw EAN-13 barcode with OCR-B font printed, your system need install the "OCR-B" font first.
- Set the property
TextFontwith aSystem.Drawing.Fontobject with "OCR-B" font specified.
barcode.TextFont = New Font("OCR-B", 12.0F, FontStyle.Regular)
Create and customize EAN-13 barcode in VB.NET class, console, WinForms, WPF apps
Using OnBarcode VB.NET Barcode Generator library API, you
can print and customize the EAN-13 barcode with the following barcode options in VB.NET class, console app, Windows Forms and WPF desktop applications.
Here we will show how to print the following EAN-13 barcode and customize it using VB.NET source codes.
- ShowQuietZoneIndicator: Display or hide EAN barcode quiet zone indicator.
By default, the created EAN-13 barcode will print a quiet zone indicator in the end of the EAN-13 barcode text "
>" - UPCEANLeadDigitSpace: The space between the first digit and the start character bar.
- UPCEANTrailDigitSpace: The space between the stop character bar and the quiet zone indicator.
Here we will show how to print the following EAN-13 barcode and customize it using VB.NET source codes.
EAN barcode quiet zone indicator
You can display or hide the EAN barcode quiet zone indicator in barcode label. By default, the Visual Basic barocde generation sdk will print
the EAN-13 barcode quiet zone indicator mark on the end of the EAN-13 barcode text.
The property
The property
ShowQuietZoneIndicator will allow you to show or hide the EAN-13 quiet zone indicator.
barcode.ShowQuietZoneIndicator = False
EAN-13 the first and last digit space
You can increase the space between the EAN-13 first code and the start bar, and the space between the stop char and quiet zone indicator through
barcode options
UPCEANLeadDigitSpace and UPCEANTrailDigitSpace in visual basic codes.
barcode.UPCEANLeadDigitSpace = 10 barcode.UPCEANTrailDigitSpace = 10
Create EAN-13 Barcodes in VB.NET
Creating EAN-13 barcode in VB.NET class example:
Imports OnBarcode.Barcode
Dim barcode As Linear = New Linear
' EAN 13 Barcode Basic Settings
barcode.Type = BarcodeType.EAN13
' EAN 13 Valid data char set:
' 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 (Digits)
' EAN 13 Valid data length: 12 digits only, excluding the last checksum digit
barcode.Data = "012345678901"
' for EAN13 with supplement data (2 or 5 digits)
'barcode.SupData = "12";
' supplement bar height vs bar height ratio
'barcode.SupHeight = 0.8f;
' space between barcode and supplement barcode (in pixel)
'barcode.SupSpace = 15;
' Barcode Size Related Settings
barcode.UOM = UnitOfMeasure.PIXEL
barcode.X = 1
barcode.Y = 80
barcode.LeftMargin = 0
barcode.RightMargin = 0
barcode.TopMargin = 0
barcode.BottomMargin = 0
barcode.Resolution = 96
barcode.Rotate = Rotate.Rotate0
' Barcode Text Settings
barcode.ShowText = True
barcode.TextFont = New Drawing.Font("Arial", 9.0F, Drawing.FontStyle.Regular)
barcode.TextMargin = 6
' Image format setting
barcode.Format = System.Drawing.Imaging.ImageFormat.Gif()
barcode.drawBarcode("c://ean-13.gif")
Common Asked Questions
What is the EAN-13 code?
EAN-13 is a 13-digit barcode, which includes 12 GS1 data digits and 1 check digit. EAN is short for European Article Number,
and now it is renamed as GTIN (Global Trade Item Number). EAN 13 code will be used to uniquely identify retail products worldwide.
In VB.NET class, you can input EAN-13 12 digits data text or whole 13 digits with check sum, the VB.NET barcode generator library will generate and print the EAN13 barcodes through class
In VB.NET class, you can input EAN-13 12 digits data text or whole 13 digits with check sum, the VB.NET barcode generator library will generate and print the EAN13 barcodes through class
EAN13
in Visual Basic .NET class library, console, WinForms, WPF windows applications.
What is the difference between EAN and EAN-13?
EAN barcode includes EAN-13, EAN-8. You can use OnBarcode VB.NET barcode library to encode and print EAN-13, and EAN-8 barcode images easily in VB.NET projects
What is the EAN-13 barcode layout?
The whole 13 digits EAN-13 code is grouped as follows:
- 2 or 3 digits for the number system or the country code
- 5 or 4 digits for the manufacturer code or prefix
- 5 digits for the product code
- 1 digit for the check digit
How to check if the EAN-13 barcode created in VB.NET is valid?
The last digit of EAN-13 is a check digit. It will be used to verify the first 12-digit GS1 data message.
Using VB.NET barcode library,
the generated EAN-13 barcode check digit is calculated and verified by the barcode SDK API.
What is the minimum size for EAN-13?
The GS1 recommended minimum size for an EAN-13 barcode is 30mm in width and 20 mm in height.
You can customize the EAN-13 barcode image with and height through method
setBarcodeWidth and setBarcodeHeight in
VB.NET class.
How do I print high quality EAN-13 barcodes in VB.NET?
To print good quality EAN-13 barcodes in VB.NET projects, you need follow the rules below.
- The EAN-13 barcode image resolution (DPI) is the same or higher than the printer's resolution.
In VB.NET class
com.onbarcode.barcode.EAN13, customize the barcode image resolution through methodsetResolution() - The EAN-13 barcode human readable text is using the legible fonts. The GS1 System recommends use OCR-B font to draw EAN-13 text label.
Here is the sample VB.NET source code to apply fonts:
setTextFont(new Font("OCR-B", Font.PLAIN, 13))