Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How can I create a hover effect for a hyperlink in a pdf?

New Here ,
Mar 20, 2025 Mar 20, 2025

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? 

TOPICS
Edit and convert PDFs , Modern Acrobat , PDF
182
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 20, 2025 Mar 20, 2025

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Apr 07, 2025 Apr 07, 2025

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:

  • Create a text field that will display the hover effect. Set its initial visibility to hidden.
  • Go to 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 07, 2025 Apr 07, 2025

This will not work in Acrobat Reader.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 07, 2025 Apr 07, 2025
LATEST

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.

 

Capture_2504071340.png


Acrobate du PDF, InDesigner et Photoshoptographe
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines