KA.Barcode for Java
Guide for Encoding Numeric-only Data in Java UPC-A
Complete UPC-A source code to generate, print EAN-13 images using Barcode Generator for Java Control
UPC-A Generator for Java Overview
  • Draw high-quality UPC-A barcodes in Java Class, J2SE applications by setting the size of barcode
  • Supports Java Reports software to set your wanted size of UPC-A
  • Generate and print UPC-A in JDK 1.4.0 and later version
  • Easy to Integrate UPC-A Generator other properties in your Java applications
  • Easy to set the UPC-A barcode image width in Java by changing the X(width of barcode module)
  • Common-used image formats are valid here, which are png, tiff, gif, jpeg and bmp
  • Encode UPC-A valid data with valid data length to generate UPC-A images in Java
UPC-A for Java Valid Character Set
UPC-A, is also named as 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 in Java can only encode numeric digits:
  • Numeric Characters: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Related UPC-A Java Generation Setting Guide
After you purchased UPC-A generator for Java, you may meet some problems in the procedure of generating linear barcode for UPC-A. Here are concerned UPC-A generation setting properties for adjust the image and size, excluding UPC-A data encoding page:
Valid Data length with Numeric Digits to Create UPC-A
Java UPC-A generator can only encode 11 numeric digits from 0 to 9 to generate valid UPC-A image in Java development.
  • Install Java UPC-A generator and set up it;
  • Call UPC-A type in the beginning of Java;
  • Encode UPC-A data;
For example:

BarCode barcode = new BarCode();//Create BarCode object in Java
barcode.setType(IBarCode.UPCA); //Set barcode symbology type to UPCA
//Set UPC-A encoding code value. It should be 11 digits.
barcode.setData("12345678901");
Alternative 2 or 5 Supplement Data for UPC-A Java Generator
The supplement digits are often used on magazines and periodicals to indicate an issue number. You may need to add supplement data to draw proper UPC-A linear barcode in Java with a Virtual Machine on any operating systems.
  • Install Java UPC-A generator and set up it;
  • Call UPCA_2 type in the beginning of Java;
  • Encode UPC-A data;
  • Encode UPC-A supplement data.
// For 2 supplement digits, you may set as below

BarCode barcode = new BarCode();
barcode.setType(IBarCode.UPCA_2);
barcode.setData("12345678901");
barcode.setSupData("12");
// For 5 supplement digits, you may set as below

BarCode barcode = new BarCode();
barcode.setType(IBarCode.UPCA_5);
barcode.setData("12345678901");
barcode.setSupData("12345");