26 January 2010

Quick Test Professional Automation with Adobe PDF Documents - III

Accessing the text in the document – Method 1

Set acroAVdoc = CreateObject("AcroExch.AVDoc")
Create an object of the AVDoc class of the API

acroAVdoc.Open "C:\Test.pdf",""
Open the Adobe document to be tested

Set pdDoc = acroAVdoc.GetPDDoc
Get an object of class PDDoc

Set jso = pdDoc.GetJSObject
Get the java object from the PDDoc layer

Print jso.getPageNumWords
Get the total number of words on the page

counter = jso.getPageNumWords
Print counter
For j  = 0 to counter
word = jso.getPageNthWord(0, j)
        Get the word by index j starting from the first page of pdf
Print word
Next

1 comment:

  1. Do u have any solution forvalidating adobe documents opened within IE?

    ReplyDelete