Class PackageOptions
- Namespace
- SheetStream
- Assembly
- SheetStream.dll
Tuning knobs for an ExcelPackage. All defaults favour correctness and small files.
public sealed class PackageOptions
- Inheritance
-
PackageOptions
- Inherited Members
Properties
BufferSize
Size of the write buffer placed in front of each zip entry, in bytes.
public int BufferSize { get; set; }
Property Value
CompressionLevel
Zip compression applied to every part. Optimal gives the smallest file; Fastest trades roughly 20-30% size for noticeably faster writes on very large exports.
public CompressionLevel CompressionLevel { get; set; }
Property Value
MaxEditableCells
Largest number of cells a sheet may hold to be opened with Worksheets.Edit. Editing keeps the
whole sheet in memory, so this guards against loading a data dump by mistake: a sheet over the limit
throws and the message points at streaming or templates instead. Default 200,000 cells.
public int MaxEditableCells { get; set; }
Property Value
TextMeasurer
Text measurer used by AutoFitColumns(double, double) on every sheet of the
package: (text, bold) => width, where the width is in Excel's column unit, the width of one
digit of the default font (Calibri 11: 7 px at 96 dpi), so "0000000000" measures 10.
SheetStream then adds Excel's cell padding and scales for font size. null (default) uses the
built-in Calibri 11 glyph table, which reproduces Excel's own AutoFit to a few tenths of a unit for
Latin text. Plug in real font metrics (SkiaSharp, System.Drawing, ...) when the workbook uses another
font or non-Latin scripts; the delegate runs once per observed cell, so keep it cheap.
A per-sheet measurer passed to AutoFitColumns(Func<string, bool, double>, double, double)
takes precedence.
public Func<string, bool, double>? TextMeasurer { get; set; }
Property Value
UseSharedStrings
When true (default) string cells are de-duplicated through the shared string table, which
is what Excel itself does and produces the smallest files. When false strings are written
inline in the sheet, so memory stays flat regardless of how many unique strings the export has.
public bool UseSharedStrings { get; set; }