How to Customize Acrobat app.alert Dialogs and Security Headers
Question details
Developers want to customize the app.alert popup in Adobe Acrobat by removing security warnings, formatting the text, and adding custom input options like checkboxes.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Customizing PDF form scripts and dialog boxes using Adobe Acrobat JavaScript.
- Observed behavior
- The default app.alert displays a 'Warning: JavaScript Window' header, does not support rich text formatting, and requires specific API parameters to show custom inputs like checkboxes.
Ensure you have access to the folder-level JavaScript directory for Adobe Acrobat and are familiar with basic Acrobat JavaScript API syntax.
Remove Security Headers and Customize the Alert Dialog
Use a Trusted Function defined in a folder-level script to bypass the security header, and utilize specific parameters for text formatting and checkboxes.
By default, Adobe Acrobat adds a 'Warning: JavaScript Window' header to alerts for security reasons. Bypassing this requires elevated privileges via folder-level scripts.
Additionally, while standard HTML or rich text formatting is not supported inside the app.alert dialog, you can use plain text combined with Unicode characters and API parameters to achieve a customized look.
Navigate to your Acrobat Javascripts folder and create a new .js file. Define a Trusted Function in this file using app.trustedFunction.
Place your app.alert code inside the newly created Trusted Function. When executed from this context, the 'Warning: JavaScript Window' header will be removed.
Since rich text formats like bold or italics are not supported, integrate Unicode characters (such as bullet points) directly into your plain-text string to format the dialog box content.
Leverage the 'oCheckbox' parameter in the app.alert function to include a 'Do not show again' checkbox. Refer to the Acrobat JavaScript API Reference for the exact syntax of the oCheckbox object.

Looking for a Lightweight PDF and Office Suite?
While complex Acrobat JavaScript development requires Adobe Acrobat, WPS Office offers a fast, lightweight, and free alternative for viewing, editing, and managing PDF files, alongside full compatibility with Microsoft Word, Excel, and PowerPoint.

Frequently Asked Questions
Can I use HTML or rich text in Acrobat app.alert?
No, the basic app.alert dialog in Adobe Acrobat only supports plain text. However, you can use Unicode characters to simulate formatting, such as adding custom bullet points or arrows.
Where do I place folder-level scripts in Acrobat?
Folder-level scripts must be placed in the 'Javascripts' folder. The exact path depends on your operating system and Acrobat version, but it is typically located within the Adobe Acrobat application directory or the user's AppData roaming profile.
How do I check if the user clicked the checkbox in the alert?
When you use the oCheckbox parameter, the app.alert method returns an object instead of a simple integer. This object contains properties indicating which button was clicked and the boolean state (true/false) of the checkbox.




