@ Override public void onCloseDocument ( final PdfWriter writer , final Document document ) { template . beginText ( ) ; template . setFontAndSize ( bf , 8 ) ; template . showText ( String . valueOf ( writer . getPageNumber ( ) - 1 ) ) ; template . endText ( ) ; }
we override the onCloseDocument method .