java - Disable text below barcode image in Code39Bean -
this code creates barcode image along text below image . need remove text image . code39bean not have property disable .
public static bytearrayoutputstream generatebarcodeimg(string inputid) throws exception { bytearrayoutputstream baos = new bytearrayoutputstream(); code39bean bean = new code39bean(); final int dpi = 150; /** * configure bar-code generator , makes narrow bar width * 1 pixel. */ bean.setmodulewidth(unitconv.in2mm(1.0f / dpi)); bean.setwidefactor(3); bean.doquietzone(false); try { /** set canvas provider monochrome png output. */ bitmapcanvasprovider canvas = new bitmapcanvasprovider(baos, barcodeconstant.content_type, dpi, bufferedimage.type_byte_binary, false, 0); /** generate bar code. */ bean.generatebarcode(canvas, inputid); /** signal end of generation. */ canvas.finish(); } catch (ioexception e) { logger.error( "exception occured in barcodegeneration: generatebarcodeimg " + e.getlocalizedmessage(), e); throw new mobileresourceexception( "exception occured in barcodegeneration: generatebarcodeimg", null); } return baos; } }
you can remove text image through "humanreadableplacement" property:
bean.setmsgposition(humanreadableplacement.hrp_none);
this suppress human readable text of barcode none.
Comments
Post a Comment