/** {@inheritDoc} */ @Override public void onCloseDocument(PdfWriter writer, Document document) { template.beginText(); template.setFontAndSize(bf, 8); template.showText(String.valueOf(writer.getPageNumber() - 1)); template.endText(); } }
private void setPagenumberToTOC(Document document){ if(templateList.size() > 0){ PdfTemplate currentPageTemplate_ = (PdfTemplate)templateList.remove(0); currentPageTemplate_.beginText(); currentPageTemplate_.setFontAndSize(PdfUtils.BASEFONT_MINCHO,10); currentPageTemplate_.showText(document.getPageNumber() + ""); currentPageTemplate_.endText(); } }
/** {@inheritDoc} */ @Override public void onCloseDocument(PdfWriter writer, Document document) { template.beginText(); template.setFontAndSize(bf, 8); template.showText(String.valueOf(writer.getPageNumber() - 1)); template.endText(); } }
public void onCloseDocument(PdfWriter writer, Document document) { // fill template with the total page number of this document. template_.beginText(); template_.setFontAndSize(PdfUtils.BASEFONT_MINCHO, size_); template_.showText(String.valueOf(writer.getPageNumber() - 1)); template_.endText(); }
/** * Overrides the method in the PdfPageEventHelper from itext to put the total number of pages into the template. * * @param writer The PdfWriter for this document. * @param document The document. * @see com.lowagie.text.pdf.PdfPageEventHelper#onCloseDocument(com.lowagie.text.pdf.PdfWriter, com.lowagie.text.Document) */ public void onCloseDocument(PdfWriter writer, Document document) { LOG.debug("onCloseDocument() started."); tpl.beginText(); tpl.setFontAndSize(helv, 12); tpl.setTextMatrix(0, 0); tpl.showText("" + (writer.getPageNumber() - 1)); tpl.endText(); }
/** * Overrides the method in the PdfPageEventHelper from itext to put the total number of pages into the template. * * @param writer The PdfWriter for this document. * @param document The document. * @see com.lowagie.text.pdf.PdfPageEventHelper#onCloseDocument(com.lowagie.text.pdf.PdfWriter, com.lowagie.text.Document) */ public void onCloseDocument(PdfWriter writer, Document document) { LOG.debug("onCloseDocument() started."); tpl.beginText(); tpl.setFontAndSize(helv, 12); tpl.setTextMatrix(0, 0); tpl.showText("" + (writer.getPageNumber() - 1)); tpl.endText(); }
template.setFontAndSize(this.baseFont, 12); template.setTextMatrix(50 - this.baseFont.getWidthPoint(String.valueOf(this.writer.getPageNumber()), 12), 0); template.showText(String.valueOf(this.writer.getPageNumber())); template.endText();
tmp.setFontAndSize(bf, 12); tmp.moveText(0, 7); tmp.showText("Hello People"); tmp.endText(); cb.addTemplate(tmp, 36, 343);