I've created a class that extends PdfPageEventHelper to add a specific message at the end of the page. The problem is that this text need to be added only to the end of the PDF (if I have 3 pages this text need to be displayed only on the footer of the last page).
In the OnEndPage function of the PdfPageEventHelper class I use document.PageNumber to know what page I'm modifying, but how can I know if this page is the last one?
Thanks.
(writer.PageNumber - 1) is the last page.