PDF Editing Issues

How to Fix Acrobat Reader Not Applying JavaScript Field Color Changes

Huda QurayshiHuda Qurayshi Oct 28, 2026 869 views

Question details

The user's PDF JavaScript successfully changes a text field's value and visibility in Acrobat Pro, but fails to change the fill color to red when opened in Acrobat Reader.

How to Fix Acrobat Reader Not Applying JavaScript Field Color Changes
Product
Adobe Acrobat Reader
Device & OS
not provided
Scenario
Using JavaScript in a PDF form to dynamically change a text field's fill color.
Observed behavior
The text field fill color does not update to the specified color in Acrobat Reader, likely due to application-wide field highlighting overriding the custom script.
Before you start

Ensure you have the necessary permissions to edit document-level JavaScript and inform users if your script will change application-wide settings like field highlighting.

Solution 1Recommended

Disable Field Highlighting via Document-Level JavaScript

Use a Document-Level script to disable field highlighting automatically when the user opens the PDF, allowing your custom field colors to display properly.

When Adobe Acrobat Reader's default field highlighting is enabled, it applies a colored overlay that masks any custom background colors set via JavaScript. By turning this feature off programmatically, your custom red fill color will become visible.

1
Open Document JavaScripts

Open your PDF in Acrobat Professional. Navigate to 'Tools', choose 'JavaScript', and then select 'Document JavaScripts'.

2
Add Initialization Script

Create a new script and add the code app.runtimeHighlight = false; to turn off the global highlight setting.

3
Set Script to Run on Open

Ensure your initialization script is configured to execute automatically when the document is opened so the highlight setting changes immediately.

Disable Field Highlighting via Document-Level JavaScript
Application-Wide Impact: The app.runtimeHighlight = false; command applies globally to the Acrobat Reader application. It is good practice to inform your users before altering their global application preferences.
Free Microsoft Office alternative

Manage PDF Forms Easily with WPS Office

If managing complex PDF JavaScripts and reader compatibility issues becomes tedious, try WPS Office. It provides a lightweight, highly compatible alternative for handling PDFs, filling forms, and managing your office documents without the hassle of conflicting application settings.

Fully compatible with standard PDF formats and Microsoft Office files (Word, Excel, PowerPoint).Lightweight design that opens complex PDF forms and documents smoothly.Intuitive interface for filling PDF form fields directly without advanced scripting.
QA img-9

Frequently Asked Questions

Why does my JavaScript field color change show in Acrobat Pro but not Reader?

Acrobat Reader uses a default 'field highlighting' feature that overlays a color tint on form fields. This overlay hides the custom background colors you set via JavaScript. Disabling the highlighting reveals your custom colors.

How can I execute a JavaScript automatically when a PDF opens?

You can create a Document-Level script in your PDF authoring tool and place your code (such as app.runtimeHighlight = false;) inside an initialization function that is triggered by the OpenDocument event.

Does changing the runtimeHighlight property affect other PDFs?

Yes, changing app.runtimeHighlight alters the application-wide setting for Adobe Acrobat Reader. Until it is turned back on or the application is restarted, other PDFs opened in the same session will also have field highlighting disabled.