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

LoadFromCache Method

Show in webframe
Example 
documentId from a previously cached Document object.
Retrieves the document matching the given documentId string from the cache.
Syntax
 function Leadtools.Documents.DocumentFactory.loadFromCache( 
   documentId 
)

Parameters

ParameterTypeDescription
documentIdstringdocumentId from a previously cached Document object.

Return Value

TypeDescription
jQueryApi.IDeferred A Promise object that may resolve succesfully to a Document object, or fail if the Document cannot be returned because it does not exist with that documentId.
Remarks

This static method will return a Document object that is known to already exist in the cache from being loaded via LoadFromUri or uploaded via UploadFile or UploadDocument.

LoadFromCache is meant as a quick version of LoadFromUri and does not take a LoadDocumentOptions object.

If DeleteFromCache is called on the Document or the cache time has expired for the object, it will not be available via this method.

Example
function loadDocumentFromCacheExample() {
   // 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 from URI");
         console.log("MIMEType is " + document.mimeType);
         console.log("Number of Pages is " + document.pages.length);
         // get the ID and get rid of the document
         var documentId = document.documentId;
         document = null;
         // Load it from the cache now
         lt.Documents.DocumentFactory.loadFromCache(documentId)
            .done(function (document) {
               console.log("Document was loaded succesfully from cache");
               console.log("MIMEType is " + document.mimeType);
               console.log("Number of Pages is " + document.pages.length);
            })
            .fail(function (jqXHR, statusText, errorThrown) {
               alert("Error loading document " + errorThrown);
            });
      })
      .fail(function (jqXHR, statusText, errorThrown) {
         alert("Error loading document " + errorThrown);
      });
}
See Also

Reference

DocumentFactory Object
DocumentFactory Members

Error processing SSI file