PowGrade.FileConverters.XlsxToHtml
0.1.0
dotnet add package PowGrade.FileConverters.XlsxToHtml --version 0.1.0
NuGet\Install-Package PowGrade.FileConverters.XlsxToHtml -Version 0.1.0
<PackageReference Include="PowGrade.FileConverters.XlsxToHtml" Version="0.1.0" />
<PackageVersion Include="PowGrade.FileConverters.XlsxToHtml" Version="0.1.0" />
<PackageReference Include="PowGrade.FileConverters.XlsxToHtml" />
paket add PowGrade.FileConverters.XlsxToHtml --version 0.1.0
#r "nuget: PowGrade.FileConverters.XlsxToHtml, 0.1.0"
#:package PowGrade.FileConverters.XlsxToHtml@0.1.0
#addin nuget:?package=PowGrade.FileConverters.XlsxToHtml&version=0.1.0
#tool nuget:?package=PowGrade.FileConverters.XlsxToHtml&version=0.1.0
PowGrade.FileConverters.XlsxToHtml
A high-performance, zero-dependency library and CLI for converting Excel (.xlsx) files to HTML targeting .NET 8.0 (and the library also supports .NETStandard 2.1).
Features
- No third-party dependencies – only .NET Base Class Library.
- Streaming XML parsing for low memory usage.
- Inline CSS styles reflecting cell formatting (fonts, colors, number/date formats; bold, italic, underline, background colors).
- Advanced number formatting: percent, fractions, conditional sections, and custom format strings are interpreted when possible (including basic color codes, positive/negative sections, and hex color specifications).
Custom colors
A static helper is exposed for named color lookup. Call ColorHelper.AddOrUpdate("name", "#RRGGBB") before conversion to register additional mappings (e.g. "orchid").
Formulas
If a cell contains a formula (<f> element) the HTML <td> will receive a title attribute containing the formula prefixed with =; the displayed value normally remains the cached result.
A runtime option allows basic evaluation of formulas (arithmetic, cell refs, ranges, SUM, AVERAGE):
var writer = new HtmlWriter { EvaluateFormulas = true };
- Console utility for batch conversions.
Usage
Convert a workbook to HTML using the CLI:
dotnet run --project src/PowGrade.FileConverters.XlsxToHtml.Cli -- input.xlsx output.html
Omitting the output path will dump the HTML to standard output, making it easy to pipe.
Conversion is streaming and efficient; the entire document is never loaded into a DOM.
Building & Testing
The library multi-targets .NET 8.0 and .NET Standard 2.1; the CLI and tests target .NET 8.0.
This project depends on the PowGrade.FileConverters.Core NuGet package. The library
implements IFileConverter and is decorated with [FileConverter("xlsx","html")],
enabling automatic discovery by the core infrastructure. The CLI also consumes the
static Converter.Convert entry point from the core package.
Use the core API like so:
using PowGrade.FileConverters;
using var outStream = Converter.Convert(inStream, "xlsx", "html");
# build all projects (run from repo root)
dotnet build src/PowGrade.FileConverters.XlsxToHtml.slnx
# run unit tests for the path-based solution
dotnet test src/PowGrade.FileConverters.XlsxToHtml.slnx
Limitations
- Formulas are not evaluated by default; set
HtmlWriter.EvaluateFormulastotruefor simple expressions. - Images/charts and comments are not supported yet.
This repository is structured under src/ following .NET best practices.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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 was computed. 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. |
-
net8.0
- PowGrade.FileConverters.Core (>= 0.1.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on PowGrade.FileConverters.XlsxToHtml:
| Package | Downloads |
|---|---|
|
PowGrade.FileConverters.XlsxToHtml.Cli
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0 | 150 | 4/30/2026 |