I am trying to add Header and footer in my pdf(iText). For this I have created one servlet and I also created one class HeaderandFooter that extends PdfPageEventHelper.
public class HeaderAndFooter extends PdfPageEventHelper {
public HeaderAndFooter(String name) {
super();
}
@Override
public void onEndPage(PdfWriter writer, Document document) {
super.onEndPage(writer, document);
//code
}
@Override
public void onStartPage(PdfWriter writer, Document document) {
super.onStartPage(writer, document);
//code
}
}
But I dont know what should I write in a method so that It will display heading any text and in footer page no.
Have a look at this example taken from the iText in Action book.