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

How Best to Change an Image in a PDF Document When Cursor's Over Image

Community Beginner ,
May 31, 2025 May 31, 2025

Hello... 

 

I want to put a portfolio document up into Google Docs, and I'd like to make one of the images be able to change to show a variant of it when a prospective employer's cursor is over it. Is there a way to do this, preferable without spending money since I am, as they say, between jobs?

 

I construct my doc in Pages, and then export it to a PDF, which is then uploaded to Google Docs. 

 

Thank you much!

 

Keith

TOPICS
Create PDFs , PDF
240
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
1 ACCEPTED SOLUTION
Community Expert ,
Jun 01, 2025 Jun 01, 2025

You can use fields to do it. A button field can hold an image as its icon and another button field can be set to show/hide that image button when you enter or exit it.

The basic code to do it is this, assuming the second button is named "Image1":

(On Mouse Enter)

this.getField("Image1").display = display.visible;

(On Mouse Exit)

this.getField("Image1").display = display.hidden;

View solution in original post

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 ,
Jun 01, 2025 Jun 01, 2025

You can use fields to do it. A button field can hold an image as its icon and another button field can be set to show/hide that image button when you enter or exit it.

The basic code to do it is this, assuming the second button is named "Image1":

(On Mouse Enter)

this.getField("Image1").display = display.visible;

(On Mouse Exit)

this.getField("Image1").display = display.hidden;

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 Beginner ,
Jun 01, 2025 Jun 01, 2025

Just saw this. I received no notice from Adobe.

 

Thank you for that. I'll give it a shot.

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 Beginner ,
Jun 01, 2025 Jun 01, 2025

Although... wait LOL  How do I do this? I've never employed the use of code in a PDF before. Where / how would I put this into the doc? Do I do this in Pages or Acrobat?

 

Thanks again.

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 ,
Jun 02, 2025 Jun 02, 2025

After adding the field (in Prepare Form mode), right click it and select Properties. Under the Options tab you can select the image (make sure to set it as having an icon first, in the Layout drop-down).

Now go to the Properties of the other field, and under Actions select the Trigger as "On Focus" and the action as "Run a JavaScript" and click Add. Paste the code I provided for that action into the Editor window and click OK. Repeat with the "On Blur" event and the other code.

The result should look like this:

 

try67_0-1748854595298.png

 

 

Click Close and you're done!

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 ,
Jun 02, 2025 Jun 02, 2025

And you need to do it in Acrobat.

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 Beginner ,
Jun 03, 2025 Jun 03, 2025
LATEST

Wow... thanks for taking all that time! I hope I can execute that properly 🙂 but you've certainly given me a great start. 

 

'Preciate it!

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