JavaScript: Remove "Upload file" button from "File" menu of web document viewer.

Code samples for VintaSoft Imaging .NET SDK. Here you can request a code sample.

Moderator: Alex

Post Reply
Alex
Site Admin
Posts: 2319
Joined: Thu Jul 10, 2008 2:21 pm

JavaScript: Remove "Upload file" button from "File" menu of web document viewer.

Post by Alex »

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:

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 );
}
The list of registered identifiers for UI elements can be found here: https://www.vintasoft.com/docs/vsimagin ... oryJS.html
Post Reply