Java Barcode EAN 13 Scanner Introduction
Scanning and reading barcode EAN 13 from image file is a key feature in OnBarcode
Java Barcode Scanner SDK.
Java Barcode Reader is completely developed in Java SDK 1.4.2, and you can easy integrate the barcode reading feature in your Java project without any registration key, activation code.
Related barcode decoder library API
Decode QR Code in Java - Scan, Read QR Code barcode images using Java.
Related barcode decoder library API
Decode QR Code in Java - Scan, Read QR Code barcode images using Java.
Install EAN Barcode Reader library
- Add OnBarcode.BarcodeReader.jar to your Java project reference.
Reading & Scanning EAN-13, EAN-8 Barcodes in Java class
Using OnBarcode Java Barcode Reader library, you can easily scan and read EAN-13 barcodes from an image file in Java application.
You can also use method
- Use method
BarcodeScanner.Scan(), provide image file path and barcode formatBarcodeType.EAN13to quickly read all EAN-13 barcodes from the image file in Java application.
String[] datas = BarcodeScanner.Scan( "ean13-sample-image.png", BarcodeType.EAN13);
You can also use method
BarcodeScanner.ScanInDetails() to get more information about scanned EAN-13 barcodes, including EAN-13 barcode pixel position in the image, barcode rotation angle.
BarcodeDetail[] datas = BarcodeScanner.ScanInDetails( "ean13-sample-image.png", BarcodeType.EAN13);
Scan EAN-13 barcodes from image object in memory
You can also directly scan EAN 13 barcode data from image object (
java.awt.image.RenderedImage) in Java memory using Java Barcode Reader library.
java.awt.image.RenderedImage renderedImage = ImageIO.read( new File("ean13-sample-image.png")); String[] datas = BarcodeScanner.Scan(renderedImage, BarcodeType.EAN13);
Read EAN-8 in Java
Use barcode type
BarcodeType.EAN8 to scan EAN-8 barcodes from image file or image object in Java application.
String[] datas = BarcodeScanner.Scan( "ean8-sample-image.png", BarcodeType.EAN8);
Read EAN-13, EAN-8 with add-on
EAN-13, EAN-8 may contain two- or five- digits add-on symbol. The image below is an EAN-13 barcode with 2-digit add-on symbol.
When the Java Barcode Scanner SDK read the EAN barcodes with add-on data, the barcode library will append the add-on digits after the EAN barcode data.
For the EAN-13 image above, the barcode reader library will return data as
When the Java Barcode Scanner SDK read the EAN barcodes with add-on data, the barcode library will append the add-on digits after the EAN barcode data.
For the EAN-13 image above, the barcode reader library will return data as
012345678912801.
How to use EAN check digit to verify the scanned EAN-13, EAN-8 barcode in Java?
EAN-13 includes one check sum digit in the 13th position. It will be generated during encoding automatically. The Java Barcode Reader library
will use it to make sure the scanned EAN-13 barcode is intact and untampered (the barcode library will directly return null if verification fails).
EAN-8 also includes one checksum digit in the 8th position. The barcode scanner library will verify the scanned EAN8 barcode during decoding.
EAN-8 also includes one checksum digit in the 8th position. The barcode scanner library will verify the scanned EAN8 barcode during decoding.
Common Asked Questions
What is the EAN-13 barcode?
EAN-13 is a 13-digit linear barcode, which contains 12-digit GS1 data message and 1 check digit. EAN is short for European Article Number,
and now it is renamed as GTIN (Global Trade Item Number). EAN 13 code will be used to uniquely identify retail products worldwide.
In Java class, you can use OnBarcode Java EAN-13 Reader library to scan and read EAN-13 barcode text from image files in Java web and desktop applications.
In Java class, you can use OnBarcode Java EAN-13 Reader library to scan and read EAN-13 barcode text from image files in Java web and desktop applications.
How to check if EAN-13 is valid?
In the EAN-13 barcode, the first 12-digit of the number identify the item ID, and the final digit is a "check digit".
Using Java Barcode Reader Library, the scanned and decoded EAN-13 data will be verified by the last check digit.
How to read EAN-13 barcode?
You can use a barcode scanner device or barcode reader software to read and extract EAN-13 numbers from images.
OnBarcode Java EAN-13 Reader library enables Java applications to scan and read EAN-13, UPC-A, QR Code and other 2d, linear barcode text from image files.
How to scan EAN code?
EAN barcode usually includes EAN-13, EAN-8 and 2-digit or 5-digit add-on. You can use EAN barcode software or scanners to capture, read and recognize EAN barcodes from images.
Java Barcode Reader library supports both EAN-13 and EAN-8 (with or without add-on symbols) reading in Java class, JSP and Servlet web applications.