Loading documents from different sources

GroupDocs.Viewer also enables you to render of remotely located documents. The rendering of the document would be similar to Load document from Stream. In order to render a remotely located document, below steps can be followed.

  • Specify the method to obtain remotely located document stream;
  • Pass method’s name to Viewer class constructor.
public static void LoadDocument()
{
   using (Viewer viewer = new Viewer(GetFileStream))
    {
        HtmlViewOptions viewOptions = HtmlViewOptions.ForEmbeddedResources();
        viewer.View(viewOptions);
    }
}

private static Stream GetFileStream()
{
    //TODO: return the stream
};