java - Barbecue barcode generator does not show barcode number with a web app -


i tried barbecue barcode generator in stand alone java application , able print barcodes barcode number displayed in image.

enter image description here

but when execute same method spring web application, generated barcodes not show barcode number in below image. using same file path save images , have full rw permissions directory. have clue on this,

enter image description here

i using below code snippet

barcode = barcodefactory.createcode128a(barcode_id); file f = new file("/opt/rd/barcode/"+barcode_id+".png"); barcodeimagehandler.savepng(barcode, f); 

i've fixed issue in grails setting font barcode , overwriting calculatesize() method in barcode:

private dimension calculatesize(){     dimension d = new dimension();     if(environmentfactory.getenvironment() instanceof headlessenvironment)     try     {          if(font == null)         {             d = draw(new sizingoutput(font, getforeground(), getbackground()), 0, 0, barwidth, barheight);         } else         {             java.awt.fontmetrics fontmetrics = getfontmetrics(font);             d = draw(new sizingoutput(font, fontmetrics, getforeground(), getbackground()), 0, 0, barwidth, barheight);         }     }     catch(outputexception e)     {         e.printstacktrace();     }     else     try     {         java.awt.fontmetrics fontmetrics = null;         if(font != null)         fontmetrics = getfontmetrics(font);         d = draw(new sizingoutput(font, fontmetrics, getforeground(), getbackground()), 0, 0, barwidth, barheight);     }     catch(outputexception e) { }     return d; } 

this thread in sourceforge can shed more light on issue.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -