public void initCode39Bean() { code39Bean = new Code39Bean(); final int dpi = barcodeDpi; // Configure the barcode generator code39Bean.setModuleWidth(UnitConv.in2mm(1.0f / dpi)); // makes the // narrow bar // width exactly one pixel code39Bean.setBarHeight(barHeight); code39Bean.setWideFactor(wideFactor); code39Bean.doQuietZone(false); }
public String createScancodePic(String ordernum) throws IOException { this.initPath(); try { BitmapCanvasProvider canvas = getCanvas(); // BitmapCanvasProvider canvas = new BitmapCanvasProvider(out, // "image/jpeg", dpi, BufferedImage.TYPE_4BYTE_ABGR, false, 0); // Generate the barcode code39Bean.generateBarcode(canvas, ordernum + ""); // Signal end of generation canvas.finish(); } catch (NullPointerException e) { throw e; } catch (FileNotFoundException e) { throw e; } catch (IOException e) { throw e; } finally { try { if (null != outputStream) { outputStream.close(); } } catch (IOException e) { throw e; } } // return picFullName; return abstractPicFullName; }