Example usage for com.lowagie.text.pdf BarcodeInter25 setN

List of usage examples for com.lowagie.text.pdf BarcodeInter25 setN

Introduction

In this page you can find the example usage for com.lowagie.text.pdf BarcodeInter25 setN.

Prototype

public void setN(float n) 

Source Link

Document

Sets the bar multiplier for wide bars.

Usage

From source file:br.com.nordestefomento.jrimum.bopepo.view.guia.ViewerPDF.java

License:Apache License

private void setCodigoBarra() throws DocumentException {
    // Montando o cdigo de barras.
    BarcodeInter25 barCode = new BarcodeInter25();
    barCode.setCode(guia.getCodigoDeBarras().write());

    barCode.setExtended(true);/*  ww w .j  ava 2  s. co m*/
    barCode.setBarHeight(40);
    barCode.setFont(null);
    barCode.setN(3);

    PdfContentByte cb = null;

    // Verifcando se existe o field(campo) da imagem no template do boleto.
    float posCampoImgLogo[] = form.getFieldPositions("txtCodigoBarra");

    if (isNotNull(posCampoImgLogo)) {

        RectanglePDF field = new RectanglePDF(posCampoImgLogo);

        cb = stamper.getOverContent(field.getPage());
        Image imgBarCode = barCode.createImageWithBarcode(cb, null, null);

        PDFUtil.changeField2Image(stamper, field, imgBarCode);
    }
}

From source file:br.com.nordestefomento.jrimum.bopepo.view.ViewerPDF.java

License:Apache License

private void setCodigoBarra() throws DocumentException {

    // Montando o cdigo de barras.
    BarcodeInter25 barCode = new BarcodeInter25();
    barCode.setCode(boleto.getCodigoDeBarras().write());

    barCode.setExtended(true);//from   ww  w .j  a  v a 2 s  . co m
    barCode.setBarHeight(40);
    barCode.setFont(null);
    barCode.setN(3);

    // FICHA DE COMPENSAO
    PdfContentByte cb = null;

    // Verifcando se existe o field(campo) da imagem no template do boleto.
    float posCampoImgLogo[] = form.getFieldPositions("txtFcCodigoBarra");

    if (isNotNull(posCampoImgLogo)) {

        RectanglePDF field = new RectanglePDF(posCampoImgLogo);

        cb = stamper.getOverContent(field.getPage());
        Image imgBarCode = barCode.createImageWithBarcode(cb, null, null);

        PDFUtil.changeField2Image(stamper, field, imgBarCode);
    }
}

From source file:org.jrimum.bopepo.pdf.CodigoDeBarras.java

License:Apache License

public Image toImage() {

    // Montando o cdigo de barras.
    BarcodeInter25 barCode = new BarcodeInter25();
    barCode.setCode(this.write());

    barCode.setExtended(true);/*from  w  w  w  .  j a  v a  2  s .  com*/
    barCode.setBarHeight(35);
    barCode.setFont(null);
    barCode.setN(3);

    return barCode.createAwtImage(Color.BLACK, Color.WHITE);
}