Check the size of a pdf in QTP

Question ID: 104831

I need to get the size of a pdf file in QTP, but don’t have any property to work with.

Marked as spam
Posted by (Questions: 188, Answers: 22)
Asked on January 31, 2013 10:49 pm
Answers (1)
Private answer

You could use the VBScript's FileSystemObject to retrieve the size of the pdf file or any other file for that matter. Here some sample code:

FileName =''C:DocumentsSampleFile.pdf''
Set FSO = CreateObject(''Scripting.FileSystemObject'')
Set FileInfo = FSO.GetFile(FileName)

fileSize = FileInfo.size

MsgBox ''The size of the file is: '' & fileSize

Set FileInfo = Nothing
Set FSO = Nothing

Marked as spam
Posted by (Questions: 2, Answers: 438)
Answered on January 31, 2013 10:51 pm