Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

BarCode Image Generator in Java

How can I create a barcode image in Java? I need something that will allow me to enter a number and produce the corresponding barcode image. Is there a free library available for this type of task?

like image 227
om. Avatar asked Nov 09 '09 12:11

om.


1 Answers

iText is a great Java PDF library. They also have an API for creating barcodes. You don't need to be creating a PDF to use it.

This page has the details on creating barcodes. Here is an example from that site:

BarcodeEAN codeEAN = new BarcodeEAN(); codeEAN.setCodeType(codeEAN.EAN13); codeEAN.setCode("9780201615883"); Image imageEAN = codeEAN.createImageWithBarcode(cb, null, null); 

The biggest thing you will need to determine is what type of barcode you need. There are many different barcode formats and iText does support a lot of them. You will need to know what format you need before you can determine if this API will work for you.

like image 199
Chris Dail Avatar answered Sep 21 '22 07:09

Chris Dail