Spire.barcode for Java component (ii) Identification of barcode, two-dimensional code __java

Source: Internet
Author: User

Spire.barcode for Java support generates a variety of one-dimensional, two-dimensional barcodes, such as code 128,pdf 417 and QR code, and it also supports the recognition of these barcodes from the picture. The previous article-spire.barcode the for Java component (i) to generate barcodes, two-dimensional codes (QR Code,code 128,ean 13, etc.), has described how to use this article to describe how to use Spire.barcode for Java to generate barcodes. This article will describe how to Spire.barcode for Java to identify barcodes.

The following figure is a code 128 barcode Picture:


Before you can use the following code, you need to download Spire.barcode for Java and then import the Spire.Barcode.jar file into your project.

Import Com.spire.barcode.BarCodeType;
Import Com.spire.barcode.BarcodeScanner;

public class scan_barcode{public

	static void Main (string[] args) throws Exception {
        ///using the Scan method to identify code 128 code from the picture
        string[] datas = Barcodescanner.scan ("c:\\code128.jpg", barcodetype.code_128);       
        System.out.print (Datas[0]);
	}

Identification results:


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.