getDocumentViewer Method


Retrieves the current DocumentViewer that is being used by LEADVIEW.

Viewer.prototype.getDocumentViewer = function() 
getDocumentViewer(): DocumentViewer; 

Return Value

A DocumentViewer object. If the run method has not been called, or if the view has not finished building, null is returned.

export class ViewerGetDocumentViewerExample { 
    private _viewer: lt.LEADVIEW.Viewer = null; 
    public constructor() { 
            lt.RasterSupport.setLicenseUri("", "EVAL", null); 
    public run = (divID: string, getButtonID: string): void => { 
        const lv = new lt.LEADVIEW.Viewer(); 
        // Builds a new instance of LEADVIEW. 
        // For the full list of options that can be passed to the run method, 
        // refer to the settings JSON files that are included in the LEADVIEW demo application. 
        // Settings files can also be generated from the LEADVIEW application itself., { 
            'rootDivId': divID, 
            'showMainMenu': false 
        this._viewer = lv; 
        document.getElementById(getButtonID).onclick = this.getDocumentViewer; 
    private getDocumentViewer = () => { 
        const viewer = this._viewer.getDocumentViewer(); 
        const viewerExists = (!viewer)? false : true; 
        alert(`Does viewer exist: ${viewerExists}`); 
<!doctype html> 
<html lang="en"> 
<title>LV Examples | GetDocumentViewer</title> 
    <script src="" 
        integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script> 
    <script src="../LT/Leadtools.js"></script> 
    <script src="../LT/Leadtools.Controls.js"></script> 
    <script src="../LT/Leadtools.Annotations.Engine.js"></script> 
    <script src="../LT/Leadtools.Annotations.Designers.js"></script> 
    <script src="../LT/Leadtools.Annotations.Rendering.Javascript.js"></script> 
    <script src="../LT/Leadtools.Annotations.Automation.js"></script> 
    <script src="../LT/Leadtools.ImageProcessing.Main.js"></script> 
    <script src="../LT/Leadtools.ImageProcessing.Color.js"></script> 
    <script src="../LT/Leadtools.ImageProcessing.Core.js"></script> 
    <script src="../LT/Leadtools.ImageProcessing.Effects.js"></script> 
    <script src="../LT/Leadtools.Document.js"></script> 
    <script src="../LT/Leadtools.Document.Viewer.js"></script> 
    <script src="../LT/Leadtools.LEADVIEW.js" defer></script> 
    <link href="../css/Leadtools.LEADVIEW.css" type="text/css" rel="stylesheet"> 
    <!-- All typescript files compiled from /src/ will be bundled and dropped into the root folder `bundle.js`--> 
    <script src="../bundle.js" type="text/javascript"></script> 
        <button id="getDocumentViewer">Get LEADVIEW's DocumentViewer</button> 
    <div id="runDemo" style="width: 100%; height: 97vh;"></div> 
    window.onload = () => { 
        const example = new window.examples.ViewerGetDocumentViewerExample();"runDemo", "getDocumentViewer"); 

Target Platforms

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.LEADVIEW Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.