View mode disables UI elements that perform editing actions on the document, while preserving navigation, search, and other read-only features. It applies whether your Modular UI is built from a JSON config, APIs, or both.
This view-only mode applies to the Modular UI. For the legacy UI, use its dedicated APIs. See the Read-only guide for details.
The DOCX Editor and Spreadsheet Editor expose their own options for controlling viewing vs. editing inside those editors. See these guides for details: DOCX Editor Initial Edit Mode and Spreadsheet Editor View Mode.
To enable and disable the view-only mode for Modular UI, use the following APIs:
When view-only mode is enabled, the UI components are filtered through a white list of elements that remain available. Everything else is hidden/disabled automatically.

Default UI with view-only mode enabled
There is a default white list covering allowed panels, tool buttons, preset buttons, and modals in view-only mode. If an allowed panel contains any controls that would edit the document, those controls are automatically hidden or disabled while the panel itself remains visible.
The default white list includes:
There are APIs to handle the view-only white list. The white list is composed of the data-element IDs of the components. This guide shows how to find the data-element of the UI elements.
Add elements to the view-only white list, making them visible/interactive in view-only mode.
To add panels to the view-only white list, the namespace containing all the identifiers for the prebuilt panels can be found at instance.UI.Panels.
Remove elements from the white list, making them hidden/disabled in view-only mode.
Return elements in the white list that you’ve added (does not include the default white list).
Update the view-only whitelist, making the elements in the whitelist visible and usable in view-only mode.
View-only mode affects the UI only, disabling buttons, ribbons, panels, and hot keys that perform editing actions, and it does not change annotation permissions. To block creating, editing, deleting, or replying to annotations, you can check the Annotation Manager enableReadOnlyMode() API. You can check more details about it at Annotation Permissions in JavaScript PDF Viewer.
In view-only mode, keyboard shortcuts continue to work for actions that don’t modify the document, while any shortcut that would edit content is blocked. If you customized key mappings while in edit mode, those mappings are honored in view-only mode. Previously disabled shortcuts remain disabled, and the keyboard shortcuts panel in Settings shows only the view-only subset with editing controls disabled.
Set which shortcuts are allowed to work in view-only mode.
Returns the current shortcut whitelist for view-only mode.
Did you find this helpful?
Trial setup questions?
Ask experts on DiscordNeed other help?
Contact SupportPricing or product questions?
Contact Sales