DocumentUltimate v3.1.0 is released

This release includes the following changes:

  • Added: Brought back DocumentSource for convenient loading of documents from a stream or byte array (also via callbacks that return these). New DocumentViewer.DocumentSource property can be used as an alternative to DocumentViewer.Document property.

    //Load document from a stream:
    
    documentViewer.DocumentSource = new DocumentSource(
        new DocumentInfo(uniqueId, fileName), 
        new StreamResult(stream)
    );
    //Load document from a byte array:
    
    documentViewer.DocumentSource = new DocumentSource(
        new DocumentInfo(uniqueId, fileName),
        byteArray
    );
     
  • Added: Load balancer support. DocumentViewer can now work properly in multi-server environments or cloud (e.g. Azure) where in-memory session is not available. Session serialization is fixed to support all session modules. You still need to have a shared cache folder between multiple instances/servers.

  • Changed: Usage of DocumentCache class. Path will be passed in the constructor to prevent user forgetting setting it. Easier way to get a DocumentCache instance when inside in the same web application which uses DocumentViewer.

    /*
    Pre-caching in other applications.
    Usually you would only need to pass path parameter unless you change default values of other parameters:*/
    
    
    DocumentUltimateConfiguration.Current.LicenseKey = "QQJDJLJP34...";
    
    var documentCache = new DocumentCache(@"C:\some\cache\folder");
    
    documentCache.PreCacheDocument(
      new DocumentOptions
      {
        Document = @"C:\some\document.pdf"
      }
    );
    /*
    Pre-caching in the same web application which uses DocumentViewer. 
    This DocumentCache instance is already filled with necessary information like cache path, license key etc.:*/
    
    
    var documentCache = DocumentUltimateWebConfiguration.Current.GetCache();
    
    documentCache.PreCacheDocument(
      new DocumentOptions
      {
        Document = @"C:\some\document.pdf"
      }
    );
     
  • Improved: DocumentCache locking, prevented double entries for same uniqueId with different file name if requested at the same time.

For the full version history of DocumentUltimate, please see here.