How to Fix Acrobat Custom Format Script Failing in Adobe Reader
Question details
The user needs to know why a JavaScript custom format script successfully executes during Acrobat Preview but fails when editing PDF text fields in Adobe Reader.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Using custom JavaScript formatting on text fields in a fillable PDF form.
- Observed behavior
- The custom formatting script functions correctly in Acrobat Preview but does not apply properly when the document is opened and filled out in Adobe Reader.
Ensure you are testing the PDF file on a supported desktop operating system, as mobile PDF viewers often restrict or disable JavaScript form calculations and formatting by default.
Disable Allow Rich Text Formatting for the Form Field
Turning off rich text formatting ensures the JavaScript format script can successfully read and modify the field's value in Adobe Reader without formatting conflicts.
When 'Allow Rich Text Formatting' is enabled, the underlying data structure of the text field becomes more complex to handle varied styling. This added complexity can prevent custom JavaScript format scripts from functioning correctly in Adobe Reader, even if they work perfectly in Acrobat's preview mode.
Open your PDF document in Adobe Acrobat, navigate to the Tools menu, and select 'Prepare Form' to begin editing the fields.
Right-click the specific text field that is failing to run the formatting script, then select 'Properties' from the context menu.
In the Text Field Properties dialog box, click on the 'Options' tab to view the behavior and formatting settings.
Uncheck the box labeled 'Allow Rich Text Formatting', then click the 'Close' button to save the properties for that field.
Save the PDF file, close Adobe Acrobat, and open the saved document in Adobe Reader to verify that the custom format script now works as intended.

Create and Edit PDFs Effortlessly with WPS Office
Simplify your PDF workflow with WPS Office. Manage, edit, and fill PDF documents easily without worrying about complex JavaScript compatibility issues. WPS Office provides an intuitive interface for all your document needs.
- 1. Download WPS Office: Install WPS Office for free from the official website and launch the application on your computer.
- 2. Open Your PDF: Click 'Open' on the homepage dashboard and select the PDF document you want to edit or fill.
- 3. Use PDF Tools: Navigate to the 'PDF Edit' tab to modify document text directly or fill existing form fields visually.
- 4. Save and Share: Save your completed PDF; the output remains fully compatible with other standard PDF viewing applications.

Frequently Asked Questions
Why do PDF JavaScripts fail on mobile devices?
Most mobile PDF viewers have limited or no support for JavaScript due to system resource limitations and security constraints. Custom format scripts usually require a standard desktop PDF application to function correctly.
Will disabling rich text formatting change how my text looks?
Disabling rich text formatting removes the ability to apply varied styling (like bolding a single word) inside the same field. However, it forces the text into plain text mode, which guarantees your custom formatting script can process and format the input reliably.
Can I fully test my PDF form scripts without leaving Adobe Acrobat?
While Acrobat's 'Preview' mode gives a quick look at form behavior, it may not perfectly replicate end-user conditions. It is highly recommended to always test your final form by opening the saved PDF in the standard desktop Adobe Reader.




