|
Aug 10
2009
|
How to get number of pages in PDF file?Posted by: Swarup in Testing Tools Blogs on Aug 10, 2009 Tagged in: Untagged
|
I created the following simple VBScript for QuickTest Professional to extract number of pages in PDF file:
' Function GetNumPagesInPDF returns the number of pages in PDF file
' FileName - path to given ODF file
' If a file isn't found, then -1 will be returned
Function GetNumPagesInPDF(FileName)
Dim oPDFDoc
Set oPDFDoc = CreateObject( "AcroExch.PDDoc" )
If oPDFDoc.Open( FileName ) Then
GetNumPagesInPDF = oPDFDoc.GetNumPages()
Set oPDFDoc = Nothing
Else
GetNumPagesInPDF = -1
End If
End Function
Attention! For US visitors deep discounted electronics products available! CLICK HERE to check it out.

