After downloading pqScan Java Control for Code 128 Recognition), you can easily integrate it into various Java programs, including Swing, Applet, Java Bean, and J2SE applications. Within two steps, installation can be finished. The first step is to copy pqScan.BarcodeReader.jar to your Java project library folder. And the second one is to add this jar file to Java classpath.
Java: Scan and Decode Code 128
pqScan Java Barcode Scanner SDK is a high-end Java library for linear (1D) and two-dimensional (2D) barcodes reading and decoding. All superior bar code reading functions are well compiled into a single jar file, named pqScan.BarcodeReader.jar. This Java software supports most popular linear (1D) barcode symbols, like Code 128, Code 39 and EAN/UPC. In this article, Code 128 barcode scanning from image in Java application will be talked.
In all, three aspects are included. The first aspect is for installation of Java Code 128 Scanner Library Control. The second one provides Java programming APIs for accurate bar code recognition. And the last is a free online demo code for Java Code 128 detecting and decoding from image source. To see more barcodes scanning tutorials, please refer to: Java Barcode Scanning Tutorial Overview. Or you may directly choose from the right menu bar.
Requirement: Scan Code 128 from Image Only
If you are searching for a Java Barcode Scanner Component to read Code 128 1D barcode symbol from image and this type is the only barcode on your loaded image source file. Then, the following APIs can help you achieve fast Code 128 reading and decoding in Java project.
// Define Code 128 as target barcode symobl and read it only from image file at the disk in Java. public static BarcodeResult[] Scan(String filename, BarCodeType barType); // Define Code 128 as target barcode symobl and read it only from BufferedImage object in Java. public static BarcodeResult[] Scan(BufferedImage image, BarCodeType barType); // Define Code 128 as target barcode symobl and read it only from InputStream object in Java. public static BarcodeResult[] Scan(InputStream imageStream, BarCodeType barType);
Requirement: Recognize ALL Barcodes from Image
Here're another three APIs available for Java Code 128 barcode reading. If you are in need of recognizing all (Code 128) bar codes (more than one type) from image file format using Java class programming, try the following APIs. The decoded result (in array form) will include all barcode types and data information detected on image source.
// Detect and decode Code 128 from local image file. public static BarcodeResult[] Scan(String filename); // Detect and recognize Code 128 from BufferedImage object. public static BarcodeResult[] Scan(BufferedImage image); // Detect and read Code 128 from InputStream object. public static BarcodeResult[] Scan(InputStream imageStream);
You may have a try with the following ReadCode128Demo class to quickly read Code 128 barcode symbol from sample Jpeg image file in Java class application. As you see, only a few lines of Java programming code can implement highly accurate Code 128 barcode reading and recognizing.
import com.pqscan.barcodereader.BarcodeResult; import com.pqscan.barcodereader.BarcodeScanner; import com.pqscan.barcodereader.BarCodeType; public class ReadCode128Demo { public static void main(String[] args) { try { // Read Code 128 1D barcode(s) from Jpeg image file on local disk. BarcodeResult[] results = BarcodeScanner.Scan("C:/sample.jpg", BarCodeType.Code128); for(int i = 0; i < results.length; i++) { // Show all recognized Code 128 information in data array. System.out.println(results[i].getData() + "--" + results[i].getBarType()); } } catch (Exception e) { e.printStackTrace(); } } }