JavaScript: Remove "Upload file" button from "File" menu of web document viewer.
Posted: Mon Aug 14, 2023 2:45 pm
WebDocumentViewerJS control allows to customize the UI of control.
Here is JavaScript code snippet that shows how to remove "Upload file" button from "File" menu of web document viewer:
The list of registered identifiers for UI elements can be found here: https://www.vintasoft.com/docs/vsimagin ... oryJS.html
Here is JavaScript code snippet that shows how to remove "Upload file" button from "File" menu of web document viewer:
Code: Select all
// get items of web document viewer
var items = docViewerSettings.get_Items();
// get the "File" menu panel
var fileMenuPanel = items.getItemByRegisteredId("fileToolbarPanel");
// if "File" menu panel is found
if (fileMenuPanel != null) {
// get items of "File" menu panel
var fileMenuPanelItems = fileMenuPanel.get_Items();
// get the "Upload file" button
var uploadFileButton = fileMenuPanelItems.getItemByRegisteredId("uploadFileButton");
// if "Upload file" button is found
if (uploadFileButton != null)
// remove "Upload file" button from "File" menu
fileMenuPanelItems.removeItem(uploadFileButton );
}