Welcome, Guest. Please login or register.
Login with username, password and session length

 
Advanced search

18488 Posts in 4838 Topics- by 32654 Members - Latest Member: revitvm
 

AdvancedQTP forums have been nominated as a finalist in ATI’s 2nd annual automation honors awards!

We’d like to thank you for your continued support and participation, and urge you to hurry and vote.

Make you voice count! 


Pages: 1 [2]   Go Down
Print
0 Members and 1 Guest are viewing this topic.
Author Topic: Can Qtp read PDf files?    (Read 4212 times)
Anshoo Arora
Advanced User
*****
Offline Offline

Posts: 855



WWW
« Reply #15 on: March 21, 2010, 03:42:09 PM »

Hi all,

I have a very basic question. What all i have to install to read PDF file thro QTP?
What i have found is, one need below things:
1. Adobe Acrobat Professional 9.0 (Full suite)
2. Adobe Acrobat SDK 9.0

Please correct me... if im missing something.

Thanks,
Sagar

I think having the licensed product is the only requirement. If it doesn't work, you can install the SDK later on, but from what I remember, I didn't have to install the SDK on my machine. I was wondering if there was anyone for whom the SDK had to be installed? I don't know if many people test PDF files, but if someone can provide input, it will be extremely helpful to this thread and its readers.
Logged

Best Regards,

Anshoo Arora
AdvancedQTP Forums Moderator

http://relevantcodes.com - My Blog
Chitradeep Das
Active User
**
Offline Offline

Posts: 91



« Reply #16 on: March 22, 2010, 01:30:50 AM »

Hi,

Please find here an alternative solution (without using the Adobe SDK):

Function F_CheckData(Str)

   'Instantiate the Clipboard object
   Set objCB = CreateObject("Mercury.Clipboard")
   objCB.Clear

   'Set Page Display to Single Page
   Window("regexpwndtitle:=Adobe Reader","regexpwndclass:=AcrobatSDIWindow").Activate
   Window("regexpwndtitle:=Adobe Reader","regexpwndclass:=AcrobatSDIWindow").Type micAltDwn + "v" + micAltUp
   Window("regexpwndtitle:=Adobe Reader","regexpwndclass:=AcrobatSDIWindow").Type "p"
   Window("regexpwndtitle:=Adobe Reader","regexpwndclass:=AcrobatSDIWindow").Type "s"

   'Set zoom to Page fit
   Window("regexpwndtitle:=Adobe Reader","regexpwndclass:=AcrobatSDIWindow").Type micCtrlDwn + "0" + micCtrlUp

   'Select all text in the current page
   Window("regexpwndtitle:=Adobe Reader","regexpwndclass:=AcrobatSDIWindow").Type micCtrlDwn + "a" + micCtrlUp

   Wait 5

   'Copy the whole text in clipboard
   Window("regexpwndtitle:=Adobe Reader","regexpwndclass:=AcrobatSDIWindow").Type micCtrlDwn + "c" + micCtrlUp

   'Get the text from the clipboard using the Clipboard object & search for current contract in it
       PDFTxt = Instr(1, objCB.GetText, Str)

   If (PDFTxt > 0) Then

      F_CheckData = True

   Else

      F_CheckData = False

   End If

   'Destroy the clipboard object
   Set objCB = Nothing

End Function


Regards,
CD
Logged
Chitradeep Das
Active User
**
Offline Offline

Posts: 91



« Reply #17 on: March 22, 2010, 01:41:22 AM »

Hi,

The logical basis.....

Regards,
CD
Logged
abhishek asthana
User
*
Offline Offline

Posts: 27


« Reply #18 on: March 25, 2010, 08:11:25 PM »

does copying to clipboard retain the formatting?
Logged
Manish Bhalshankar
User
*
Offline Offline

Posts: 42


« Reply #19 on: March 28, 2010, 12:32:03 AM »

no you wont be able to check the formating.
Logged

Regards,
Manish
Chitradeep Das
Active User
**
Offline Offline

Posts: 91



« Reply #20 on: March 30, 2010, 06:37:19 AM »

Hi,

Very good point Manish....copying to clipboard won't retain the formatting and that is where it becomes a little challenging.However, if the order of elements is not lost then surely we can construct the statement/line and compare it with the actual message from the external source.

Regards,
CD
Logged
Anshoo Arora
Advanced User
*****
Offline Offline

Posts: 855



WWW
« Reply #21 on: March 30, 2010, 01:10:59 PM »

Abhishek: Would saving the file to the local drive be an alternative?
Logged

Best Regards,

Anshoo Arora
AdvancedQTP Forums Moderator

http://relevantcodes.com - My Blog
abhishek asthana
User
*
Offline Offline

Posts: 27


« Reply #22 on: May 08, 2010, 04:41:09 PM »

yes, i do save the pdf's to local drive....but my problem is slighty different..i have a PDF that has a few elements which can accept data(will not be known in advance), i need to find those fields and ensure that they do accept data....

any suggestions??
Logged
Pages: 1 [2]   Go Up
Print
Jump to: