Example usage for com.itextpdf.text.pdf Barcode39 setTextAlignment

List of usage examples for com.itextpdf.text.pdf Barcode39 setTextAlignment

Introduction

In this page you can find the example usage for com.itextpdf.text.pdf Barcode39 setTextAlignment.

Prototype

public void setTextAlignment(int textAlignment) 

Source Link

Document

Sets the text alignment.

Usage

From source file:fc.extensions.itext.Writer.java

License:MIT License

public void writeBarcode(String barcode, float leftX, float bottomY, float scalePercent, boolean isShowCode)
        throws Exception {
    Barcode39 code39 = new Barcode39();
    code39.setStartStopText(false);/*w  w w . j  a v  a  2  s. c  om*/
    code39.setTextAlignment(PdfContentByte.ALIGN_LEFT);
    if (!isShowCode) {
        code39.setFont(null);
    }
    code39.setCode(barcode);
    Image image = code39.createImageWithBarcode(pdfWriterCB, this.baseColor, this.baseColor);
    image.setAbsolutePosition(leftX, bottomY);
    image.scalePercent(scalePercent);
    pdfWriterCB.addImage(image);
}