Highlighted Fields in forms to be switched off when opening a PDF Form created... How can we do this?

I have created simple customer questionnaires and i understand that when different machines open the forms that the "Highlight Fields" is either on or off depending on how each user has their Reader setup.. Is there any way that when we create the Form and tell Reader when it is opened to have the Highlight Fields switched off?


Craig Smith


4 Answers

Voted Best Answer

As you noticed, the highlighting of fields is an user preference. Therefore, changing the setting behind the user's back is considered to be "not nice".

However, there is a way which is accepted:

• you create a simple document-level script (note that when you add it, you will delete the function definition, and then add the text):

var rths = app.runtimeHighlight ;
app.runtimeHighlight = false ;

• in the willClose Document JavaScript, you will add:

app.runtimeHighlight = rths ;


And that should do it. You are saving the user's setting in the variable rths, and when you close the document, you reset it.

Hope this can help.

Max Wyss.


By Max Wyss   

Hi there, thanks for the advice, this all makes sense altho not being from a programming background (Graphic Designer) can you advise me a little more detail on where we would add this script?

Many thanks

Craig Smith


Craig Smith   

In Acrobat X Pro, you will use the JavaScript panel in the Tools pane; you may have to unhide JavaScript from the dropdown menu in the top right corner of the Tools pane.

For adding the Document-level script, you then click on Document JavaScripts. A dialog opens where you will enter the name of the script (for example "highlighting". Then, a text editing box opens, where you can enter code. Select everything and delete it. Then add the code as described above. Confirm and close dialogs.

For the willClose script, click on Set Document Actions. A dialog opens where you can chose the events. Select Document will close. A text edigint box opens, where you can enter code. Enter the code as described above. Confirm and close dialogs.

Save the document and reopen it.

Hope this can help.

Max Wyss.


Max Wyss   

This works great if client is using Adobe Acrobat but Chromes PDF viewer ignores the javascript. Any ideas on how to get the same result in Chromes Viewer?


Mark Pinkston   


Please specify a reason: