Fix Adobe Acrobat JavaScript Warnings for Custom Menus
Question details
The user needs to resolve Acrobat JavaScript security warnings when custom menus and dialogs call a function named myTrustedFunction.

- Product
- Adobe Acrobat JavaScript
- Device & OS
- not provided
- Scenario
- Custom JavaScript files create Acrobat menus and dialogs that call a function intended to run privileged operations.
- Observed behavior
- Calling a function named myTrustedFunction does not eliminate the security warnings.
Identify the exact API call that triggers the warning and check its security restrictions in the Acrobat JavaScript API reference. In Acrobat Preferences > JavaScript, confirm that Acrobat JavaScript is enabled.
Implement an Acrobat trusted function for privileged calls
Use Acrobat’s trusted-function security model when a menu or dialog needs to call an API that permits privileged execution.
Naming a function myTrustedFunction does not make it trusted. Define it with app.trustedFunction in an appropriate privileged location, and use app.beginPriv and app.endPriv around the permitted privileged operation.
A trusted function does not bypass every Acrobat security restriction. Check the documentation for the specific API and execution context.
Open the custom JavaScript file and identify the method that produces the warning. Look up that method in the Acrobat JavaScript API reference to check whether it can run in a privileged context.
In an appropriate folder-level Acrobat JavaScript file, define the function using app.trustedFunction. Inside it, call app.beginPriv(), run the permitted privileged operation, and call app.endPriv() in a finally block.
Update the custom menu or dialog callback to call the trusted function. Restart Acrobat to load the folder-level script, then select the custom menu item and check whether the warning persists.

Check custom menus in the classic Acrobat interface
Use this check if the trusted function works but the custom menu is missing or behaves differently in a newer Acrobat interface.
Work with PDFs and Office documents in WPS Office
WPS Office is a free, lightweight alternative for everyday document and PDF work. Its familiar interface and Microsoft Office format compatibility make it easy to move existing files into your workflow. It does not fix Acrobat JavaScript security warnings or replace Acrobat’s trusted-function model.

Frequently Asked Questions
Why does naming a function myTrustedFunction not remove the warning?
Acrobat does not grant privileges based on a function name. Define the function with app.trustedFunction in an appropriate privileged location and follow the security requirements for the API it calls.
Where should I put an Acrobat trusted function?
Define it in an appropriate privileged location, such as a folder-level Acrobat JavaScript file, rather than assuming a document script is trusted. Consult the Acrobat JavaScript API documentation for the applicable installation location and restart Acrobat after adding the script.
Does a trusted function allow every restricted Acrobat operation?
No. A trusted function can provide a privileged context for operations that permit it, but other security restrictions may still apply. Check the API reference for the specific method and calling context.
Why is my custom menu missing in the new Acrobat interface?
Custom menu behavior can differ in newer Acrobat interfaces. If available, select Disable new Acrobat from the application or View menu, restart Acrobat, and test the menu in the classic interface.




