VintaSoft Imaging .NET SDK 15.1: Documentation for Web developer
In This Topic
Customize settings of web document viewer
In This Topic
UI-control WebDocumentViewerJS allows to define DOM-element, which should be used as container for web document viewer, and allows to define a collection of UI-elements, which represent the user interface of web document viewer.


Here is JavaScript code that demonstrates how to create web document viewer with default settings:
// create the settings for web document viewer with image viewer
var documentViewerSettings =
    Vintasoft.Imaging.DocumentViewer.WebDocumentViewerSettingsJS("documentViewerContainerId", "documentViewerLocalizationId", false);

// create the web document viewer
var documentViewer = new Vintasoft.Imaging.DocumentViewer.WebDocumentViewerJS(documentViewerSettings);



Here is JavaScript code that demonstrates how to create web document viewer with annotation support:
// create the settings for web document viewer with annotation viewer
var documentViewerSettings =
    Vintasoft.Imaging.DocumentViewer.WebDocumentViewerSettingsJS("documentViewerContainerId", "documentViewerLocalizationId", true);

// create the web document viewer
var documentViewer = new Vintasoft.Imaging.DocumentViewer.WebDocumentViewerJS(documentViewerSettings);



When instance of WebDocumentViewerSettingsJS class is created, the WebUiControlJS.get_Items function allows to get a collection of UI-elements, which are presented in web document viewer by default. The items collection can be changed by adding/moving/deleting of UI-element.


Here is JavaScript code that demonstrates how to create web document viewer with image processing panel:
// create the settings for web document viewer
var documentViewerSettings =
    Vintasoft.Imaging.DocumentViewer.WebDocumentViewerSettingsJS("documentViewerContainerId", "documentViewerLocalizationId");

// create the web document viewer
var documentViewer = new Vintasoft.Imaging.DocumentViewer.WebDocumentViewerJS(documentViewerSettings);

// get items of web document viewer
var items = documentViewerSettings.get_Items();

// get the main menu of web document viewer
var mainMenu = items.getItemByRegisteredId("mainMenu");
// if main menu is found
if (mainMenu != undefined) {
    // get items of main menu
    var mainMenuItems = mainMenu.get_Items();

    // add the "Image processing" menu to the main menu
    mainMenuItems.addItem("imageProcessingAndUndoRedoToolbarPanel");
}