WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE with Acrobat Viewer

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Access Multiple PDFs

 Keywords: PDF AcroExch.app AcroExch.avDoc GetPDDoc Open Access GetNumPages ObjectCreate Acrobat Get Number Pages

objAcroExch = ObjectCreate("AcroExch.app")      ; ONLY create an application object once

pdffiles = FileItemize( "*.pdf" )

For x = 1 To ItemCount( pdffiles, @TAB )
   objavDoc = ObjectCreate("AcroExch.avDoc") ; Must be created for each open doc

   PDFFileName = ItemExtract( X, pdffiles, @TAB )
   objAVDoc.open(DirScript():PDFFileName,"")
   objPDDoc  = objAVDoc.GetPDDoc

   result= objPDDoc.GetNumPages
   Pause("PDF page count = ":result, PDFFileName)

   objAVDoc.close(0)
   objAVDoc = 0
   objPDDoc = 0

Next

objAcroExch.exit      ; exit the application
objAcroExch = ""      ; close the application object
Exit

Article ID:   W18099
Filename:   Access Multiple PDFs.txt
File Created: 2012:10:12:08:07:16
Last Updated: 2012:10:12:08:07:16