• DR-IT Software
  • Products
  • Documentation
  • Product page
  • Examples
  • API reference
  • Support
Show / Hide Table of Contents

Class WorkbookImageExporter

Public extension methods for exporting a Workbook as raster images.

Inheritance
object
WorkbookImageExporter
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: DRIT.Spreadsheet.Export.Image
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
Type Name Description
Workbook workbook
int sheetIndex
WorkbookImageSaveOptions options
Returns
Type Description
IReadOnlyList<Bitmap>

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
Type Name Description
Workbook workbook
WorkbookImageSaveOptions options
Returns
Type Description
IReadOnlyList<Bitmap>

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
Type Name Description
Workbook workbook
CancellationToken cancellationToken
Returns
Type Description
IReadOnlyList<Bitmap>

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
Type Name Description
Workbook workbook
string pathPattern
WorkbookImageSaveOptions options
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
Type Name Description
Workbook workbook
string pathPattern
CancellationToken cancellationToken
Back to top

DR-IT Software documentation

DR-IT Software · Products · Documentation index · Product page · Downloads · Support · Licensing

Generated by DocFX