How to get text of link

Links are set by addlink() batch process. I wish to get text on which rectangular link field are placed.

Is it possible? If so how can I get?

Jack Smith

2 Answers

Voted Best Answer

Yes it is possible, but it requires writing a script. The script has to loop through all the words on the page, looking for a match between the link rectangle and the bounding box of the text. Look up the "doc.getPageNthWord" and "doc.getPageNthWordQuads" functions in the Acrobat JavaScript Reference.

Thom Parker
The source for PDF Scripting Info

The Acrobat JavaScript Reference, Use it Early and Often

The most important JavaScript Development tool in Acrobat
The Console Window (Video tutorial)
The Console Window(article)

Having trouble, Why Doesn't my Script Work

By Thom Parker   

Not easily. You would have to get the location of the link's quads and then look for words that fall within those quads.

George Kaiser   

Please specify a reason: