OfficeIMO.Reader.Html
3.6.2
Prefix Reserved
dotnet add package OfficeIMO.Reader.Html --version 3.6.2
NuGet\Install-Package OfficeIMO.Reader.Html -Version 3.6.2
<PackageReference Include="OfficeIMO.Reader.Html" Version="3.6.2" />
<PackageVersion Include="OfficeIMO.Reader.Html" Version="3.6.2" />
<PackageReference Include="OfficeIMO.Reader.Html" />
paket add OfficeIMO.Reader.Html --version 3.6.2
#r "nuget: OfficeIMO.Reader.Html, 3.6.2"
#:package OfficeIMO.Reader.Html@3.6.2
#addin nuget:?package=OfficeIMO.Reader.Html&version=3.6.2
#tool nuget:?package=OfficeIMO.Reader.Html&version=3.6.2
OfficeIMO.Reader.Html - HTML reader adapter
OfficeIMO.Reader.Html provides a modular HTML, HTM, and XHTML 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();
Install OfficeIMO.Reader.Email and call AddMhtmlHandler() when the input is an MHT/MHTML archive. The dedicated registration reuses this HTML projection without placing MIME dependencies in ordinary HTML or EPUB applications.
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.
Stream and file input detects byte-order marks and HTML meta charset declarations. Set ReaderHtmlOptions.InputEncoding when the transport or application already knows the encoding:
using System.Text;
ReaderHtmlOptions htmlOptions = ReaderHtmlOptions.CreatePortableProfile();
htmlOptions.InputEncoding = Encoding.GetEncoding("iso-8859-1");
OfficeDocumentReader reader = new OfficeDocumentReaderBuilder()
.AddHtmlHandler(htmlOptions)
.Build();
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.Enumerate("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.ReadDocument("report.html",
new ReaderOptions {
MaxTableRows = 250
}).ExtractTables();
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
ReaderChunkoutput. - Table extraction with
ReaderTable.ColumnProfiles. - Heading-aware chunk metadata when
ReaderHtmlOptions.ChunkByHeadingsis enabled. - BOM/meta-charset detection with an explicit
ReaderHtmlOptions.InputEncodingoverride. - 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.
- 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.Markdown, andOfficeIMO.Markdown.Htmlown parsing, projection, chunks, and rich results. Email, RTF, and MHTML are not part of this package graph.
See the complete OfficeIMO package map for related formats and conversion paths.
| Product | Versions 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. |
-
.NETFramework 4.7.2
- OfficeIMO.Html (>= 3.6.2)
- OfficeIMO.Markdown.Html (>= 3.6.2)
- OfficeIMO.Reader.Core (>= 3.6.2)
-
.NETStandard 2.0
- OfficeIMO.Html (>= 3.6.2)
- OfficeIMO.Markdown.Html (>= 3.6.2)
- OfficeIMO.Reader.Core (>= 3.6.2)
-
net10.0
- OfficeIMO.Html (>= 3.6.2)
- OfficeIMO.Markdown.Html (>= 3.6.2)
- OfficeIMO.Reader.Core (>= 3.6.2)
-
net8.0
- OfficeIMO.Html (>= 3.6.2)
- OfficeIMO.Markdown.Html (>= 3.6.2)
- OfficeIMO.Reader.Core (>= 3.6.2)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on OfficeIMO.Reader.Html:
| Package | Downloads |
|---|---|
|
OfficeIMO.Reader.Epub
EPUB adapter for OfficeIMO.Reader modular ingestion. |
|
|
OfficeIMO.Reader.Email
Unified email, MHTML, Outlook store, and Offline Address Book adapter for OfficeIMO.Reader.Core. |
|
|
OfficeIMO.Reader.All
Composition-only preset for registering OfficeIMO.Reader's local format adapters. |
|
|
OfficeIMO.Reader.Chm
CHM help-book adapter for OfficeIMO.Reader modular ingestion. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.6.2 | 358 | 11/18/2026 |
| 3.6.1 | 344 | 11/10/2026 |
| 3.6.0 | 339 | 11/6/2026 |
| 3.5.3 | 282 | 10/31/2026 |
| 3.5.2 | 255 | 10/24/2026 |
| 3.5.1 | 312 | 10/16/2026 |
| 3.4.5 | 757 | 10/10/2026 |
| 3.4.4 | 447 | 9/27/2026 |
| 3.4.3 | 405 | 9/12/2026 |
| 3.4.2 | 312 | 9/9/2026 |
| 3.4.1 | 303 | 9/7/2026 |
| 3.4.0 | 265 | 9/6/2026 |
| 3.3.0 | 256 | 9/2/2026 |
| 3.2.7 | 239 | 8/29/2026 |
| 3.2.6 | 698 | 8/22/2026 |
| 3.2.5 | 357 | 8/21/2026 |
| 3.2.4 | 340 | 8/19/2026 |
| 3.2.3 | 265 | 8/17/2026 |
| 3.2.2 | 466 | 8/13/2026 |
| 3.2.1 | 394 | 8/11/2026 |