Copy link to clipboard
Copied
I have tried by going into a pdf and creating a link and customizing it but on most browsers it does not highlight. Is there a script I can add to make it highlight when I hover over those links?
Copy link to clipboard
Copied
There is, but it's likely it won't work correctly in a browser, as most browser PDF plugins have very poor support for scripts, so it's not really worth the trouble.
Copy link to clipboard
Copied
Hello!
I hope you are doing well.
As correctly shared by our community product expert, the plug-ins available for browsers, have their mechanism to render PDFs, and many features may or may not work.
You may try the below suggestions, and may have to customize as per your requirements and environment:
Use JavaScript for Hover Effects:
Open the PDF in Acrobat and go to Tools > JavaScript > Document JavaScripts.
Create a new script and add the following code to show a hover effect:
var linkField = this.getField("linkFieldName");
linkField.setAction("MouseEnter", "this.getField('hoverFieldName').display = display.visible;");
linkField.setAction("MouseExit", "this.getField('hoverFieldName').display = display.hidden;");
Replace "linkFieldName"
with the name of your link field and "hoverFieldName"
with the name of the field that will display the hover effect
Create Hidden Fields:
Tools > Prepare Form
, add a text field, and name it "hoverFieldName"
. Set its visibility to hidden.For more information, please see this article: Acrobat JavaScript API Reference — Acrobat-PDFL SDK: JavaScript Reference
I hope this helps.
Thanks,
Anand Sri.
Copy link to clipboard
Copied
This will not work in Acrobat Reader.
Copy link to clipboard
Copied
You don't need any script.
Remove the link object and replace it by a button form field using the 3 states.
You can use label only, icon only or icon + label.