Find number of pages in a tif file from a .net application

sb_rkarnati

Member
Joined
Dec 20, 2007
Messages
6
Programming Experience
10+
Hi,

We are working on a project where we need to identify the number of pages in a tif/pdf file from our .net application.

Please let me know how to proceed in this regard. One way to proceed is to use some third party tools for this purpose for for this project, we will not be able to use any external tools.

Thanks in advance
RS
 
try this for Tiff image file:
VB.NET:
Dim img As Image = Image.FromFile(filename)
Dim [COLOR="Blue"]numpages[/COLOR] As Integer = img.GetFrameCount(Imaging.FrameDimension.Page)
img.Dispose()
 
For simple PDF files, search for the following string :-

VB.NET:
<< /Type /Pages /Count XXXXX

where XXXXX will be the quantity of pages in the PDF document
 
Back
Top