Search results

Disable context menu

02 Feb 2023 / 1 minute to read

To disable the context menu in the Syncfusion PDF viewer control, you can use the ContextMenuOption property as 'None' to hide all context menu options. Default value of the ContextMenuOption is 'RightClick'.

Here is an example of how you can use the ContextMenuOption to disable context menu in the PDF Viewer:

Copied to clipboard
<button id='disable'>Disable ContextMenuOption</button>
Copied to clipboard
// Disable ContextMenuOption
document.getElementById('disable').addEventListener('click', ()=> {
  viewer.contextMenuOption = 'None';

This will hide the context menu and prevent the user from right-clicking on the PDF viewer.

Find the sample how to disable Context Menu