Free Support Forum - groupdocs.com

Cannot convert from "System.IO.Stream" in "GroupDocs.Viewer.Common.Func<System.IO.Stream>"

Hello,

when i try to put a stream in the viewer i get following failure:

Cannot convert from “System.IO.Stream” in
“GroupDocs.Viewer.Common.Func<System.IO.Stream>”

I use following code in a .net framework WinForms Project:

            Stream stream = GetDocument(dokumentZuAktenzeichen.DokumentId);
            using (Viewer viewer = new Viewer(stream))
            {
                HtmlViewOptions viewOptions = HtmlViewOptions.ForExternalResources();
                viewer.View(viewOptions);
            }
1 Like

@ramomJr

Please have a look at this sample code. This is how you load a document from stream.

This means that i have to store the stream in a file and then read it from there?

@ramomJr

Yes. Have a look at this documentation article.

Okay, that works. Are there any plans that it could work with a stream directly?

1 Like

@ramomJr

We’ll investigate this. Your investigation ticket ID is VIEWERNET-2593.