KA.Barcode Generator for ASP.NET
How to Print UPC-A in ASP.NET with Valid Data
Complete ASP.NET source code to generate, print UPC-A images using Barcode Generator for .NET Control
  • Easy to integrate UPC-A generating & printing features into ASP.NET Web application
  • Other barcode solutions provided - Excel barcode, barcode Word, .NET barcode, etc.
  • Simple UPC-A integration into C#.NET, VB.NET class library ASP.NET webform/ websites and MS IIS
  • Programmatically create supplement image EAN-2 and EAN-5 for 1D UPC-A barcodes
  • Compatible with dynamic web browsers, like IE, Opera, Chrome
  • Dynamically encode UPC-A barcodes with valid character sets to insert in ASP.NET web pages
  • Advanced algorithm to automatically apply a check digit for UPC-A 1D barcodes
  • Accurate UPC-A barcode generation compatible with GS1 standard
  • Support to print 2D barcode in ASP.NET as well, including PDF417 ASP.NET, Excel UPC-E, EAN-8 C#
  • High-quality UPC-A image output for all printers (thermal printer included) and scanners
UPC-A Barcode API SDK library for ASP.NET is a best barcode generation function of KA.Barcode Generator for ASP.NET, which is developed to generate UPC-A and other linear, bidimensional barcode symbologies in ASP.NET webform/ website/ web pages. This article provides a complete developer guide for UPC-A data encoding in ASP.NET programs. Besides, KA.Barcode provides other methods for modifying UPC-A barcode size and image with VS.NET:
UPC-A Linear Barcode Information
UPC-A, is also named Universal Product Code version A, UPC-A+2, UPC-A Supplement 2 (Two-digit Add-On), UPC-A+5, UPC-A Supplement 5 (Five-digit Add-On), UPC Bar Code, UPC Symbol, GTIN-12, GS1-12.

UPC-A for ASP.NET encodes:

  • 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

UPC-A for ASP.NET Data Capacity:

  • Fixed-length
  • 11-digits
  • A check digit
UPC-A Data Encoding with C#, VB.NET Class in ASP.NET

Installation of UPC-A Barcode Generator Control into ASP.NET Projects

  1. 1.
  2. 2.
    Add reference: Add "KeepAutomation.Barcode.Web.dll" to your ASP.NET project reference
  3. 3.
    Add to toolbox: To add BarcodeControl to your ASP.NET toolbox
Copy the C# or VB.NET barcode procedure sample onto you forms to convert string into a UPC-A barcode :
using KeepAutomation.Barcode.Bean;
BarCode barcode= new BarCode();
barcode.Symbology= KeepAutomation.Barcode.Symbology.UPCA;
barcode.CodeToEncode = "12345678901";
barcode.generateBarcodeToImageFile("C://barcode-upca-csharp.gif");
Dim barcode As KeepAutomation.Barcode.Bean.BarCode = New KeepAutomation.Barcode.Bean.BarCode

barcode.Symbology= KeepAutomation.Barcode.Symbology. UPCA
barcode.CodeToEncode = "12345678901"
barcode.generateBarcodeToImageFile("C://barcode-upca-vbnet.gif")
Dynamically printing, generating QR Code matrix bar codes in ASP.NET and Winforms; ....
Easy integration into .NET applications to generate QR Code in C#.NET class library; Dynamic barcode components, such as .NET barcode ....
Copy the C#, VB.NET barcoding syntax below to string QR Code images into ASP.NET projects: C# Sample Code; VB.NET Sample Code. using...
more>

Generating UPC-A barcode with Supplement 2-digit Add-On

UPC-A barcode generator for ASP.NET support to add another 2 digits for UPC-A barcode, which encodes: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. Insert the following sample code to transform numeric data text into UPC-A barcode images in ASP.NET webform:
barcode.Symbology= KeepAutomation.Barcode.Symbology.UPCASup2;
barcode.CodeToEncode = "12345678901";
barcode.SupplementCode = "13";
barcode.Symbology= KeepAutomation.Barcode.Symbology.UPCASup2
barcode.CodeToEncode = "12345678901"
barcode.SupplementCode = "13"

Printing UPC-A barcode with Supplement 5-digit Add-On

UPC-A barcode generator for ASP.NET support UPC-A generation with numeric value. Besides, users can add another 5 digits for UPC-A barcode, which encodes: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. Copy the demo code below to string a UPC-A with a five-digit addon in ASP.NET MVC :
barcode.Symbology= KeepAutomation.Barcode.Symbology.UPCASup5;
barcode.CodeToEncode = "12345678901";
barcode.SupplementCode = "13456";
barcode.Symbology= KeepAutomation.Barcode.Symbology.UPCASup5
barcode.CodeToEncode = "12345678901"
barcode.SupplementCode = "13165"
UPC-A Data Encoding with Drag & Drop BarcodeControl
  1. 1.
    In "Choose Toolbox Items" form, click button "Browse...", and select KeepAutomation.Barcode.Web.dll
  2. 2.
    Now you'll see BarCodeControl in your toolbox
  3. 3.
    Drag and drop the BarCodeControl into the Forms and a Codabar image is generated
  4. 4.
    Find barcode setting panel, choose "Symbology" to "UPCA", "UPCASup2" or "UPCASup5"
  5. 5.
    Then input numeric characters in "CodeToEncode" accordingly
  6. 6.
    Input supplement digit in "SupplementCode" if you choose "UPCASup2" or "UPCASup5"
  7. 7.
    A UPC-A, UPC-A+2 or UPC-A+5 barcode with different characters appears
UPC-A Data Encoding in Microsoft Internet Information Service (IIS)
  1. 1.
    Copy folder "barcode" in your download the trial package to your IIS web application folder
  2. 2.
    Create a virtual directory, named "barcode", and link to your just copied "barcode" folder
  3. 3.
    Restart IIS and now you have successfully installed the ASP.NET Barcode Generator web application
  4. 4.
    To test it, open your web browser, and navigate to "http://localhost/barcode/barcode.aspx?symbology=36&code-to-encode=01234567890"
  5. 5.
    A UPC-A barcode with numeric data will be displayed
Note: In IIS, Symbology.UPCA is 36; Symbology.UPCASup2 is 37; and Symbology.UPCASup5 is 38. Users may write "symbology=x&code-to-encode=xxx" or "symbology=x&code-to-encode=xxx&supplement-code=xx" accordingly to change encoded data.