RichEditDocumentServerExtensions.LoadDocumentTemplateAsync(RichEditDocumentServer, Stream) Method
Asynchronously loads a document template from the stream.
The current RichEditDocumentServer instance.
A stream used to load a document.
A Task<TResult> object that returns true if the document is successfully loaded; otherwise, false.
The RichEditDocumentServerExtensions class is defined in the DevExpress.Docs.v20.2.dll assembly. Add this assembly to your project to use the RichEditDocumentServerExtensions members. You need an active license for the DevExpress Office File API Subscription or DevExpress Universal Subscription to use this library in production code.
The source stream can be non-seekable. In this instance, the stream is buffered automatically. After the document is loaded, the stream remains open.
The document template cannot be automatically overwritten. The information about the original file location and its format is dropped. An attempt to save (i.e., overwrite) the original document invokes the Save As dialog.
The format of the document loaded from a stream is detected automatically by the built-in DevExpress.XtraRichEdit.Services.IFormatDetectorService service implementation. If the format detection fails or the passed stream is null, the RichEditDocumentServer.InvalidFormatException event fires.
Take into account the following when you call this method:
The events fired by this method's call may occur in a different thread than the target operation.
The operation is not thread safe (documents should not be accessed simultaneously by different threads). Wait until the operation is completed before working with the document, i.e., use the