In our application (Web based application)we will get a pdf
file and we have check a particular text in that pdf. Can
any one tell how to check text in a pdf file.

In the same pdf file it generating some links and I have to
click that links. QTP unable recognizing that links, even
id did record and playback qtp does not generating any
script.

Can any one help me….?

Answer Posted / nanda

Hi...we should have add in for it. but with add in also we
do it..by copieng pdf test to a text file.

for this...
string1 = "nanda"
len_data = len(string1)
i=0
file_path = "C:\Documents and Settings\Madhu
Sudhan\Desktop\pdftotext.text"
Set clipboard = createobject("mercury.clipboard")

Set fso = createobject("scripting.filesystemobject")
Set notepad = fso.createtextfile(file_path,8)

'*********Start recording click on Edit menu--select all,
'click on Edit menu--copy, click on pdf file to get deselect
'the text...************
Window("Adobe Reader").Activate
Window("Adobe Reader").WinMenu("Menu").Select "Edit;<Item 8>"
Window("Adobe Reader").WinMenu("Menu").Select "Edit;<Item 4>"
Window("Adobe Reader").Activate
get_text = clipboard.gettext
notepad.write get_text
notepad.close

set notepad = fso.opentextfile(file_path,1)

do while notepad.AtEndofStream <> true

get_data = notepad.readline

search_data = instr(get_data, "nanda")
capture_data = mid(get_data,search_data,len_data))
if capture_data = string1 then

i = i+1
else
end if

loop

msgbox "the text is found in "& i" rows"

for any queries...
nanda.dreddy@gmail.com

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to import a test case present in ".xls" file to TD under a Test set?

1018


Hello, Is there any way to send the test results in html format (or any other) by email using outlook after the test run ends? thank you in advance

2021


Have you used xml check point in your project?

784


What are the advantages of qtp?

806


how can we preform retesting(DATA driven test) using function please gine the code for loginpage

2556


Hi How to retrieve data from web element line by line?

1830


What are the things(properties, and other details) will be recorded while recording an object using normal recording?

1757


www.icici.com after this home page wll came, in this page what r the items we r going to test for manual and what the element we r test for QTP... explian clearly with example

1773


How to find operating system information using the qtp script?

853


How to use Environment parameterization? Explain with an example.

1758


what are the issues we will get when there is migration from QTP 8.2 to QTP 10.0? Is there any problem in executing scripts of 8.2 on 10.0?

1704


how to know no.of mails in our g mail by using vb-script

2016


assume i have few url link how will i dynamically call then using descriptive programming?

1829


Can we run test with out adding object in object repository? How it is possible?

849


What is expert view and keyword view?

891