Stream containing the data of the original document.
public Stream GetDocumentStream()
Public Function GetDocumentStream() As System.IO.Stream
public:
System::IO::Stream^ GetDocumentStream()
public ILeadStream getDocumentStream()
Stream containing the data of the original document.
The stream returned from this method is the same one used by the various parts of the object when loading the pages and should not be disposed by the user. To ensure thread safety, always use the LockStreams before trying to use the stream and UnlockStreams when done to coordinate the use of this stream between user application and the document object.
Call HasStream to detect whether the document has a valid stream.
When a document is created using DocumentFactory.LoadFromUri or DocumentFactory.LoadFromUriAsync, the framework will download the original file and store it in the cache if it is used, or a temporary file on the system otherwise. In these cases, the value of IsDownloaded will be true and GetDocumentFileName will return the path to this file (in the cache directly or the temporary one created). Uri will point to the original file or URL used to download the document. If the cache does not support disk access (external resource), the document data is still stored in the cache and can be retrieved using GetDocumentStream.
If the document is created using DocumentFactory.LoadFromFile, then the framework will not download the original file. Instead, the framework will use it as is. In this case, the value of IsDownloaded will be false and GetDocumentFileName will return the path to the original file used to load the document. Uri will return the same value as GetDocumentFileName in this situation.
If the document is created using DocumentFactory.LoadFromStream, then the framework will not download the original file. Instead, the framework will use the Stream as is. In this case, the value of IsDownloaded will be false and GetDocumentFileName and Uri will return null as well. If the document is then saved into the cache and re-loaded (using SaveToCache and DocumentFactory.LoadFromCache), then the document is treated as if it was loaded from a file.
For more information, refer to Loading Using LEADTOOLS Document Library.
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document