By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,946 Members | 1,600 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,946 IT Pros & Developers. It's quick & easy.

count number of pages in a tiff file

P: n/a
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
May 30 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a

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 E W hittle" <ol******@gmail.comwrote in message
news:6o********************************@4ax.com...
>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

May 30 '07 #2

P: n/a
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

On Wed, 30 May 2007 09:32:26 -0700, "jeff" <jhersey at allnorth dottt
comwrote:
>
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 E W hittle" <ol******@gmail.comwrote in message
news:6o********************************@4ax.com.. .
>>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
May 30 '07 #3

P: n/a
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.

--
Al Reid
"G E W hittle" <ol******@gmail.comwrote in message news:6o********************************@4ax.com...
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

May 30 '07 #4

P: n/a
On Wed, 30 May 2007 12:53:22 -0400, "Al Reid"
<ar*****@reidDASHhome.comwrote:

Al,

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

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.
May 30 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.