java - How to use Barcode4J to get the barcode number? -


i using barcode4j generate barcode image, works fine.

but ui team wanna me write service return barcode number in string them strange reasons. can't figure out how this.

below code snippet how generate barcode image.

final file outputfile = new file(folderpath + "/" + tgtcoreconstants.target_barcode_file_prefix             + orderid + barcode_filename_extension);     outputstream out = null;     try {         out = new fileoutputstream(outputfile);         final bitmapcanvasprovider canvas = new bitmapcanvasprovider(                 out, barcode_mime_type, cncbarcodedpi, bufferedimage.type_byte_binary, false, 0);         bean.generatebarcode(canvas, (storenumber + orderid));         canvas.finish();     }     catch (final filenotfoundexception e) {         log.error("error while generating barcode file order: " + orderid, e);         throw new generatebarcodefailedexception(e);     }     catch (final ioexception e) {         log.error("error while generating barcode file order: " + orderid, e);         throw new generatebarcodefailedexception(e);     } 

the above snippet tells barcode4j encode, render bitmap , write in outputfile string storenumber + orderid, requested service needs

return (storenumber + orderid); 

if need decode barcode given outputfile, @ zxing project.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -