Getting the current page number is very simple. You have an instance PdfWriternamed writer. You can set this instance for the current page number:
int pageNo = writer.PageNumber
In Java:
int pageNo = writer.getPageNumber();
Getting the total number of pages is not possible if you cannot look into the future. When you are on page 1, iText does not know how many pages you add. Perhaps you call the method immediately Close(), in which case the total number of pages is 1. Perhaps you plan to add one hundred pages.
.
# 1: PDF
PDF . PdfStamper . Q & A:
# 2:
PdfTemplate . , Close(), .
:
.