I am working on a project in java in which a form is filled out and the entered data is passed to bar codes. I already downloaded the jbarcodebean library, I already generated the first field as a barcode.
What I want to know is, How to add the other barcode fields to that same image?
This is what I have to process the barcode of the fields.
JBarcodeBean barcode = new JBarcodeBean();
//nuestro tipo de codigo de barras
barcode.setCodeType(new Interleaved25());
//valor a codificar
barcode.setCode(name);
barcode.setCheckDigit(true);
barcode.setCode(phone);
barcode.setCheckDigit(true);
BufferedImage img;
img = barcode.draw(
new BufferedImage(600, 600, BufferedImage.TYPE_INT_RGB));
//guardar en disco como png
File file = new File("codebar.png");
try {
ImageIO.write(img, "png", file);
}
catch (IOException ex) {
Logger.getLogger(Formulario_1.class.getName()).log(Level.SEVERE, null, ex);
}