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

How to create hover text in an Adobe PDF

Explorer ,
May 19, 2020 May 19, 2020

Copy link to clipboard

Copied

It's actually a little more complicated than the subject line implies.

Making an interactive PDF form.

Can get a short text string to appear or a short text field, using mouse enter action to display a text field.

However, it only dispalys a part of the text in the field and there is no formating.

I would like/need to include in my pdf intructions that will pop up when mouse enter (hover) over a hidden button.   The instructions are usually 6-12 lines long and being able to format them, even just to bold the step numbers in the list, would be good, as well as control the font type and size.

 

I can't think of how to do this except with a mouse enter action that runs a Javascript.   I'm willing to do that, but have no idea the script commands to use (and not finding them on-line).   Can someone provide an example script or point me to a free informational resource?   

TOPICS
Acrobat SDK and JavaScript

Views

2.7K

Likes

Translate

Translate

Report

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

correct answers 1 Correct answer

Community Expert , May 19, 2020 May 19, 2020

You should only edit it once, and then leave it as it is. Set it as read-only and only show/hide it when needed.

Likes

Translate

Translate
Community Expert ,
May 19, 2020 May 19, 2020

Copy link to clipboard

Copied

I would create the fields with the instructions in advance (use a text field with the Rich Text Formatting option enabled, not a button field, though), and then simply show it when the user enters the "trigger" field and hide it when they exit it.

Likes

Translate

Translate

Report

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
Explorer ,
May 19, 2020 May 19, 2020

Copy link to clipboard

Copied

Thanks try67

I only use the button field as a trigger to dispaly the text field.  This is so the text field is normally hidden and then appears when hover over the button.  (I make the button invisible and place over the document section where instructions are to appear) and use the mouse enter to show the text field and the mouse exit action to then hide it.  That works but not all the text shows nor is there any formatting,

 

Will try your Rich Text suggestion and let you know if this solves the issue that only some of the text in the text field is displayed, and if can format it some.

 

So far even when I resize the text field it doesn't show all the text, and only the first line if I hit return in text entry.

 

My fear is I have somehting else going on, like when I first drafted Javascript in word with smart quotes on...then copy and pasted that in. 🙂  Everything looks fine to the human eye...but cleraly not to the compiler...if that is even a thing for Javascript.

Likes

Translate

Translate

Report

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 ,
May 19, 2020 May 19, 2020

Copy link to clipboard

Copied

You've learned a valuable lesson: Never use Word for writing code. I recommend Notepad++, if you're on a Windows machine.

And yes, JS does have a compiler. If you used curly quotes it will display an error message immediately when you enter the code.

Likes

Translate

Translate

Report

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
Explorer ,
May 19, 2020 May 19, 2020

Copy link to clipboard

Copied

Problem solved with respect to single line only appearing...forgot to click the "multi-line" button.

 

Rich Text formatting does not seem to transfer or work, makes the field unstable in that after a few edits it no longer reflects changes made to the properties.    

 

Last time I wrote any amount of code was in the 90s and then it was mostly machine language, Fotran and some Visual Basic.

May try to improve formatting latter, looking for all the functional bits at the moment.   

Likes

Translate

Translate

Report

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 ,
May 19, 2020 May 19, 2020

Copy link to clipboard

Copied

LATEST

You should only edit it once, and then leave it as it is. Set it as read-only and only show/hide it when needed.

Likes

Translate

Translate

Report

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