Need to generate QRCode and as many as possible BarCodes based on specific code.
Step 1 – Add necessary libs
After looking to several frameworks which allow generate BarCode for free I stopped on zxing as it support QRCode and several most used in the world BarCodes.
For the moment I used it version was 1.7 and supported BarCodes:
Currently zxing 2.0 is already available, so probably that list of supported BarCodes extended.
Libs available in SonaType repository. I used two modules: core and javase.
Step 2 – Add Service to generate BarCodes
After libs are in place just create very simple Service like following:
Now you need to specify barcode format, data (number or text) and image size (width and height) and can easily render barcode from any taglib or controller like:
Add some AJAX if you want to reload BarCode on the fly…