These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Highlighing with a Click

PJF
Registered: May 2 2006
Posts: 11

How would I highlight a line of text when the user clicks on it with the mouse?

My Product Information:
Acrobat Pro 8, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
There is no click event for a PDF page. So to get a click event you need to place an invisible button over the line of text you want highlighted. Now the question is, do you what the highlight effect, or do you want the text selected? To create a highlight effect you can use the Highlight annotation. Just manually place it in the document and then use JavaScript to rename it to something useful. Next, place code in the invisible button to toggle the highlight annot on and off.

Thom Parker
WindJack Solutions
[url=http://www.windjack.com]www.windjack.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://partners.adobe.com/public/developer/en/acrobat/sdk/
pdf/javascript/AcroJS.pdf]Acrobat JavaScript Reference[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script