Set timeout for loading external resources
Leave feedback
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);
}
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.