.NET Barcode UPC-A Generator for .NET, C#, ASP.NET, VB.NET
.NET Barcode offers the most affordable .NET barcode generator for barcode .NET professionals.
.NET UPC-A Introduction
UPC-A is also known as Universal
Product Code version A, UPC-A Supplement 5/Five-digit Add-On, UPC-A Supplement
2/Two-digit Add-On, UPC-A+5, UPC-A+2, UPC Code, UPC Symbol, GTIN-12, GS1-12, UCC-12
UPC-A is used for marking products
which are sold at retail in the USA. The barcode identifies the manufacturer
and specific product so point-of- sale cash register systems can automatically
look up the price.
The UPC-A Code and the assignment of manufacturer ID numbers is controlled in
the U.S.A. by the Uniform Code Council (UCC).
How to generate UPC-A barcodes in C#.NET Class?
The following C# .NET code illustrates how to generate a UPC-A barcode in C# class:
using KeepDynamic.Barcode.Generator;
BarCode barcode = new BarCode();
barcode.SymbologyType = SymbologyType.UPCA;
barcode.CodeText = "00123456789";
barcode.Format = ImageFormat.Png;
barcode.drawBarcode("C://barcode-upca-csharp.png");
barcode.drawBarcode("Graphics object");
barcode.drawBarcode("Stream object");
How to generate UPC-A barcodes in VB.NET Class?
The following VB.NET code illustrates how to generate UPC-A barcodes in VB.NET class:
// Create linear barcode object in VB.NET
Dim barcode As KeepDynamic.Barcode.Generator.BarCode
barcode = New KeepDynamic.Barcode.Generator.BarCode()
// Set barcode symbology type to UPC-A in VB.NET
barcode.SymbologyType = SymbologyType.UPCA;
// Set UPC-A barcode value in VB.NET
barcode.CodeText = "00123456789"
// Set UPC-A drawing image format to PNG in VB.NET
barcode.Format = ImageFormat.Png
// Generate UPC-A barcode & encode to the png image in VB.NET
barcode.drawBarcode("C://barcode-upca-vbnet.png")
// Generate UPC-A barcode & print to System.Drawing.Graphics object in VB.NET
barcode.drawBarcode("Graphics object")
// Create UPC-A barcode & draw to System.IO.Stream object in VB.NET
barcode.drawBarcode("Stream object")
Creating UPC-A barcodes using .NET Barcode Generator Windows Form Control
To create UPC-A barcodes in Windows Forms applications, do the following procedures:
- Add KeepDynamic.BarCode.Windows.dll to your C#, VB.NET project reference
- Add KeepDynamic.BarCode.Windows.dll to windows project toolbox
- Drag the BarCodeControl item to your windows forms
Creating UPC-A barcodes using ASP.NET Barcode Generator ASP.NET Web Form Control
To create UPC-A barcodes in ASP.NET Web Forms applications, do the following procedures:
- Add KeepDynamic.BarCode.AspNet.dll to your C#, VB.NET project reference
- Add KeepDynamic.BarCode.AspNet.dll to windows project toolbox
- Drag the BarCodeControl item to your ASP.NET Web form pages, in your ASP.NET design view
.NET UPC-A Barcodes Properties
| Class Properties |
HTTP Parameters |
Default |
Comments |
| SymbologyType |
symbology-type |
SymbologyType.Code128 |
Barcode type. Values for UPC-A are SymbologyType.UPCA,
SymbologyType.UPCA_2, SymbologyType.UPCA_5
|
| CodeText |
code-text |
"" |
Barcode value to encode. Valid value is 11 digits. |
| EnableChecksum |
enable-checksum |
true |
Checksum for barcode value |
| SupplementData |
supplement-data |
"" |
Barcode supplementary value to encode. only valid for EAN-8, EAN-13, UPC-A, UPC-E, ISBN, ISSN |
| SupplementSpace |
supplement-space |
15 |
Barcode supplementary space between main barcode and supplement barcode. only valid for EAN-8, EAN-13, UPC-A, UPC-E, ISBN, ISSN |
| GraphicsUnit |
graphics-unit |
GraphicsUnit.Pixel |
BarCode graphics meature for all size related settings. 0: pixel; 1: cm; 2: inch. Default is pixel |
| X |
x |
2 |
Width of barcode module (narrow bar), default is 2 pixel |
| Y |
y |
75 |
Barcode module height, default is 75 pixel |
| LeftMargin |
left-margin |
0 |
Barcode image left margin |
| RightMargin |
right-margin |
0 |
Barcode image right margin |
| TopMargin |
top-margin |
0 |
Barcode image top margin |
| BottomMargin |
bottom-margin |
0 |
Barcode image bottom margin |
| Resolution |
resolution |
72 |
Barcode image resolution in dpi |
| Rotate |
rotate |
0 |
Barcode rotate angle, valid values: 0, 90, 180, 270 |
| DisplayCodeText |
display-code-text |
true |
If true, display barcode value text, otherwise do not display. |
| CodeTextFont |
code-text-font |
"Arial", Font.PLAIN, 11 |
Barcode text font style |
| Format |
format |
ImageFormat.Png |
Image format type. Using System.Drawing.Imaging.ImageFormat |
.NET Barcode Generator supports most common linear (1d) and matrix (2d) bar code standards, including: