Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PDF Pages

Status
Not open for further replies.

zzfive03

Programmer
Jun 11, 2001
267
Apparently I can not do this with the PDF.OCX component...

Can anyone tell me how I can programaticly determine the #of pages of a PDF file?

Thanks in advance.
 
Hey,

There must be a way to determine the number of pages using API calls. The question is just whether Adobe gives you enough info about thier DLL's and OCX's to use them (try Adobe SDK). Sorry, I am not giving you the answer, but I hope this lets you know you are looking in the right direction.

good luck,
KCI

I just hate it when these issue just sit with no response.
;)~

 
Hi zzfive03,

I have a VB app where I print out the document and show it printing by page number. I have the following code in my print function to determine the pages of a PDF document.

Set objPDFPages = CreateObject("AcroExch.PDDoc")
Var = objPDFPages.Open(ofile)
Pages = objPDFPages.GetNumPages

where objPDFPages is declared at the top of my function with "Dim objPDFPages As Acrobat.CAcroPDDoc". The variables Pages and Var are Long variables and ofile is the absolute path to my pdf(String). Make sure you reference the Acrobat 5.0 Type library in your reference settings for your project and it should work just fine for you.

-kophjager
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top