Skip to main content
Participating Frequently
March 3, 2021
Question

How to highlight with selected text using javascript in acrobat

  • March 3, 2021
  • 4 replies
  • 3414 views

Hi,

      How to highlight with selected text using javascript in acrobat.

Thanks.

This topic has been closed for replies.

4 replies

JR Boulay
Community Expert
Community Expert
March 3, 2021

If it is the user who has to select the text, wouldn't it be easier and faster if he then simply right-clicked on the selected text?

 

Acrobate du PDF, InDesigner et Photoshopographe
eyenanAuthor
Participating Frequently
March 3, 2021

We need this via scripting, and we have some other process after highlighting.

So user need to select text only.

try67
Community Expert
Community Expert
March 3, 2021

Not possible. JS has no access to the current text selection.

eyenanAuthor
Participating Frequently
March 3, 2021

For Adobe Reader "app.execMenuItem("Annots:TextEditMenu:HighlightSel")" using this. And it is not working in Acrobat.

Bernd Alheit
Community Expert
Community Expert
March 3, 2021

What versions of Acrobat Reader and Adobe Acrobat does you use?

JR Boulay
Community Expert
Community Expert
March 3, 2021

How is the text selected?

By user or by JavaScript?

Acrobate du PDF, InDesigner et Photoshopographe
eyenanAuthor
Participating Frequently
March 3, 2021

User can select the text and will run the script. Then it should be highlighted.

 

Note: It is working fine in Adobe Reader but not working in Acrobat.

Bernd Alheit
Community Expert
Community Expert
March 3, 2021

What is not working in Acrobat?

Bernd Alheit
Community Expert
Community Expert
March 3, 2021

How want you execute the script?

eyenanAuthor
Participating Frequently
March 3, 2021

It may toolbutton or menuitem or whatever.

Bernd Alheit
Community Expert
Community Expert
March 3, 2021

The user can use the highlight tool.