Control External Resources using WorkbookSettings.StreamProvider

Possible Usage Scenarios

Sometimes, your Excel file contains external resources, e.g., linked images, etc. Aspose.Cells allows you to control these external resources using Workbook.Settings.StreamProvider, which takes an implementation of the IStreamProvider interface. Whenever you try to render a worksheet containing external resources, e.g., linked images, the methods of the IStreamProvider interface will be invoked, enabling you to take appropriate actions for those resources.

Control External Resources using WorkbookSettings.StreamProvider

The following sample code demonstrates the usage of the Workbook.Settings.StreamProvider. It loads the sample Excel file containing a linked image. The code replaces the linked image with the Aspose Logo and renders the entire sheet into a single image using the SheetRender class. The screenshot below shows the sample Excel file and its rendered output image for reference. As you can see, the broken linked image is replaced with the Aspose Logo.

todo:image_alt_text

Sample Code