code: protected void printTotalPages(PdfTemplate template, float x, float y) throws VectorPrintException, InstantiationException, IllegalAccessException {
        if (getSettings().getBooleanProperty(Boolean.FALSE, ReportConstants.PRINTFOOTER)) {
           Phrase p = elementProducer.createElement(String.valueOf(lastPage), Phrase.class, stylerFactory.getStylers(PAGEFOOTERSTYLEKEY));
           ColumnText.showTextAligned(template, Element.ALIGN_LEFT, p, x, y, 0);
        }
     }
docs: When the setting {@link ReportConstants#PRINTFOOTER} is true prints the total number of pages on each page when
  the document is closed. Note that
  
  @param template
  @see #PAGEFOOTERSTYLEKEY
  @param x
  @param y