We have recently got a requirement to display documents in browser. Our client suggested for groupdocs to used. However we want to check how it works with file data saved in database. We are new to it , so could you please provide some samples that will allow documents to show in browser without saving it to client machine.

GroupDocs.Viewer for .NET is a standalone, back-end document rendering API that renders the source document’s pages into HTML pages or images as per user’s choice. When using the API in a web application, for instance, the rendering will be done on the server side and the user will view the HTML/image representation of the document in the browser. Hence, the documents will not be saved on client’s machine. Following are some useful resources that include documentation, example projects, and the open source document viewer applications that may help you understand the working of the API.

Furthermore, GroupDocs.Viewer for .NET also supports working with file streams. In your case, you can convert the byte array into file stream and then use that stream to render the document into HTML pages or images. For more details, please visit Working with Streams.

In case you would have any questions or queries, please feel free to let us know.

I am able to convert byte array to html and images but i dont know how to display them in browser then. Could you please provide a linked sample application that will shows complete working for the same?

This is pretty urgent for us as client is very eager to purchase the developer license.

As I mentioned before, GroupDocs.Viewer for .NET is a back-end API that provides you HTML or image representation of the source document. You will need to create you own front end application to view/display the rendered HTML pages or images. You can also use our open source document viewer applications. Currently, these applications are working with the documents located in the storage directory, however, as these applications are open source, you can change their functionality to work with files saved in database. Following are the open source document viewer applications that are available on GitHub.

I have already gone through the open source application and documentation many times. However i did not find a way to directly display documents from stream. I can get the list of html pages or images from the stream but then i did not find any way to display them in viewer control.

Open source code using many handlers and that contains may other files as well, so i am not sure do we need to use all the things to achieve straight forward functionality.

As I mentioned in the previous post, GroupDocs.Viewer for .NET is a back-end API and it doesn’t contain any front end viewer control to display the rendered document. You will have to create the front end UI to display the output HTML pages or images.

In your case, if you want to achieve a simple and straight forward functionality then you can follow the steps bellow:

Get HTML pages or images using GetPages function of GroupDocs.Viewer for .NET

Save the HTML pages or images somewhere

Display/load the HTML pages or images in your application (for instance, if you have an ASP.NET Webforms application, then you can load the HTML page inside a div in a .aspx page)

To get an idea of how to save the HTML pages or images of the source document, please have a look at ViewGenerator.cs class of the example project. If you would find any thing difficult, please do let us know.