Highlighted
Absent Member.
Absent Member.
548 views

Work with .pdf

Hi Guys, 

I'm trying to check if a text/value from a datatable is in a pdf. Is there any other way than using File Content Checkpoint ? 

E.g. 

Window("Adobe Reader").WinObject("AVPageView").Type micCtrlDwn + "f" + micCtrlUp

Window("Adobe Reader").WinEdit("Edit").Set datatable ("column",dtLocalSheet)

Window("Adobe Reader").WinObject("AVPageView").Click xxxx

Window("Adobe Reader").WinEdit("Edit").Type micReturn

Tags (1)
0 Likes
2 Replies
Highlighted
Respected Contributor.
Respected Contributor.

Hi Tarik,

Here to go!

Sub GetTextLocationUtil()

sSetText= Trim(DataTable("Text/Value",dtLocalSheet))

'The following script uses the GetTextLocation method to retrieve all of the text within the object.

l = -1

t = -1

r = -1

b = -1

result = Window("Adobe Reader").WinObject("AVPageView").GetTextLocation(sSetText, l, t, r, b)

If result Then

 MsgBox "Text found. Coordinates:" & l & "," & t & "," & r & "," & b

End If

End Sub

Regards,

Sakthi.K


If you find that this or any post resolves your issue,
please be sure to mark it as an accepted solution and give Kudos to the author for their assistance.

Regards,
Sakthirajan Kathirvel
0 Likes
Highlighted
Knowledge Partner
Knowledge Partner

I use the dotNet clipboard to copy & search for test in PDF's, you should ba able to tweak this for your requirement

						While Not Browser("CreationTime:=0").WinObject("object class:=AVL_AVView", "text:=AVPageView").Exist
				        	Wait 0,500
				    	Wend
						Browser("CreationTime:=0").WinObject("object class:=AVL_AVView", "text:=AVPageView").Type micCtrlDwn + "a" + micCtrlUp
						wait(1)
						Browser("CreationTime:=0").WinObject("object class:=AVL_AVView", "text:=AVPageView").Type micCtrlDwn + "c" + micCtrlUp
						wait(1)
						Set DNF = DotNetFactory("Microsoft.VisualBasic.Devices.Computer","Microsoft.VisualBasic")
						Set clip = DNF.ClipBoard
						pdfText = clip.GetText
						Wait(2)
						Set DNF = Nothing
						Set clip = Nothing
						res = InStr(pdfText, PROPOSAL_DECISION_DECLINE)
						If res > 0 Then
							REP_PASS 0, sFileName, "Proposal Status Check" , "Proposal Reply Status OK"
						Else
							Browser("CreationTime:=0").Close
							REP_FAIL 0, sFileName, "Proposal Status Check" , "Proposal Reply Status Not As Expected"
						End If

Mark Smith.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.