Package org.krysalis.barcode4j

Examples of org.krysalis.barcode4j.BarcodeDimension


            if (DevicePrinter.POSITION_NONE.equals(position)) {
                m_barcode.setMsgPosition(HumanReadablePlacement.HRP_NONE);
            } else {
                m_barcode.setMsgPosition(HumanReadablePlacement.HRP_BOTTOM);
            }
            BarcodeDimension dim = m_barcode.calcDimensions(m_sCode);
            m_iWidth = (int) dim.getWidth(0);
            m_iHeight = (int) dim.getHeight(0);
        }
    }
View Full Code Here


            if (DevicePrinter.POSITION_NONE.equals(position)) {
                m_barcode.setMsgPosition(HumanReadablePlacement.HRP_NONE);
            } else {
                m_barcode.setMsgPosition(HumanReadablePlacement.HRP_BOTTOM);
            }
            BarcodeDimension dim = m_barcode.calcDimensions(m_sCode);
            m_iWidth = (int) dim.getWidth(0);
            m_iHeight = (int) dim.getHeight(0);
        }
    }
View Full Code Here

        barcode.setModuleWidth(1.0);
        barcode.setBarHeight(40.0);
        barcode.setFontSize(10.0);
        barcode.setQuietZone(10.0);
        barcode.doQuietZone(true);               
        BarcodeDimension dim = barcode.calcDimensions(value);
        int width = (int) dim.getWidth(0) + 20;
        int height = (int) dim.getHeight(0);       
       
        BufferedImage imgtext = new BufferedImage(width, height,  BufferedImage.TYPE_INT_RGB);
        Graphics2D g2d = imgtext.createGraphics();
       
        g2d.setColor(Color.WHITE);
View Full Code Here

    try
    {
      Configuration cfg = builder.buildFromFile(new File(filename));
      BarcodeGenerator gen = BarcodeUtil.getInstance().createBarcodeGenerator(cfg);

      BarcodeDimension barDim = gen.calcDimensions(data);
      bufImage = new BufferedImage((int) barDim.getWidth(), (int) barDim.getHeight(), BufferedImage.TYPE_BYTE_GRAY);

      bufImage = BitmapBuilder.getImage(gen, data, 300);
    }
    catch (Exception e)
    {
View Full Code Here

      barcodeFactory.setPointPixels(1.5f);
      barcodeFactory.setBitmapResolution(600);
      RenderedImage bi = null;

      if (json.has("barcodeGenerator")) {
        BarcodeDimension dim = new BarcodeDimension(100, 100);
        if (json.has("dimensionWidth") && json.has("dimensionHeight")) {
          dim = new BarcodeDimension(json.getDouble("dimensionWidth"), json.getDouble("dimensionHeight"));
        }
        BarcodeGenerator bg = BarcodeFactory.lookupGenerator(json.getString("barcodeGenerator"));
        if (bg != null) {
          bi = barcodeFactory.generateBarcode(sample, bg, dim);
        }
View Full Code Here

      barcodeFactory.setBitmapResolution(600);

      RenderedImage bi = null;

      if (json.has("barcodeGenerator")) {
        BarcodeDimension dim = new BarcodeDimension(100, 100);
        if (json.has("dimensionWidth") && json.has("dimensionHeight")) {
          dim = new BarcodeDimension(json.getDouble("dimensionWidth"), json.getDouble("dimensionHeight"));
        }
        BarcodeGenerator bg = BarcodeFactory.lookupGenerator(json.getString("barcodeGenerator"));
        if (bg != null) {
          bi = barcodeFactory.generateBarcode(pool, bg, dim);
        }
View Full Code Here

      barcodeFactory.setPointPixels(1.5f);
      barcodeFactory.setBitmapResolution(600);
      RenderedImage bi = null;

      if (json.has("barcodeGenerator")) {
        BarcodeDimension dim = new BarcodeDimension(100, 100);
        if (json.has("dimensionWidth") && json.has("dimensionHeight")) {
          dim = new BarcodeDimension(json.getDouble("dimensionWidth"), json.getDouble("dimensionHeight"));
        }
        BarcodeGenerator bg = BarcodeFactory.lookupGenerator(json.getString("barcodeGenerator"));
        if (bg != null) {
          bi = barcodeFactory.generateBarcode(plate, bg, dim);
        }
View Full Code Here

      barcodeFactory.setPointPixels(1.5f);
      barcodeFactory.setBitmapResolution(600);
      RenderedImage bi = null;

      if (json.has("barcodeGenerator")) {
        BarcodeDimension dim = new BarcodeDimension(100, 100);
        if (json.has("dimensionWidth") && json.has("dimensionHeight")) {
          dim = new BarcodeDimension(json.getDouble("dimensionWidth"), json.getDouble("dimensionHeight"));
        }
        BarcodeGenerator bg = BarcodeFactory.lookupGenerator(json.getString("barcodeGenerator"));
        if (bg != null) {
          bi = barcodeFactory.generateBarcode(library, bg, dim);
        }
View Full Code Here

  private void writeImageToStream(RenderedImage image, OutputStream output) throws IOException {
    ImageIO.write(image, outputType, output);
  }

  public RenderedImage generateBarcode(Barcodable barcodable, BarcodeGenerator barcodeGenerator) throws IOException {
    return getImage(barcodable, barcodeGenerator, new BarcodeDimension(100, 100));
  }
View Full Code Here

  public RenderedImage generateBarcode(Barcodable barcodable, BarcodeGenerator barcodeGenerator, BarcodeDimension dim) throws IOException {
    return getImage(barcodable, barcodeGenerator, dim);
  }

  public void generateBarcode(Barcodable barcodable, BarcodeGenerator barcodeGenerator, OutputStream output) throws IOException {
    writeImageToStream(getImage(barcodable, barcodeGenerator, new BarcodeDimension(100, 100)), output);
  }
View Full Code Here

TOP

Related Classes of org.krysalis.barcode4j.BarcodeDimension

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.