Change the background highlight of PDF form fields in a document

During the CreativePro conference in New Orleans, a question was raised during Chad Chelius’ session about Designing forms in InDesign and Acrobat: how to change the background highlight colour of the fill-in forms within Adobe Acrobat. It is possible to change the value of that colour via the Highlight Colour from the preferences panel, but this is an application-wide change, and changing the colour in one form will change the colour for all documents that are opened thereafter.

fig1

This will also only change the colour on the viewer’s PDF, not the PDF itself.

Luckily, it is possible to change the colour via scripting that will affect the current form but leave others alone. Take the following example – in this form, I would like the background to be grey, rather than the default blue:

fig2

Open the PDF that needs the background to change and open the page thumbnails panel. Right click on the page and select the page properties item.

fig3

In the new dialog, go to the Actions tab at the top right, and then add two actions: on Page Open, run a javascript, and on page close, run a javascript.

fig4

Click on the Page Open Run a Javascript selection and click edit, and in the new window, type the following and click OK.

fig4A

Click on the Page Close Run a Javascript selection and click edit, and in the new window, type the following and click OK.

fig4B

Repeat adding the page level scripts for each page in the PDF. This example has one page, but for a four page PDF, this would need to be done on each page of the PDF.

Save and close the PDF. Open the PDF again and the background has now changed to gray.

fig5

The two javascripts work by saving the current application preferences into memory, and then changing the preferences until the document is closed, and then reloads the original preferences.

The background of any PDF form opened will now be gray until the PDF is closed, so close the PDF and open another PDF to confirm that the background returns to normal.

fig6

If you would like colours other than gray, the javascript syntax for the colour can be found here:

A similar technique is shown in this article in the Acrobat Users forums.

 

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.