Is it possible?
Below I have pasted my coding for your quick reference, but its not working.
numWords = this.getPageNumWords(156);
for (var j = 0; j < numWords; j++)
var word = this.getPageNthWord(156,j,false);
Thanks in advance,
content. It can get some information about it (like the textual content or
where a word is located), but can't change it in any (direct) way.
What you can do is overlay the existing text with an opaque text box, where
you can set the font color. Then you populate the box with the text from
the file that you're covering. However, be aware that this will never look
You'll need to place the box using the quads of the word that you're
For access to page contents you'd need to write a plug-in (C or C++). This is possible in a plug-in, but this particular task is surprisingly difficult and challenging, for example two different APIs (text search and PDFEdit have to be worked with and there are no conversions between them, font encodings need to be understood, there are many colour spaces to accomodate, the words to highlight might be split over multiple areas; not a good first plug-in to write.
It's not that much work, actually. You just need to convert the quads to a
rect (which you might already do for your link), then use the addField()
method to add the text box, and then set its properties (font, font size,
font color, read-only, etc.) the way you want them to be.
Also, you can use the MouseUp event of the text box to do the same action
that your link does, so you won't have to create the link on top of the box.