VintaSoft Imaging .NET SDK 15.2: Документация для Веб разработчика
В этом разделе
Настройка параметров веб просмотрщика документов
В этом разделе
UI-контрол WebDocumentViewerJS позволяет определить DOM-элемент, который должен использоваться в качестве контейнера для веб просмотрщика документов, и позволяет определить набор UI-элементов, которые представляют пользовательский интерфейс веб просмотрщика документов.


Вот JavaScript код, который демонстрирует как создать веб просмотрщик документов с настройками по умолчанию:
// 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);



Вот код на JavaScript, который демонстрирует, как создать веб просмотрщик документов с поддержкой аннотаций:
// 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);



При создании экземпляра класса WebDocumentViewerJS функция WebUiControlJS.get_Items позволяет получить коллекцию UI-элементов, которые по умолчанию содержатся в веб просмотрщике документов. Коллекцию UI-элементов можно изменить путем добавления, перемещения или удаления UI-элементов.


Вот код на JavaScript, который демонстрирует, как создать веб просмотрщик документов с панелью обработки изображений:
// 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");
}