Set timeout for loading external resources

If a document contains external resources like images, GroupDocs.Viewer loads them while rendering the document.

In the 19.12 version and earlier, the default timeout was 100 seconds. It may slow rendering when a service that provides external resources is down.

Since the 19.12 version, the default timeout is 30 seconds. Besides that, you can specify the desired timeout using LoadOptions.

This feature is supported for the Word Processing File Formats.

The following code snippet shows how to set a timeout to load external resources:

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

LoadOptions loadOptions = new LoadOptions();
// Specify a timeout.
loadOptions.setResourceLoadingTimeout(500);

// Render a file.
try (Viewer viewer = new Viewer("sample.doc", loadOptions)) {

    HtmlViewOptions viewOptions = HtmlViewOptions.forEmbeddedResources();
    viewer.view(viewOptions);
}