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 );
}