Sets a new document in the viewer.
document
Document object to view. Use null to remove the current document from the viewer.
If the value of document is null, then the current document is removed from the viewer.
If the viewer has a previous LEADDocument object set and this method was successful, then the existing LEADDocument object will be disposed if the value of AutoDisposeDocument is true.
The viewer will check if the value of document is the same as the existing one in the viewer. If so, it will not dispose the old document. The application can set the same document in the viewer as a "reset" or "reload" operation.
Encrypted documents must be decrypted prior to setting them in the viewer. Refer to Loading Encrypted Files Using the Document Library for more information.
This method performs the following:
The Operation is invoked with DocumentViewerOperation.SetDocument, data1 and IsPostOperation set to false.
View, Thumbnails, Bookmarks and Annotations all may have background threads working to parse the existing document data. The document viewer will notify each object to abandon the work and exit the threads. This is performed in a graceful manner to preserve system resources and prevent memory leaks. Therefore, a slight delay might occur while the viewer waits on the threads to exit.
If the existing LEADDocument and the value of AutoDisposeDocument is true; then the LEADDocument object is disposed.
View, Thumbnails, Bookmarks and Annotations will be notified that a new document is set and to start new background threads if needed or populate the UI elements from the document pages and data. View and Thumbnails will use the value from UseAjaxImageLoading to determine how images are loaded (in addition to WorkerCount, LazyLoad, WorkerCount, and LazyLoad ).
Finally, the Operation is invoked again with DocumentViewerOperation.SetDocument, data1 and IsPostOperation set to true this time.
For an example, refer to DocumentViewer.
Leadtools.Document.Viewer Namespace
Using LEADTOOLS Document Viewer
Loading Using LEADTOOLS Document Library
Uploading Using the Document Library
Document Library Coordinate System
Parsing Text with the Document Library
Barcode processing with the Document Library