Search results

Disable context Text in JavaScript PDF Viewer control

08 Dec 2021 / 1 minute to read

The PDF Viewer library allows you to disable context menu action using the contextMenuAction property as 'None'. Default value of the contextMenuAction is 'RightClick'.

Step 1: Follow the steps provided in the link to create simple PDF Viewer sample.

Step 2: Add the following code snippet to disable context menu action for PDF viewer control.

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

Find the Sample how to disable Context Menu action