Load from URL

The following code snippet shows how to load a document from a URL:

import com.groupdocs.viewer.Viewer;
import com.groupdocs.viewer.options.HtmlViewOptions;
// ...

URL url = new URL("https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-Java/blob/master/Examples/Resources/SampleFiles/sample.docx?raw=true");
try (Viewer viewer = new Viewer(url)) {
    HtmlViewOptions viewOptions = HtmlViewOptions.forEmbeddedResources();
    viewer.view(viewOptions);
}