Table of Contents

Method RenderRange

Namespace
DocWright.Spreadsheet.Rendering
Assembly
DocWright.Spreadsheet.Rendering.dll

RenderRange(XlsxDocumentSheet, XlsxCellRange, int)

Draws one range of a sheet as a PNG exactly as large as its cells, with the grid the sheet shows on screen.

public byte[] RenderRange(XlsxDocumentSheet sheet, XlsxCellRange range, int dpi = 96)

Parameters

sheet XlsxDocumentSheet

The sheet.

range XlsxCellRange

The range.

dpi int

The resolution, in dots per inch of the printed size; 96 by default.

Returns

byte[]

The PNG.

Exceptions

ArgumentNullException

sheet is null.

ArgumentOutOfRangeException

dpi is not positive.

InvalidDocumentException

A part of the workbook the layout reads is malformed.

ResourceLimitExceededException

The range is more rows and columns, or the image more pixels, than the limits allow.