I am generating a pdf using itext. So when the content of a page exceeds it creates a new page automatically. I am trying to know if it created a new page. If yes I want to add some image on top of the page.
List paylist =new List(List.ORDERED, List.ALPHABETICAL);
paylist.setIndentationLeft(10);
paylist.add(new ListItem("Some text", yourfont));
document.add(paylist);
The content of the list will be dynamic. So I am unable to find whether its a new page it is in the same page. Suggestion please..
Subclass
PdfPageEventHelperand bind an instance of it to yourPdfWriter:Within that class there’s a method called
onStartPagethat will be called for every page in your document. Use this to add an image to every page, then you don’t have to worry about keeping tracking of things. See this page for a bunch of samples.