How can I override or disable Acrobat user settings form highlight colors?

Feb 28, 2019

Copy link to clipboard

Copied

I put a lot of time in designing an OK looking interactive form. I want all the textfields to be white on a colored background. No problem so far. Now when opening the PDF in the reader it shows all the fields in the colors specified in the user preferences of Acrobat. Can be any color but in my case everything turns purple! Have to uncheck the setting to see everything back to normal. I want my file to look the same to anybody opening it no matter what their personal settings are for forms. Is there a way to uncheck these settings when opening the file by executing an action javascript? Hope someone knows a way, it's been bugging me too long now, not a programmer myself obviously. Thanks.

OK. Open your file and to go Tools - JavaScript - Document JavaScripts and add a new item (call it "scripts", for example), with the following code:

if (app.runtimeHighlight && app.alert("The form fields highlighting is enabled. To best view this document it is recommended to turn it off. This will affect other files as well. Do you wish to do so now?",2,2)==4) {

    app.runtimeHighlight = false;

}

Save and close the file and you're done.

TOPICS
Acrobat SDK and JavaScript

Views

60

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

How can I override or disable Acrobat user settings form highlight colors?

Feb 28, 2019

Copy link to clipboard

Copied

I put a lot of time in designing an OK looking interactive form. I want all the textfields to be white on a colored background. No problem so far. Now when opening the PDF in the reader it shows all the fields in the colors specified in the user preferences of Acrobat. Can be any color but in my case everything turns purple! Have to uncheck the setting to see everything back to normal. I want my file to look the same to anybody opening it no matter what their personal settings are for forms. Is there a way to uncheck these settings when opening the file by executing an action javascript? Hope someone knows a way, it's been bugging me too long now, not a programmer myself obviously. Thanks.

OK. Open your file and to go Tools - JavaScript - Document JavaScripts and add a new item (call it "scripts", for example), with the following code:

if (app.runtimeHighlight && app.alert("The form fields highlighting is enabled. To best view this document it is recommended to turn it off. This will affect other files as well. Do you wish to do so now?",2,2)==4) {

    app.runtimeHighlight = false;

}

Save and close the file and you're done.

TOPICS
Acrobat SDK and JavaScript

Views

61

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
Feb 28, 2019 0
Feb 28, 2019

Copy link to clipboard

Copied

It's possible to do it, but there's a problem. If you change the setting to highlight form fields it will not affect only your file, but all the files the user opens, as it's a setting of the application, not the document.

So if you are going to do it I would recommend at least informing the user of this change, or (better yet) asking them if they agree to it, before actually changing it.

Either way it requires embedding a script in the file.

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
Reply
Loading...
Feb 28, 2019 0
Feb 28, 2019

Copy link to clipboard

Copied

Ok, copy this, but still - how?

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
Reply
Loading...
Feb 28, 2019 0
Feb 28, 2019

Copy link to clipboard

Copied

OK. Open your file and to go Tools - JavaScript - Document JavaScripts and add a new item (call it "scripts", for example), with the following code:

if (app.runtimeHighlight && app.alert("The form fields highlighting is enabled. To best view this document it is recommended to turn it off. This will affect other files as well. Do you wish to do so now?",2,2)==4) {

    app.runtimeHighlight = false;

}

Save and close the file and you're done.

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
Reply
Loading...
Feb 28, 2019 2
yumyum36 LATEST
Feb 28, 2019

Copy link to clipboard

Copied

Wow, this is so neat. You just made my day. Thanks so much!

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
Reply
Loading...
Feb 28, 2019 0