Originally Barcodes were 1D representation of data using width and spacing of bars. Common bar code types are UPC barcodes (as shown) which are seen on product packages.
There are 2D barcodes as well (they are still called Barcodes even though they don’t use bars). A common example of 2D bar code is PDF417, QR Code (as shown) which is commonly used by mobile phone apps. You can read history and more info about .
There is an open source Java library called ‘zxing’ (Zebra Crossing) which can read and write many differently types of bar codes formats.
I tested zxing and it was able to read a pure barcode and embedded in the middle of a 100 dpi grayscale busy text document!
This article demonstrates how to use zxing to read and write bar codes from a Java program.
1- Getting the library
To download the source code and build the binaries, which was actually quite easy.
The source code of the library is available on . At the time of writing, 2.0 is the latest version of zxing.
- Download the release file ZXing-2.0.zip (which contains of mostly source files) from .
- Unzip the file in a local directory
- You will need to build 2 jar files from the downloaded source: core.jar, javase.jar
2- Including the libraries in your project
If you are using ant or normal project, add the core.jar and javase.jar to your project’s classpath.
Once you have the jars included in your project’s classpath, you are now ready to read and write barcodes from java!
Below is an example using the zxing API as generic way of reading and writing any type of barcodes, and improve this engine with hints passed to encoder or decoder methods.
3- Reading a Bar Code
You can read the bar code by first loading the image as an input stream and then calling this utility method.
4- Writing a Bar Code
You can encode a small text string as follows:
5- JavaDocs & documentation help
Hi Please find the below link contains the full explanation of barcode API. Developing advanced Barcode applications using "BarcodeEngine" libraryIf you need any other help leave your comments, it will be nice if you leave your Reactions.