Skip to main content
Participating Frequently
December 27, 2019
Answered

Fields highlight color

  • December 27, 2019
  • 4 replies
  • 5833 views

Hi guys,

 

I made a form. I changed the fields highlight color to what I want - brown color using this path Tools > Preferences > Forms > Fields highlight color > Brown > OK.

However, it switched back to default color - purple color if I use another laptop to open the form.

Is that any way to make the fields highlight color to be brown even if I switch device to open it?

Javascript or any field i can use to make this happen? 

Thank you.

 

 

This topic has been closed for replies.
Correct answer JR Boulay

Try these scripts.

 

Place this one as a document level script:

 

// stores user's preferences

var hiliUserPrefs = app.runtimeHighlight;
var colorUserPrefs = app.runtimeHighlightColor;
// changes application highlight color

app.runtimeHighlight = true;
app.runtimeHighlightColor = ["RGB", 0.96, 0.96, 0.96]; // grey color

 

 

Place this one as a "Document will close" action:

 

// reverts to user's preferences

app.runtimeHighlight = hiliUserPrefs;
app.runtimeHighlightColor = colorUserPrefs;

4 replies

JR Boulay
Community Expert
Community Expert
December 28, 2019

You are obviously right, but as an apology, I must clarify that:

- above script just revert to default Acrobat settings (highlight on with a light blue color),

- these forms are intended for use in corporate environments, where all forms share the same settings and all computers share the same presets.

 

😉

Acrobate du PDF, InDesigner et Photoshopographe
JR Boulay
Community Expert
Community Expert
December 27, 2019

In most of my forms I just use:

 

app.runtimeHighlight = true;
app.runtimeHighlightColor = ["RGB", 204/255, 214/255, 255/255]; // light blue

 

And I never received any complaints or comments…

😉

Acrobate du PDF, InDesigner et Photoshopographe
try67
Community Expert
Community Expert
December 27, 2019

But if you change that color to something people don't expect to see, you might. Also, many users might not realize that it's your file that's making this change. They could just assume it's a bug in the application... I think you should at least notify the user of making this adjustment to the app settings, or better yet, ask for their permission before doing so.

JR Boulay
Community Expert
JR BoulayCommunity ExpertCorrect answer
Community Expert
December 27, 2019

Try these scripts.

 

Place this one as a document level script:

 

// stores user's preferences

var hiliUserPrefs = app.runtimeHighlight;
var colorUserPrefs = app.runtimeHighlightColor;
// changes application highlight color

app.runtimeHighlight = true;
app.runtimeHighlightColor = ["RGB", 0.96, 0.96, 0.96]; // grey color

 

 

Place this one as a "Document will close" action:

 

// reverts to user's preferences

app.runtimeHighlight = hiliUserPrefs;
app.runtimeHighlightColor = colorUserPrefs;

Acrobate du PDF, InDesigner et Photoshopographe
Participating Frequently
December 27, 2019

With this script, only the file that I want the fields will be in grey?

It will affect ALL other files opened on that machine?

try67
Community Expert
Community Expert
December 27, 2019

This color is a property of the application, not the file. You should set the fill color of your fields directly instead of relying on it. However, the highlight color overrides the fill color you select (if enabled), so you should inform your users that they should disable it for the best viewing experience.

A script can be used to detect if the fields highlighting is enabled, and then display a warning message. It can even disable it (or change the highlight color), but I would not recommend you do that as it will affect all other files as well and the users might not be too happy about that...

Participating Frequently
December 27, 2019

I found a solution to let even if i open this pdf in other laptop, it will appear with the color i want.

This is the script i put in Document level JavaScripts to make this happen.

app.runtimeHighlight = true;
app.runtimeHighlightColor= ["RGB", 0.96, 0.96, 0.96];    \\ grey color

 

By right it will not affect other files right? as it is script for this particular file only.

I have no other file to test on this now. 

try67
Community Expert
Community Expert
December 27, 2019

It WILL affect ALL other files opened on that machine! I strongly recommend you don't do that.