LEADVIEW Viewer Application

Leadtools.LEADVIEW is part of the LEADTOOLS HTML5/JavaScript toolkit. Using the LEADTOOLS LEADVIEW library, you can create a complete, fully-functional DocumentViewer application with as few as 3 lines of code. For an example, see run. LEADVIEW is intended to be fully customizable from configuration files—allowing application modification without having to touch any code at all!

A demo of the LEADVIEW Viewer Application is available at <INSTALLDIR>\Examples\JS\DocumentViewerDemos\LEADVIEW_DocumentViewerDemo. Before calling any functions within the LEADVIEW library, make sure that your LEADTOOLS license has been set. This can be done by calling the RasterSupport.setLicenseUri method.

Prerequisites

LEADVIEW has the following prerequisites (in \Bin\JS) that must be included as well:
  • The LEADTOOLS JS files
    • Leadtools.js
    • Leadtools.Controls.js
    • Leadtools.Annotations.Engine.js
    • Leadtools.Annotations.Designers.js
    • Leadtools.Annotations.Rendering.Javascript.js
    • Leadtools.Annotations.Automation.js
    • Leadtools.Document.js
    • Leadtools.Document.Viewer.js
  • JQuery must be referenced in order for the LEADTOOLS Document JS libraries to work.
  • LEADVIEW needs some form of bootstrap CSS included (in order to display dialogs appropriately).
  • In order to load PDF files locally, the lt.pdf.js (at <INSTALLDIR>\Bin\JS\pdfjs\) files must be set up accordingly. The LEADVIEW demo shows how to do this.
  • LEADVIEW looks in <INSTALLDIR>\Examples\JS\DocumentViewerDemos\LEADVIEW_DocumentViewerDemo\wwwroot\Resources\Cursors for annotation cursors. Place any custom cursors there. The LEADVIEW demo also shows how to do this.

Setting up LEADVIEW

The LEADVIEW Viewer library is split into two files: Leadtools.LEADVIEW.js (at <INSTALLDIR>\Bin\JS\) and Leadtools.LEADVIEW.css (at <INSTALLDIR>\Examples\JS\DocumentViewerDemos\LEADVIEW_DocumentViewerDemo\wwwroot\Styles).

At runtime, LEADVIEW will look for a LEADVIEW.json file in the <INSTALLDIR>\Examples\JS\DocumentViewerDemos\LEADVIEW_DocumentViewerDemo\wwwroot\LEADVIEW folder from the web application's root. Set the startupSettings property in the LEADVIEW.json file, which tells LEADVIEW where to look for the appropriate settings file. If no valid path is provided, or if LEADVIEW fails to pull the settings, the default settings will be used.

The JSON Settings files can be generated directly from LEADVIEW. Examples of these settings files can be found in the wwwroot\LEADVIEW directory for the example at <INSTALLDIR>\Examples\JS\DocumentViewerDemos\LEADVIEW_DocumentViewerDemo.

Starting LEADVIEW

At this point, all you need to do to start using LEADVIEW is to run the following 2 lines of code:

JavaScript
let lv = new lt.LEADVIEW.Viewer(); 
lv.run(null,null); 

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

LEADTOOLS HTML5 JavaScript