Adding a Toggle Help Button to a PDF

This tutorial shows how to add a "toggle" button to a PDF page that displays some help text when clicked and when clicked again hides the text. This shows how interactive PDF documents can be useful in presenting information

Help Button and Help Text

Help Button and Help Text

This screen shows the two assets that are required.

1. A button which will be used to show and hide the help information

2. The Help text

Adding the Help Button

Adding the Help Button

Use the Button tool from the Acrobat Tools > Advanced Editing menu. Complete the Button Properties tabs and add label text and colour as required.

Adding the Help Button Script

Adding the Help Button Script

From the Actions tab

1. Select Run a JavaScript from the Select Action drop down

2. Click Add

Add the Button Code

Add the Button Code

Enter the JavaScript code.

The text in the first line txtHelp is the name of the Text Field name as defined in the General tab of the Text Field Properties box. SEE THE NEXT STEP FOR THIS INFORMATION.

This text should match the name of the Text Field exactly both in spelling and case (lower/uppercase characters).

Add the Help Text Field Object

Add the Help Text Field Object

From the Forms menu select Add or Edit Fields.

If asked to detect fields select No.

From the forms toolbar that appears at the top of the screen select the Text Field tool and draw a rectangle on the page where the Help text will appear.

Add Name and Tooltip text in the Text Field Properties dialog.

Set Default Help Text

Set Default Help Text

Select the Options tab to add a Default Value to the Text Field.

The Default Value is text that will appear in the text field so that when it is shown it displays as help information.

Type in the text that you want to appear.

Set the Help Information to "hidden"

Set the Help Information to hidden

In order for the Help Text NOT to be visible when the PDF page is opened:

1. From the General tab in the Text Field Properties dialog, set the Form Field value to Hidden.

The script behind the Help button will "toggle" this setting between Visible and Hidden each time it is clicked making the text show and hide.

Previewing

Previewing

Select Forms > Close For Editing.

Select the Hand tool.

Clicking the Help button will show and clicking again will hide the Help text field.

Software used: Adobe Acrobat 9 Pro

Creative Commons Licence
This work is licensed under a Creative Commons Attribution 2.5 UK: Scotland License.

Speak Your Mind

*