DocWright.Spreadsheet.Rendering 2.0.0

dotnet add package DocWright.Spreadsheet.Rendering --version 2.0.0
                    
NuGet\Install-Package DocWright.Spreadsheet.Rendering -Version 2.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DocWright.Spreadsheet.Rendering" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DocWright.Spreadsheet.Rendering" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="DocWright.Spreadsheet.Rendering" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DocWright.Spreadsheet.Rendering --version 2.0.0
                    
#r "nuget: DocWright.Spreadsheet.Rendering, 2.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DocWright.Spreadsheet.Rendering@2.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DocWright.Spreadsheet.Rendering&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=DocWright.Spreadsheet.Rendering&version=2.0.0
                    
Install as a Cake Tool

DocWright.Spreadsheet.Rendering

Saves an Excel workbook as PDF, as images and as HTML; lays a worksheet out as Excel prints it; and tells a grid view where a sheet's columns and rows are on screen.

  • SpreadsheetConverter saves an opened workbook: ToPdf (what Excel's own export writes, page for page; tagged and PDF/A when asked), ToImages, RenderRange, and ToHtml (one self-contained page, every cell escaped, no script). Make one and use it for every workbook.

    var converter = new SpreadsheetConverter();
    XlsxDocument workbook = XlsxDocument.Open(File.OpenRead("orders.xlsx"));
    using (FileStream pdf = File.Create("orders.pdf"))
    {
        converter.ToPdf(workbook, pdf);
    }
    
    using (var html = new StreamWriter("orders.html"))
    {
        converter.ToHtml(workbook, html);
    }
    
  • SpreadsheetLayout.Layout(sheet, fonts, options) (or a whole workbook) gives a LayoutDocument: the pages Excel's print of the sheet has, with each cell's text, fill and borders where Excel puts them. Draw it with DocWright.Renderers.Pdf or DocWright.Renderers.Imaging.

    var fonts = new FontEngine(new FontEngineOptions());
    XlsxDocument workbook = XlsxDocument.Open(File.OpenRead("orders.xlsx"));
    LayoutDocument pages = SpreadsheetLayout.Layout(workbook, fonts);
    using FileStream pdf = File.Create("orders.pdf");
    new PdfLayoutRenderer(fonts).Render(pages, pdf, new RenderOptions(), NullConversionDiagnostics.Instance);
    
  • SpreadsheetGeometry.For(sheet, fonts) gives column and row positions in twips for the screen, frozen panes included, without paginating.

Conditional formats are drawn as XlsxDocumentSheet.EffectiveStyle gives them: fills, fonts, borders and colour scales as Excel draws them, data bars solid (Excel's are a gradient); icon sets and rules given by a formula are not drawn. Pictures are drawn over the cells, cropped, and the sheet is printed out to the last one, as Excel prints it. Charts are drawn over the pictures where their anchors put them, by the engine a Word document's charts are drawn by (column, bar, line, area, pie, doughnut and scatter; radar, bubble, surface, stock and 2016 charts are left out and reported), and SpreadsheetConverter.RenderChart(chart) draws one chart on its own as an image:

foreach (XlsxChart chart in workbook.Sheets[0].Charts)
{
    File.WriteAllBytes(chart.Name + ".png", converter.RenderChart(chart));
}

Shapes, text boxes and lines are drawn too, outlined by the preset table a Word document's shapes are outlined by, filled, outlined and lettered as the shape or its theme style says; sparklines are drawn in their cells, and a sparkline's cell is printed though it holds nothing else, as Excel prints it. Groups of shapes, form controls, comments, icon sets, dashed borders and turned text are not drawn as Excel draws them; a sheet that has one says so once through SpreadsheetLayoutOptions.Diagnostics. Limits.MaxPages (100,000 by default) bounds the pages and the grid a hostile file can ask for.

Works on a workbook opened or created with DocWright.Spreadsheet (XlsxDocument). References the workbook model, DocWright.Core, DocWright.Fonts and the PDF and image renderers; no Word package. Nothing is calculated: a formula shows the result the file stores.

Guides and API reference: https://docs.albahadly.com/docwright/

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 is compatible.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0 0 11/25/2026

Guides, tutorials and API reference: https://docs.albahadly.com/docwright/