How to Encode UPC-A Data in VB.NET
VB.NET UPC-A Generator is an easy-to-use barcode generating SDK, used for generating, printing UPC-A barcodes in Visual Basic.NET applications. It is simple to integrate into any .NET Framework and completely run in VB.NET 2.0/3.0/4.0.
VB.NET UPC-A Generator creates UPC-A barcodes configured to GS1 system stand and support to add checksum digit and supplement 2 & 5 digits for UPC-A barcodes. With VB.NET UPC-A Generator, users are allowed to encode numeric data only for UPC-A barcodes and modify UPC-A barcode length to its valid length. Here is the detailed guide for UPC-A data encoding in VB.NET; others, please go to:
UPC-A Data Related Properties
Symbology
Barcode property Symbology is provided by Barcode Generator for .NET Ultimate for users to encrypt UPC-A barcode encodable character sets in VB.NET.
VB.NET UPC-A Barcode encodes:
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Code
Barcode property Code is provided by Barcode Generator for .NET Ultimate for users to manipulate data length of UPC-A barcodes.
Supplement Code
Barcode property SupplementCodeis provided by Barcode Generator for .NET Ultimate for users to add EAN-2 or EAN-5 barcode for UPC-A barcode.
Check Digit Calculation
Barcode properties AddChecksum and DisplayChecksumDigit are provided by Barcode Generator for .NET Ultimate for users to calculate and display a Modulo 10 check digits for UPC-A barcodes as they wish.
Human-readable Text
Barcode properties DisplayText and Textfont are provided by Barcode Generator for .NET Ultimate for users to display specified human-readable code text under UPC-A barcode.
Customize UPC-A Barcode Data in VB.NET
Make sure that your have installed those programs before you encode UPC-A data in VB.NET:
- Microsoft .NET Framework 2.0/3.0/4.0
- Microsoft Visual Studio 2005/2008/2010 (Express, Professional & Standard Edition)
- Barcode Generator for .NET Ultimate installed
Encode UPC-A Barcode Data in .NET Project Using VB.NET Class
Copy those following code onto your VB.NET projects:
Dim barcode As BusinessRefinery.Barcode.Linear =
New BusinessRefinery.Barcode.Linear()
barcode.Symbology = BusinessRefinery.Barcode.Symbology.UPCA
barcode.Code = "01234567890"
barcode.drawBarcode2ImageFile("c:/upc-a-vb-net.gif")
Create Supplementay Barcode for UPC-A
In Barcode Generator for .NET Ultimate, the default value of SupplementCode is "".
In Barcode Generator for .NET Ultimate, the default value of SupplementHeight is 0.8f.
In Barcode Generator for .NET Ultimate, the default value of SupplementSpace is 15 pixel.
Copy those following code onto your VB.NET projects:
barcode.Symbology = BusinessRefinery.Barcode.Symbology.UPCA_5
barcode.Code = "01234567890"
barcode.SupplementCode = "12895"
barcode.SupplementHeight = 0.4
barcode.SupplementSpace = 20
Display UPC-A Barcode Human-Readable Text
In Barcode Generator for .NET Ultimate, the default value of DisplayText is true.
In Barcode Generator for .NET Ultimate, the default value of TextFont is new Font("Arial", Font.PLAIN, 11).
Copy those following code to show human-readable text with customized font style:
barcode.DisplayText = true
barcode.TextFont = new Font("Arial", 11.0f, FontStyle.Bold)