Java Barcode Code 39 Scanner Introduction
Scanning and reading barcode Code 39 from image file is a key feature in OnBarcode
Java Barcode Scanner library.
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.
Install
- Add OnBarcode.BarcodeReader.jar to your Java project reference.
Reading & Scanning Code 39 Barcodes in Java class
Using OnBarcode Java Barcode Reader library, you can easily scan and read Code 39 barcodes from image file in Java application.
- Call method
BarcodeScanner.Scan()to read all Code 39 barcode data in the specified image file
String[] datas = BarcodeScanner.Scan( "code39-sample.png", BarcodeType.Code39);
Scan Code 39 barcodes from image object in Java
You can also scan and read Code 39 from
RenderedImage object in Java application.
java.awt.image.RenderedImage renderedImage = ImageIO.read( new File("code39-sample.png")); String[] datas = BarcodeScanner.Scan(renderedImage, BarcodeType.Code39);
Scan Code 39 extensions from image file
To scan Code 39 extension, you need use the target barcode type as
BarcodeType.Code39Extension.
String[] datas = BarcodeScanner.Scan( "code39-extension-sample.png", BarcodeType.Code39Extension);
How to verify scanned Code 39 barcode data with check character in Java class?
The ISO specification of Code 39 and Code 39 extension does not require a compulsory check character. If the Code 39 generator software or printer has generated
the check sum character, the Java Barcode Reader library supports verifying the Code 39 data with the check character in Java application.
It is really simple to enable Code 39 check character verification in the Java code using Java Barcode Scanner SDK.
It is really simple to enable Code 39 check character verification in the Java code using Java Barcode Scanner SDK.
- Set
setCode39WithCheckCharacter()with true inScanOptionsobject - In the returned
BarcodeDetailobject, call methodgetMessage()to get the scanned Code 39 text without check character. - You can also call method
getChecksum()to get the Code 39 check character codeword value (from 0 - 42), and call methodgetShowChar()to get the Code 39 check character in ASCII char.
ScanOptions ops = new ScanOptions(BarcodeType.Code39); ops.setCode39WithCheckCharacter(true); BarcodeDetail[] datas = BarcodeScanner.Scan( "code39-sample.png", ops); for (int j = 0; j < datas.length; j++) { String barcodeText = datas[j].getMessage(); Code39Props barcodeProps = (Code39Props)datas[j].getBarcodeProps(); int checkValue = barcodeProps.getChecksum(); char checkChar = barcodeProps.getShowChar(); }
Common Asked Questions
What is Code 39 barcode used for?
Code 39, also known as Code 3 of 9, was the first barcode to encode both numbers and letters. It is most commonly used in
the inventory, government, military and electronics industries.
Using Java barcode reader library, you can easily read, scan and recognize Code 39 text from barcode images in Java class, desktop application, and JSP, Servlet web application.
What is the Code 39 on a barcode reader?
Code 39 is a 1d barcode symbology that encodes up to 43 characters, including uppercase letters, numbers, and special symbols.
Code 39 extension supports encoding full 128 ASCII characters.
Using Java Code 39 Barcode Scanner library, you can scan and decode all 128 ASCII characters from Code 39 standard and Code 39 extension barcode images in Java class.
How to decode Code 39 barcode?
To scan and decode Code 39 text from a barcode image, a barcode scanner device or reader software will scan all bar and space modules on the Code 39 barcode symbology,
and use a character map to translate the bar and space groups into Code 39 data characters.
OnBarcode Java Barcode Reader library will help Java developer quickly integrate Code 39 barcode scanning and decoding features in Java projects.
What is the difference between Code 39 and Code 128 barcodes?
Code 128 requires a checksum. If the Code 128 barcode is damaged, it may still be scannable. Code 39 checksum is optional.
If the Code 39 barcode without checksum is damaged, it won't be scannable.
In Java class or JSP page, you can scan, recognize and decode both Code 128 and Code 39 barcode text data from image files using Java Barcode Reader library.