Load from URL
Leave feedback
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);
}
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.