int totcountPage = 0;public override void OnCloseDocument(PdfWriter writer, Document document){ total.BeginText(); int pageNumber = writer.PageNumber - 1; total.ShowText(Convert.ToString(pageNumber)); total.EndText(); totcountPage = writer.PageNumber; //MessageBox.Show(p.ToString()); }
int i=0;public override void OnEndPage(PdfWriter writer, Document doc){ Paragraph para = new Paragraph(i + " of " + totcountPage + "", footer); doc.Add(para);}