Disable the context menu in PDF Viewer
14 Oct 20251 minute to read
Set ContextMenuOption to None to hide all context menu options. The default value is RightClick.
Example: Disable context menu
<button id='disable'>Disable ContextMenuOption</button>
// Disable ContextMenuOption
document.getElementById('disable').addEventListener('click', ()=> {
viewer.contextMenuOption = 'None';
});This hides the context menu and prevents right-click interactions in the viewer.
Sample: How to disable the context menu
https://stackblitz.com/edit/e99te3-ha9bkx?devtoolsheight=33&file=index.ts