QR Code Image Sample - pqScan.com
Java UPC-A Scanner SDK Building up perfect quality UPC-A barcode scanning in Java Download Trial Purchase Now

UPC-A Barcode Scanning in Java

back to home  >  Java Barcode Scanner SDK  >  How to Read Barcodes in Java  >  UPC-A Barcode Recognition in Java

Multiple 1D bar code symbologies can be scanned and decoded from image file by Barcode Scanning Control for Java, like UPC-A, UPC-E, EAN-13, EAN-8, Codabar, Code 128, Code 93, Code 39, and ITF-14. This professional barcode reading software in Java supports JDK 1.7 and above versions. Fast barcode reading and scanning features are well developed into a jar file.

On this online guide, we will concentrate on Java UPC-A 1D barcode recognition and decoding. UPC-A barcode symbology encodes 12 data characters (0-9, and start/stop characters) including checksum digit. So, the bar code decoding result will includes 12 data characters. And the last data would be its checksum digit. Please note that, the first decoded data will be a "?" character if you are using the free trial package of Java Barcode Scanner Library.

Java UPC-A Reader Installation

To begin with, users are supposed to install Java Barcode Reader Software into your own Java application. And this is quiet easy. Only two steps are required.

  • Copy pqScan Java Barcode Scanner SDK jar file to your Java project library folder.
  • Add pqScan Java Barcode Scanner SDK jar to your Java classpath.

Java UPC-A Scanning APIs

pqScan Java Barcode Scanner Component empowers Java programmers to read and recognize UPC-A from various image file formats with advanced APIs, like BMP, JPEG, PNG, TIFF and GIF. Besides, BufferedImage and InputStream are also supported. Please see detailed introductions for all feasible APIs.

// Fast barcode scanning and reading from local image file in Java class.
public static BarcodeResult[] Scan(String filename);
// Fast barcode recognition from BufferedImage object in Java class.
public static BarcodeResult[] Scan(BufferedImage image);
// Fast barcode detecting and reading from InputStream object in Java class.
public static BarcodeResult[] Scan(InputStream imageStream);
// Recognizing UPCA only from local image file in Java class.
public static BarcodeResult[] Scan(String filename, BarCodeType barType);
// Decoding UPCA only from from BufferedImage object in Java class.
public static BarcodeResult[] Scan(BufferedImage image, BarCodeType barType);
// Scanning UPCA only from InputStream object in Java class.
public static BarcodeResult[] Scan(InputStream imageStream, BarCodeType barType);

Java UPC-A Recognition Sample Code

Please see the following ReadUPCADemo class. Only a few lines of Java programming code can do fast and accurate UPC-A barcode detecting and decoding in Java application. This free demo will only read UPC-A linear bar code font from loaded image file source. If you want to decode other barcodes contained in the image, please use the first three APIs above.

import com.pqscan.barcodereader.BarcodeResult;
import com.pqscan.barcodereader.BarcodeScanner;
import com.pqscan.barcodereader.BarCodeType;

public class ReadUPCADemo
{
    public static void main(String[] args)
    {
        try
        {
            // Recognize UPCA barcode only from image file source.
            BarcodeResult[] results = BarcodeScanner.Scan("C:/sample.jpg", BarCodeType.UPCA);

            for(int i = 0; i < results.length; i++)
            {
                // Output recognized UPCA data characters.
                System.out.println(results[i].getData() + "--" + results[i].getBarType());
            }
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
    }
}
pqScan SDK
Java Barcode Scanner Library
Online Guide
Java Barcode Reading & Scanning
Barcode Type
Scan 2D QR Code in Java Scan 2D Data Matrix in Java Scan 2D PDF-417 in Java Scan 2D Aztec Code in Java Scan 1D EAN-13 in Java Scan 1D EAN-8 in Java Scan 1D UPC-A in Java Scan 1D UPC-E in Java Scan 1D Code 128 in Java Scan 1D Code 39 in Java Scan 1D Code 93 in Java Scan 1D Codabar in Java Scan 1D ITF-14 in Java View All Barcodes >>
Love it! I have to say, your software is worth the price. I would definitely continue to recommend this product to anyone who is in need. Trevor Barr