←Select platform

LoadFromCache(ObjectCache,string) Method

Summary

Loads a previously saved document from the specified cache.

Syntax
C#
C++/CLI
Java
Python
[ObsoleteAttribute("User LoadFromCache(LoadFromCacheOptions) instead")] 
public static LEADDocument LoadFromCache( 
   ObjectCache cache, 
   string documentId 
) 
public:  
   static LEADDocument^ LoadFromCache( 
      ObjectCache^ cache, 
      String^ documentId 
   ) 
public static Document loadFromCache(ObjectCache cache, String documentId) 
def LoadFromCache(self,cache,documentId): 

Parameters

cache

The cache object to use. This value cannot be null.

documentId

The document identifier. This value cannot be null.

Return Value

The document object if found in the cache, otherwise; null.

Remarks

Note: This method will be deprecated in the next version of LEADTOOLS. Use LoadFromCache(LoadFromCacheOptions) instead.

Use this method to load a document previously stored in the cache with SaveToCache. The document will be re-loaded, and populated exactly as it was during the time it was saved. If the document was originally created by using LoadFromFile, then the original file must still exist and can be accessed. If the document was originally created by using LoadFromUri, LoadFromUriAsync, or Create, then the library had copied the original file into the cache and is no longer being used. The document can be re-constructed even if the original file has been deleted. If this document was originally created by using LoadFromStream, then the data stored in the stream was saved into the cache during SaveToCache, and the stream is no longer used and loading this document will act in the same manner as if it had been downloaded from an external URI.

This method can return null if the document was in the cache but has expired and was purged.

Saving and loading from the cache is useful if the document is to be re-used between sessions in your application. The document identifier (documentId) is all you need to store in order to re-construct the document after it was saved to the cache and disposed. This ID can be stored in a database or passed to the client side as is the case of the LEADTOOLS Document Web Service.

LoadFromCache supports loading a document that has been uploaded and not loaded yet. The factory will check and perform a call to LoadFromUri internally.

Documents can be manually deleted from the cache at any time using DocumentFactory.

Requirements

Target Platforms

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

Leadtools.Document Assembly

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