Free Support Forum - groupdocs.com

Issue: I want to be able to display the document in the browser without having to download it

@canerkarakurt

We’re investigating this scenario. Your investigation ticket ID is VIEWERNET-2657. As there’s any update, you’ll be notified.

@canerkarakurt

You have to pass stream factory instead of stream in order to make the code work:

attachmentStream = new MemoryStream(attachment.Content);
using (Viewer viewer = new Viewer(() => attachmentStream))
{
    HtmlViewOptions viewOptions = HtmlViewOptions.ForExternalResources();
    viewer.View(viewOptions);
}

Let us know if it works. You may explore this sample.zip (86.2 KB) application.