count number of pages in a tiff file

  • Thread starter Thread starter G E W hittle
  • Start date Start date
G

G E W hittle

I have a directory of tiff files. I need to loop thru the files and
count the number of pages in each file. Can someone point me to where
this info is stored?

GW
 
how are you 'looking' at these tiff files...

I have done some work using the MODI control ... Microsoft Office Document
Imager. This control exposes pretty much everything for the tiff file ...
the only thing it does not do is allow you to annotate the file.

Now saying this, you need to ensure that all your users have Microsoft
Office 2003+ installed to use this object.

Jeff
 
Thanks Jeff, I'll look at the MODI Control. The Document Imager is
actually what I used to determint that the number of pages was
actually stored in there, I just didn't realize there was a control
available for it.

I started out loading the tiff as a bitmap then looking thru the
available methods to retrieve the page count, but I keep coming up
with 1 when using the getframecount.

GW
 
Here is a function that will give the page count:

Public Function GetTifPageCount(ByVal TifPath As String) As Integer

Dim PageCount As Integer

Dim theTIFF As Image = Image.FromFile(TifPath)

PageCount = theTIFF.GetFrameCount(FrameDimension.Page)

theTIFF.Dispose()

Return PageCount

End Function



I hope this helps.
 
On Wed, 30 May 2007 12:53:22 -0400, "Al Reid"

Al,

Thank you. I was not adding the .page after the framedimension

GW
 
Back
Top