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

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

Introduction

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

Prototype

public void endText() 

Source Link

Document

Ends the writing of text and makes the current font invalid.

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  w w .ja  va 2 s .  com*/
    tpl.setFontAndSize(getDefaultFont(), 12);
    tpl.setTextMatrix(0, 0);
    tpl.showText(Integer.toString(writer.getPageNumber() - 1));
    tpl.endText();
}