I\'m creating a pdf with iText 5 and want to add a footer. I did everything like the book \"iText in action\" in Chapter 14 says.
There are no errors but the footer
By using showTextAligned method of PdfContentByte We can add footer to our page. Instead of phrase we should pass footer content as string to showTextAligned method as one of the parameter. If you want to format your footer content do before passing it to the method. Below is the sample code.
PdfContentByte cb = writer.getDirectContent();
cb.showTextAligned(Element.ALIGN_CENTER, "this is a footer", (document.right() - document.left()) / 2 + document.leftMargin(), document.bottom() - 10, 0);