How can I find the number of pages in PDF (the number of converted pages)?

3 views
Skip to first unread message

Support

unread,
Mar 5, 2009, 4:49:36 PM3/5/09
to PDF2Image
Q: I need to submit various size pdfs to be converted to image. Some
of these pdfs are multiple pages. So, when I run your application,
sometimes I get, say, 3 image files. It appears that your callback
feature executed every time an image is written to disk. So that , in
this case, it is called 3 times.

Is there any way to know, when the callback function is called, that
it is the FINAL call. In other words, I need to know when the pdf is
completely processed. Unfortunately, I have no way of knowing the
page number of the pdf prior to the conversion.

-----
A: You could have a counter variable and increment it in the callback
function. You know that processing is finished after PDF2ImageRun()
function returns (i.e. at this time you could use the counter variable
to deduce the number of pages in the document).

If you need a more programmatic approach to convert PDF to image, you
could use PDFNet SDK (e.g. as shown in PDFDraw sample project -
http://www.pdftron.com/net/samplecode.html#PDFDraw). Unlike PDF2Image
SDK, PDFNet will allow you to access any property within a PDF file
(e.g. pdfdoc.CetPageCount(), etc). PDFNet is available as a .NET/JAVA/
C/C++ library on a wide range of platforms.
Reply all
Reply to author
Forward
0 new messages