String input = barcodable.getIdentificationBarcode();
if (input != null && !"".equals(input)) {
String enc = new String(Base64.encodeBase64(input.getBytes("UTF-8")));
BitmapCanvasProvider provider = new BitmapCanvasProvider(bitmapResolution, imageType, antialias, orientation);
provider.establishDimensions(dimension);
if (barcodeGenerator instanceof AbstractBarcodeBean) {
AbstractBarcodeBean bean = (AbstractBarcodeBean)barcodeGenerator;
bean.setModuleWidth(UnitConv.in2mm(pointPixels / bitmapResolution));
bean.doQuietZone(false);
bean.generateBarcode(provider, enc);
}
else {
barcodeGenerator.generateBarcode(provider, enc);
}
provider.finish();
return provider.getBufferedImage();
}
return null;
}