VB.NET UPC-A Generator Introduction
UPC-A, also known as Universal Product Code version A , UPC Code, UPC Symbol, GTIN-12, GS1-12, UCC-12, is the most common and well-known barcode symbology in the United States.
Using VB.NET UPC-A Generator to create UPC-A barcodes in VB.NET program is a simple and easy job. VB.NET UPC-A Generator control is easy to install with a single .NET Barcode generation control. It is easy to generate UPC-A barcodes in VB.NET class with detailed VB.NET UPC-A settings document and complete demo for UPC-A generation in VB.NET provided in this article.
UPC-A Generators
OnBarcode provides several UPC-A Generator components and software, including UPC-A Generator, C# UPC-A, .NET UPC-A, Java UPC-A, ASP.NET UPC-A.
Create UPC-A Barcodes in VB.NET
Here we will show how to quickly generate a UPC-A linear (1D) barcode, a standard retail product identification symbology using VB.NET codes.
The following vb.net codes initialize a linear barcode generator, sets the type to UPC-A, assigns valid 11-digit (or 12 digits with check digit) input data, and exports the printed barcode as a PNG image file.
The following vb.net codes initialize a linear barcode generator, sets the type to UPC-A, assigns valid 11-digit (or 12 digits with check digit) input data, and exports the printed barcode as a PNG image file.
Dim barcode = New Linear() barcode.Type = BarcodeType.UPCA barcode.Data = "01234567891" barcode.drawBarcode("C://Output//vb-net-upc-a-how-to-create.png")
Creating UPC-A with add-on symbol
UPC-A may include a 2-digit or 5-digit add-on symbol. The following vb.net codes explain how to create a UPC-A barcode with add-on symbol included.
- Use property
Typeto set the barcode symbology to UPC-A with a 2-digit add-on (BarcodeType.UPCA_2), a standard format for magazines, books, and retail supplements. - Use property
Datato assign the 11-digit (or 12-digit with check digit) primary UPC-A data, which the library automatically validates and appends a check digit to. - Use property
SupDatato set the 2-digit supplemental add-on data used for additional product metadata such as issue numbers. - Use property
SupSpaceto define a 50-pixel horizontal space between the main UPC-A barcode and the supplemental add-on. - Use property
SupHeightto set the height ratio of the supplemental add-on barcode to 60% (0.6) of the main barcode height.
Dim barcode = New Linear() barcode.Type = BarcodeType.UPCA_2 barcode.Data = "01234567891" barcode.SupData = "12" barcode.SupSpace = 50 barcode.SupHeight = 0.6 barcode.drawBarcode("C://Output//vb-net-upc-a-addon-2-digits.png")
Print, customize UPC-A Barcode with specified dimension size in VB.NET
Use property
BarcodeWidth and BarcodeHeight to customize the printed UPC-A barcode dimension size.
Dim barcode = New Linear() barcode.Type = BarcodeType.UPCA barcode.Data = "01234567891" barcode.BarcodeWidth = 300 barcode.BarcodeHeight = 200 barcode.drawBarcode("C://Output//vb-net-upc-a-size.png")
Generate, customize UPC-A Barcode using VB.NET
Customize UPC-A text font style
You can customize and configure Code 128 barcode text margin and OCR-B font using the following VB.NET code.
- Use property
TextMarginto set a vertical margin of 30 pixels between the barcode bars and the human-readable text below it. This property improves visual clarity and layout spacing in VB.NE Windows Forms and WPF desktop application UI rendering. - Use property
TextFontto create and customize a GS1 industry-standard OCR-B font with size 12 and regular style for the barcode's human-readable text.
OCR-B is the GS1 standard recommended font for UPC-A barcodes, ensuring optimal readability and compliance in .NET desktop applications.
Dim barcode = New Linear() barcode.Type = BarcodeType.UPCA barcode.Data = "01234567891" barcode.TextMargin = 30 barcode.TextFont = New Font("OCR-B", 12.0F, FontStyle.Regular) barcode.drawBarcode("C://Output//vb-net-upc-a-text-style.png")
UPC-A quiet zone indicator
This single-line VB.NET code disables the visual quiet zone indicator for UPC-A barcodes in Windows Forms and WPF desktop applications. It removes the optional marker lines that show the boundaries of the required quiet zone (blank margin) around the UPC-A barcode, producing a cleaner visual output.
barcode.ShowQuietZoneIndicator = False
Customize UPC-A lead, trail digit style
This VB.NET code snippet generates a UPC-A linear barcode with advanced customization of the leading and trailing digits for VB.NET Windows Forms and WPF desktop applications.
The following VB.NET example source code initializes a linear barcode generator, sets UPC-A type and data, configures spacing, vertical offset, and size ratio for the system digits, then exports the UPC-A barcode to a PNG image.
The following VB.NET example source code initializes a linear barcode generator, sets UPC-A type and data, configures spacing, vertical offset, and size ratio for the system digits, then exports the UPC-A barcode to a PNG image.
- Use property
UPCEANLeadDigitSpaceto set a horizontal space of 10 pixels between the leading digit (system digit) and the main barcode body. - Use property
UPCEANTrailDigitSpaceto define a horizontal space of 10 pixels between the main barcode and the trailing digit (check digit) on the right. - Use property
UPCEANLeadDigitYShiftto move the leading digit 20 pixels upward (negative Y value) relative to its default position. - Use property
UPCEANTrailDigitYShiftto shift the trailing digit 20 pixels upward to match the vertical position of the leading digit. - Use property
UPCEANLeadTrailDigitSizeRatioto set the font size of the lead and trail digits to 60% (0.6) of the main barcode text size.
Dim barcode = New Linear() barcode.Type = BarcodeType.UPCA barcode.Data = "01234567891" barcode.UPCEANLeadDigitSpace = 10 barcode.UPCEANTrailDigitSpace = 10 barcode.UPCEANLeadDigitYShift = -20 barcode.UPCEANTrailDigitYShift = -20 barcode.UPCEANLeadTrailDigitSizeRatio = 0.6F barcode.drawBarcode("C://Output//vb-net-upc-a-lead-trail-digits-space.png")
Common Asked Questions
What is a GTIN-12 UPC-A barcode?
GTIN-12 is a 12 digits Global Trade Item Number. It is usually encoded in UPC-A barcode. The 12 digits Global Trade Item Number includes 11 digits of data message,
and one digit of check sum digit. Using VB.NET Barcode Library, you can input 12-digit GS1 numeric data or 13-digits data with checksum digit in class
UPCA in VB.NET source code.
What is the minimum & maximum size for a UPC-A barcode?
- The Minimum X-dimension for the UPC-A barcode is 0.0104 inches.
- The Maximum X-dimension for the UPC-A barcode is 0.0260 inches
setX() in VB.NET barcode class UPCA using VB.NET Barcode Generator library.
What is the difference between EAN-13 and UPC-A?
UPC-A Format barcodes have traditionally been used in the North America (USA and Canada), whereas EAN-13 format barcodes have been used throughout the rest of the world.
VB.NET Barcode Generator SDK supports both UPC-A and EAN-13 with add-on symbol barcode generation in
Visual Basic .NET class library, console, WinForms, WPF windows applications.
What is the difference between UPC-A and UPC-E?
Both of UPC-A and UPC-E are UPC barcode.
UPC-A is a 12-digit barcode, and UPC-E is a compressed UPC-A with 6 digits code. The UPC-E will be used in limited space for a barcode.
You can create both UPC-A and UPC-E images in VB.NET projects using VB.NET barcode library.