OfficeIMO.Reader.Html 3.0.3

Prefix Reserved
dotnet add package OfficeIMO.Reader.Html --version 3.0.3
                    
NuGet\Install-Package OfficeIMO.Reader.Html -Version 3.0.3
                    
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="OfficeIMO.Reader.Html" Version="3.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OfficeIMO.Reader.Html" Version="3.0.3" />
                    
Directory.Packages.props
<PackageReference Include="OfficeIMO.Reader.Html" />
                    
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 OfficeIMO.Reader.Html --version 3.0.3
                    
#r "nuget: OfficeIMO.Reader.Html, 3.0.3"
                    
#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 OfficeIMO.Reader.Html@3.0.3
                    
#: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=OfficeIMO.Reader.Html&version=3.0.3
                    
Install as a Cake Addin
#tool nuget:?package=OfficeIMO.Reader.Html&version=3.0.3
                    
Install as a Cake Tool

OfficeIMO.Reader.Html - HTML reader adapter

nuget version nuget downloads

OfficeIMO.Reader.Html provides a modular HTML and MHTML ingestion adapter for OfficeIMO.Reader.Core.

Install

dotnet add package OfficeIMO.Reader.Html

Configure

using OfficeIMO.Reader;
using OfficeIMO.Reader.Html;

OfficeDocumentReader reader = new OfficeDocumentReaderBuilder()
    .AddHtmlHandler()
    .Build();

The same registration handles .mht and .mhtml. Embedded MHTML resources become normal Reader assets and the archive uses the same rich HTML projection:

OfficeDocumentReadResult result = reader.ReadDocument("snapshot.mhtml");

foreach (OfficeDocumentAsset asset in result.Assets) {
    Console.WriteLine($"{asset.FileName}: {asset.LengthBytes}");
}

For untrusted or size-sensitive HTML:

OfficeDocumentReader reader = new OfficeDocumentReaderBuilder()
    .AddHtmlHandler(ReaderHtmlOptions.CreateUntrustedHtmlProfile(maxInputCharacters: 100_000))
    .Build();

ReaderHtmlOptions.ConversionOptions exposes the same trust, URL, and complexity policy used by other OfficeIMO.Html adapters. CreateUntrustedHtmlProfile applies its character cap both before shared parsing and during Markdown projection, so the reader does not maintain a second limit decision.

Examples

Convert HTML to Markdown chunks

using OfficeIMO.Reader;
using OfficeIMO.Reader.Html;

ReaderHtmlOptions htmlOptions = ReaderHtmlOptions.CreatePortableProfile();
htmlOptions.ChunkByHeadings = true;
OfficeDocumentReader reader = new OfficeDocumentReaderBuilder()
    .AddHtmlHandler(htmlOptions)
    .Build();

foreach (var chunk in reader.Read("page.html", new ReaderOptions {
    MaxChars = 5_000
})) {
    Console.WriteLine($"{chunk.Id}: {chunk.Location.HeadingPath}");
    Console.WriteLine(chunk.Markdown ?? chunk.Text);
}

Extract tables from HTML

using OfficeIMO.Reader;
using OfficeIMO.Reader.Html;

OfficeDocumentReader reader = new OfficeDocumentReaderBuilder()
    .AddHtmlHandler()
    .Build();

IReadOnlyList<ReaderTable> tables = reader.ReadTables("report.html",
    new ReaderOptions {
        MaxTableRows = 250
    });

foreach (var table in tables) {
    Console.WriteLine($"{table.Rows.Count} row(s), {table.ColumnProfiles.Count} column profile(s)");
}

Read the rich document result

OfficeDocumentReader reader = new OfficeDocumentReaderBuilder()
    .AddHtmlHandler()
    .Build();
OfficeDocumentReadResult document = reader.ReadDocument("application.html");

foreach (OfficeDocumentFormField field in document.Forms) {
    Console.WriteLine($"{field.Name}: {field.Value}");
}

foreach (OfficeDocumentLink link in document.Links) {
    Console.WriteLine(link.Uri ?? link.DestinationName);
}

reader.ReadDocument("application.html") dispatches to this native rich mapping.

What it emits

  • HTML converted to Markdown through OfficeIMO.Markdown.Html.
  • Markdown-shaped ReaderChunk output.
  • Table extraction with ReaderTable.ColumnProfiles.
  • Heading-aware chunk metadata when ReaderHtmlOptions.ChunkByHeadings is enabled.
  • HTML-to-Markdown profile, transform, converter, and visual round-trip option pass-through.
  • A schema-v5 rich result containing semantic headings, quotes, code, footnotes, list markers, figures, tables, links, form controls, media visuals, metadata, and bounded data-URI image assets.
  • MHTML root HTML, decoded related resources, archive diagnostics, and stable officeimo.html.mhtml capability evidence.
  • ARIA heading levels and accessible link/image names in rich blocks, links, assets, visuals, JSON, and officeimo.html.* capability identifiers.

Boundaries

  • Reader adapter configuration belongs here.
  • HTML to Markdown conversion belongs in OfficeIMO.Markdown.Html.
  • Shared extraction contracts belong in OfficeIMO.Reader.Core.

Targets and license

  • Targets: netstandard2.0, net8.0, net10.0.
  • License: MIT.

Dependency footprint

  • External: AngleSharp/AngleSharp.Css only through OfficeIMO.Html.
  • OfficeIMO: OfficeIMO.Reader.Core, OfficeIMO.Html, OfficeIMO.Email, OfficeIMO.Markdown, and OfficeIMO.Markdown.Html own MIME mechanics, parsing, projection, chunks, and rich results.

See the complete OfficeIMO package map for related formats and conversion paths.

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 is compatible.  net48 was computed.  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 (2)

Showing the top 2 NuGet packages that depend on OfficeIMO.Reader.Html:

Package Downloads
OfficeIMO.Reader.Epub

EPUB adapter for OfficeIMO.Reader modular ingestion.

OfficeIMO.Reader.All

Composition-only preset for registering OfficeIMO.Reader's local format adapters.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.3 35 7/27/2026
3.0.2 44 7/26/2026
3.0.1 192 7/26/2026
3.0.0 469 7/20/2026
2.0.1 293 7/14/2026
2.0.0 139 7/14/2026
0.0.33 1,006 7/9/2026
0.0.32 265 7/8/2026
0.0.31 427 7/5/2026
0.0.30 191 7/4/2026
0.0.29 208 6/27/2026
0.0.28 109 6/27/2026
0.0.27 371 6/24/2026
0.0.26 162 6/23/2026
0.0.25 277 6/21/2026
0.0.24 112 6/16/2026
0.0.23 292 6/16/2026
0.0.22 154 6/15/2026
0.0.21 125 6/13/2026
0.0.20 104 6/12/2026
Loading failed