Find the Total Number of PDF Pages
in Asp.Net
The Number Of Pages In A
Specified PDF File Using C# Code in Asp.Net. The PDF File Will Be Read From The
File System.
Note:
You must install iTextSharp.dll as a reference.
c# code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using iTextSharp.text.pdf;
using iTextSharp.text.xml;
string
ppath = "E:\\Documents\\FamousScientists.pdf";
PdfReader pdfReader = new PdfReader(ppath);
int numberOfPages = pdfReader.NumberOfPages;
Response.Write("Total Number of Pages =" + numberOfPages);
Result
Total Number of Pages=5 (Total Pdf Pages)
Thanks for visiting....