Example usage for com.itextpdf.text.pdf PdfTemplate setFontAndSize

List of usage examples for com.itextpdf.text.pdf PdfTemplate setFontAndSize

Introduction

In this page you can find the example usage for com.itextpdf.text.pdf PdfTemplate setFontAndSize.

Prototype

public void setFontAndSize(final BaseFont bf, final float size) 

Source Link

Document

Set the font and the size for the subsequent text writing.

Usage

From source file:com.masscustsoft.service.ToPdf.java

License:Open Source License

@Override
public void onCloseDocument(PdfWriter writer, Document document) {
    PdfTemplate tpl = getPgTpl();
    tpl.beginText();//from w ww  .ja v a 2s  .  com
    tpl.setFontAndSize(getDefaultFont(), 12);
    tpl.setTextMatrix(0, 0);
    tpl.showText(Integer.toString(writer.getPageNumber() - 1));
    tpl.endText();
}