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

what is clean sweep?

1506


How you can find the absolute value of the number in qtp?

514


requirement is for combo box your expected value is str= "Denver.Frankfurt.London.Los Angeles.Paris.Portland.San Francisco.Seattle.Sydney.Zurich" you must get the text in combo box and need to compare them how

1468


Have you used xml check point in your project? How?

539


Client is able to provide budget..he want you to choose the automation tool for the web application? which one you will select ? QTP or Selenium ? what are the reasons?

1223






.have you ever written compiled module? if yes , tell me about some of the function that you wrote.

1675


An action has both shared and local OR associated with it and both have the same object in them. In the test which one will be considered?

566


What is a Patch in QTP?

598


What is the limitation to XML Checkpoints?

1597


If a button named "CLICK" is recorded in low level recording mode , what will be the values stored for "name" property of that button in object repository ?

1733


what is the difference between data driver & data driven and driver script?

2132


hi, FOR 3+ QTP INTERVIEW, FOR EXAMPLE WE PUT ONLINE BANKING SYSTEM PROJECT IN OUR RESUME, IN PROJECT MANAGER ROUND...WHAT R THE MAJOR QUESTIONS ARE ASKED IN P.M? PLS TELL ME ATLEAST 10 QUESTIONS?.....AND IF POSSIBLE POST ANSWERS ALSO....

2423


what the difference between shared repository and per action repository?

546


What is the extension of QTP local Repository? If it is .mtr then what is .bdb extension stands for?

570


Which recording modes need more memory?

571