Loading documents from different sources

GroupDocs.Viewer for Java 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() {
   try (InputStream inputStream = getRemoteFileStream();
        Viewer viewer = new Viewer(inputStream)) {
        HtmlViewOptions viewOptions = HtmlViewOptions.forEmbeddedResources();

private static InputStream getRemoteFileStream() {
    //TODO: retrieve the stream

© Aspose Pty Ltd 2001-2022. All Rights Reserved.