Error processing SSI file
LEADTOOLS Leadtools.Documents (Leadtools.Documents assembly)

LoadFromUri Method

Show in webframe
Example 
The uri to get the data from. It may be the DocumentId string of a Document that is already in the cache.
The LoadDocumentOptions object to create the Document with.
Loads a document from existing data stored in a remote URL.
Syntax
 function Leadtools.Documents.DocumentFactory.loadFromUri( 
   uri ,
   options 
)

Parameters

ParameterTypeDescription
uristringThe uri to get the data from. It may be the DocumentId string of a Document that is already in the cache.
optionsLoadDocumentOptionsThe LoadDocumentOptions object to create the Document with.

Return Value

TypeDescription
jQueryApi.IDeferred A Promise object that may resolve succesfully to a Document object, or fail if the Document cannot be created from the uri.
Remarks

Note that the uri parameter can point to a document stored in HTTP, HTTPS, FTP, or Disk file (using the file protocol).

if the uri parameter to this method points to a Document that was uploaded to the cache via UploadDocument or UploadFile (verified via IsUploadDocumentUri), then this method performs just like LoadFromCache but with a uri instead of a document ID.

LoadFromUri creates a Document object from any supported image or document file format stored in a disk file or remote URL. The returned object can then be used to retrieve any page as image or SVG, to obtain the text using SVG or OCR, use the annotations or the document structure such as links and bookmarks.

Refer to Loading Using LEADTOOLS Documents Library for detailed information on how to use this method and the various options used.

Example
function loadDocumentFromUriExample() {
   // Load a new document
   var url = "http://demo.leadtools.com/images/pdf/leadtools.pdf";
   lt.Documents.DocumentFactory.loadFromUri(url, null)
      .done(function (document) {
         console.log("Document was loaded succesfully");
         console.log("MIMEType is " + document.mimeType);
         console.log("Number of Pages is " + document.pages.length);
         // Show the PDF image of the first page in a new tab
         window.open(document.pages[0].getSvgUrl());
      })
      .fail(function (jqXHR, statusText, errorThrown) {
         alert("Error loading document " + errorThrown);
      });
}
See Also

Reference

DocumentFactory Object
DocumentFactory Members

Error processing SSI file