Save output to a stream for GroupDocs.Viewer-for-.NET-UI?

Is it possible to save the output to a stream if using GroupDocs.Viewer-for-.NET-UI? GitHub - groupdocs-viewer/GroupDocs.Viewer-for-.NET-UI: UI - User Interface for GroupDocs.Viewer for .NET document viewer and automation API.

I know it’s possible for .NET (no UI) but I was wondering if the same can be said for .NET-UI? If it is, how can it be integrated? Please let me know :slight_smile:

Save output to a stream | Documentation

@YahyaM

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.

For more detailed steps, please check the documentation on Save output to a stream.

If you have any further questions or need assistance with specific implementation details, feel free to ask!

Sources:
[1]: Save output to a stream | Documentation

Hi @YahyaM

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.

Hope this will help!

With best regards,
Denis Gvardionov

1 Like

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