Yes, it is indeed possible to save the output to a stream when using GroupDocs.Viewer for .NET UI. The GroupDocs.Viewer API is designed to be backend and UI-agnostic, meaning that it can handle the conversion of source files into various formats such as images, HTML, or PDF, and then you can utilize these rendered files in your UI application.
To save the output to a stream, you can refer to the documentation on saving output to a stream, which provides detailed instructions on how to implement this functionality. Once you have the output in a stream, you can easily pass it to your UI for display.
For integration, you can use the GroupDocs.Viewer for .NET UI component, which allows you to work with the output seamlessly without being tightly coupled to a .NET application. You can find examples and further guidance on how to use this component in the provided GitHub repository.
First of all, please ignore the answer from the bot. Second, the answer to your question depends from which point of view you want to obtain a stream with resultant file content?
If you’re asking as a customer, who visits your web-site, where the GroupDocs.Viewer-for-.NET-UI is integrated for viewing document online, then the answer is “No”, because this customer uses his browser and has no relation to the streams in particular or file content in general - it is present only on the server-side. Customer can only download the file, if you allow this.
If you’re asking how to obtain a stream with file content programmatically on the server-side as a programmer, who has an access to back-end source code, then I suggest you to look at the custom storage provider — it can be implemented quite simple, need to implement one interface with 3 methods. You can even copy-paste the code of existing LocalFileStorage, just inject your own code, that stores the stream somewhere, to the WriteFileAsync method on the line 62. You can get the binary content of the resultant file from the byte[] bytes argument and store it in your MemoryStream or get a ready-to-use FileStream on line No. 70 - just don’t forget to reset the pointer.
Hi Denis, thanks for the quick response. It’s from the server-side point of view. Thank you very much for the links: they were extremely helpful! I was able to successfully implement a custom storage provider into my solution. Your support and guidance has really helped me get setup, thanks again.
1 Like
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
Enables storage, such as cookies, related to analytics.