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

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

New Here ,
Feb 28, 2019 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.

TOPICS
Acrobat SDK and JavaScript

Views

391

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

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.

Votes

Translate

Translate
Community Expert ,
Feb 28, 2019 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.

Votes

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

Copy link to clipboard

Copied

Ok, copy this, but still - how?

Votes

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

Votes

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

Copy link to clipboard

Copied

LATEST

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

Votes

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