SkipExternalResources

LoadSaveOptions.SkipExternalResources property

Gets or sets a value indicating whether external resources are skipped while assembling a document, so that no network request is made for them. The default value is true.

public bool SkipExternalResources { get; set; }

Remarks

External resources are resources reaching the network: http, https and ftp URIs, UNC paths (\host\share) and file URIs with a remote host. Local file paths, relative paths and resources embedded into a document are not external and are loaded as usual.

A reference to an external resource comes either from the template document itself (for example, an image of an HTML template, a linked image or an INCLUDEPICTURE field of a Word template, an external link of a workbook, or a literal URI of an image or doc tag) or from data (for example, a URI that the expression of an image or doc tag evaluates to, or a resource referenced by a document inserted by a doc tag from data); see ExternalResourceOrigin. Resources referenced by the template are loaded regardless of this property while TrustTemplateResources is true (the default), so with the default options, only resources coming from data are skipped.

A skipped resource is loaded anyway if it matches WhitelistedResources. A skipped image of a document is replaced with a transparent image; a skipped resource of an image or doc tag is treated as an empty value, i.e. nothing is inserted.

Use ExternalResourceHandler to see every external resource before it is loaded and to allow, skip or substitute it individually.

Set the value to false to load all external resources, as versions before 26.11 did.

See Also