count number of pages in a tiff file

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
 
J

jeff

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
 
G

G E W hittle

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
 
A

Al Reid

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.
 
G

G E W hittle

On Wed, 30 May 2007 12:53:22 -0400, "Al Reid"

Al,

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

GW
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top