Article View: adobe.acrobat.sdk
Article #113Re: AcroExch.AVDoc.FindText()
From: Reinhard_Franke
Date: Mon, 23 Mar 2009 15:35
Date: Mon, 23 Mar 2009 15:35
28 lines
1576 bytes
1576 bytes
For me it works correct - I only dislike the msgbox "not found", when the value is false.
Another way would be be to read the text of the page(s) and anlyse it in VBS.
Attached a code snipet for that.
HTH, Reinhard
------------------------------
'// Save this as xxx.vbs and start with Double Click
'// It gives you the text of an already opened PDF
'// if Acrobat or no Doc is open you get an ErrorMsg
set WshShell = CreateObject ("Wscript.Shell")
WshShell.AppActivate("Adobe Acrobat")
WScript.Sleep 500
'// get the active Document
Set AcroApp = CreateObject("AcroExch.App")
Set AVDoc = AcroApp.GetActiveDoc
Set PDDoc = AVDoc.GetPDDoc
Set PdfPage = PDDoc.AcquirePage(1) '<<--SET in FILE! =Pagenumber Set PageHL = CreateObject("AcroExch.HiliteList") PageHLRes = PageHL.Add(0,9000) '<<--SET in FILE! (Start,END[9000=All]) Set PageSel = PdfPage.CreatePageHilite(PageHL)
for i = 0 to PageSel.Getnumtext - 1
pdfData =PDFData & PageSel.GetText(i)
Next
msgBox PDFDATA
Technical Details
Message-ID:
<59b85c6e.6@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newshub.sdsu.edu!webcrossingReferences:
<59b85c6e.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: 10177e,2f91b3743d53ea47 X-Google-Attributes: gid10177e,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: Reinhard_Franke@adobeforums.com Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newshub.sdsu.edu!webcrossing Newsgroups: adobe.acrobat.sdk Subject: Re: AcroExch.AVDoc.FindText() Message-ID: <59b85c6e.6@webcrossing.la2eafNXanI> Date: Mon, 23 Mar 2009 08:35:21 -0700 References: <59b85c6e.-1@webcrossing.la2eafNXanI> Lines: 33 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit