QTP10.com is a new and completely free website that offers help in all the versions of HP QTP (including latest version 10). More importantly, it offers free code for users of HP QuickTest Professioal. This site helps you in learning the basics of QTP and descriptive/advanced programming in (QTP) on various environments like - .Net, Infragistics, Web, Windows, etc.

Note -
This blog is NOT affiliated with HP / Hewlett-Packard in any way. The data/questions come from various sources and we have our own testing questions. I am just another Software Tester like you.

Saturday, May 23, 2009

Reading PDF file using QTP

SPONSORED LINKS

Yesterday I receive a query from a reader of this website.

I have report in PDF file and I need to capture and validate data from PDF file. Could you please let me know how to retrieve data from PDF file using QTP 9.5 ?


Well so far, I know two methods to do it:
1. You can use a 3rd party API for that.
2. Other method to use some DOS tools like PSVIEW which can convert PDF image to text.


For third party API:
If you have Acrobat Writer installed you use ArcoExch object to manipulate pdf files.

Function GetPDFPageCount(filename)
Dim pdfFile,Acroapp,pdf
'PDF File preparations
Set Acroapp = CreateObject("AcroExch.App")
Set pdf = CreateObject("AcroExch.PDDoc")
pdf.Open filename,"temp"
Set pdfFile = pdf.GetPDDoc
GetPDFPageCount = pdfFile.GetNumPages
Set pdffile = nothing
Acroapp.Exit
End Function

Other option is, there is a free library for PDF manipulation is available :
http://www.topshareware.com/Quick-PDF-Library-(public-beta)-download-67987.htm

I never used it, but I think it may help you.
Hope it helps.

SPONSORED LINKS

2 comments:

vaman said...

Hi Thanks for your Blog but no QTP guide pdf format i am seeing some thing can you keep QTP GUIDE. I am unable to see, can you update what is QA role for freshers who are joining in testing environment realtime environment.

lucky said...

As a QA fresher you need to execute Test cases and reporting Bugs/Issues found while running the tests.