Count Pages In Pdf File

How :  To count number of pages in a pdf file using VbScript.

Function PageCountInPDFFile(strFile)
    Dim pdfFile, objAcroapp, objPdf
    'Create Automation Objects using VbScript for PDF Operations
    Set objAcroapp = CreateObject("AcroExch.App")
    Set objPdf = CreateObject("AcroExch.PDDoc")
    objPdf.Open strFile,"temp"
    Set pdfFile = objPdf.GetPDDoc
    GetPDFPageCount = pdfFile.GetNumPages
    Set pdffile = nothing
End Function

For gaining more insights in the automation using QTP log on to below url :

Automation Testing Using QTP


Post a Comment

Note: Only a member of this blog may post a comment.