Adding Header and Footer in PDF using iText in Java

You may also like...

  • rozya

    to get the right number of pages you need to replace String.valueOf(writer.getPageNumber()) by String.valueOf(writer.getPageNumber()-1) in public void onCloseDocument(PdfWriter writer, Document document)
    thanks, the code was helpful