Class WorkbookImageExporter
Public extension methods for exporting a Workbook as raster images.
Inheritance
WorkbookImageExporter
Assembly: DRIT.Spreadsheet.dll
Syntax
public static class WorkbookImageExporter
Methods
RenderSheetToImages(Workbook, int, WorkbookImageSaveOptions?)
Renders each printed page of the specified sheet (0-based index) to a
DRIT.Drawing.Imaging.Bitmap.
The caller is responsible for disposing the returned bitmaps.
Declaration
public static IReadOnlyList<Bitmap> RenderSheetToImages(this Workbook workbook, int sheetIndex, WorkbookImageSaveOptions? options = null)
Parameters
Returns
RenderToImages(Workbook, WorkbookImageSaveOptions?)
Renders each printed page to a DRIT.Drawing.Imaging.Bitmap.
The caller is responsible for disposing the returned bitmaps.
Declaration
public static IReadOnlyList<Bitmap> RenderToImages(this Workbook workbook, WorkbookImageSaveOptions? options = null)
Parameters
Returns
RenderToImages(Workbook, CancellationToken)
Renders each printed page to a DRIT.Drawing.Imaging.Bitmap, stopping
immediately if cancellationToken is cancelled.
The caller is responsible for disposing the returned bitmaps.
Declaration
public static IReadOnlyList<Bitmap> RenderToImages(this Workbook workbook, CancellationToken cancellationToken)
Parameters
Returns
SaveAsImage(Workbook, string, WorkbookImageSaveOptions?)
Renders each printed page to an image file.
pathPattern may contain the tokens {sheet} and
{page}, which are replaced with the sheet name and 1-based page number
respectively. When neither token is present and more than one page is produced,
_page{N} is inserted before the file extension automatically.
Declaration
public static void SaveAsImage(this Workbook workbook, string pathPattern, WorkbookImageSaveOptions? options = null)
Parameters
Examples
workbook.SaveAsImage(@"C:\output\{sheet}_p{page}.png");
SaveAsImage(Workbook, string, CancellationToken)
Renders each printed page to an image file, stopping immediately if
cancellationToken is cancelled.
Declaration
public static void SaveAsImage(this Workbook workbook, string pathPattern, CancellationToken cancellationToken)
Parameters