Disable Undo/Redo functions

WebViewer Version: ^7.2.0

Hello,
Is possible to disable undo and redo functionalities (ctrl+z, ctrl+y) in webviewer instance?

this.WebViewer = await new WebViewer(
{
type: “html5,html5Mobile”,
path: “/webviewer”,
documentType: “pdf”,
showLocalFilePicker: false,
showToolbarControl: false,
showPageHistoryButtons: false,
hideAnnotationPanel: true,
l: *****,
annotationUser: *****,
enableAnnotations: true,
backgroundColor: “#333333”,
autoCreate: true,
fullAPI: true,
isAdminUser: true,
streaming: false,
enableOfflineMode: false,
annotationAdmin: true,
serverUrl: null,
useDownloader: false,
disabledElements: [
“annotationStylePopup”,
“annotationDeleteButton”,
“toolsOverlay”,
“searchOverlay”,
“toolbarGroup-Shapes”,
“toolbarGroup-Edit”,
“toolbarGroup-Insert”,
“linkButton”,
“menuOverlay”,
“toolsHeader”,
“pageNavOverlay”,
],
},
element
);

Thanks :slight_smile:

You can use the following code to disable redo/undo tools

WebViewer(...)
  .then(instance => {
     instance.disableElements(['redoButton','undoButton'])
     instance.hotkeys.off(instance.hotkeys.Keys.CTRL_Z)
     instance.hotkeys.off(instance.hotkeys.Keys.CTRL_Y)
  });
1 Like