This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/web/knowledge-base/disable-context-menu.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. Disable context menu in PDF viewer | Nutrient

There might be cases where you want to disable right-clicking inside the Nutrient inline frame. You can do this by using the following code:

NutrientViewer.load(options).then((instance) => {
// Disable the context menu.
instance.contentDocument.addEventListener("contextmenu", (event) =>
event.preventDefault()
);
});

The code above uses instance.contentDocument to access the viewer’s document object.

This has been tested with Nutrient Web SDK 2020.1.2.