HtmlToOpenXml.dll 2.3.0

.NET Standard 1.3 .NET Framework 4.6
Install-Package HtmlToOpenXml.dll -Version 2.3.0
dotnet add package HtmlToOpenXml.dll --version 2.3.0
<PackageReference Include="HtmlToOpenXml.dll" Version="2.3.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add HtmlToOpenXml.dll --version 2.3.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: HtmlToOpenXml.dll, 2.3.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install HtmlToOpenXml.dll as a Cake Addin
#addin nuget:?package=HtmlToOpenXml.dll&version=2.3.0

// Install HtmlToOpenXml.dll as a Cake Tool
#tool nuget:?package=HtmlToOpenXml.dll&version=2.3.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Latest version License MIT NuGet codecov.io

netstandard1.3 netstandard2.0 net46

What is Html2OpenXml?

Html2OpenXml is a small .Net library that convert simple or advanced HTML to plain OpenXml components. This program has started in 2009, initially to convert user's comments from SharePoint to Word.

This library supports both .Net Core (netstandard1.3) and .Net Framework 4.6.

Depends on DocumentFormat.OpenXml.

See Also

Supported Html tags

Refer to w3schools’ tag list to see their meaning

  • <a>
  • <h1-h6>
  • <abbr> and <acronym>
  • <b>, <i>, <u>, <s>, <del>, <ins>, <em>, <strike>, <strong>
  • <br> and <hr>
  • <img>, <figcaption>
  • <table>, <td>, <tr>, <th>, <tbody>, <thead>, <tfoot> and <caption>
  • <cite>
  • <div>, <span>, <font> and <p>
  • <pre>
  • <sub> and <sup>
  • <ul>, <ol> and <li>
  • <dd> and <dt>
  • <q> and <blockquote> (since 1.5)
  • <article>, <aside>, <section> are considered like <div>

Javascript (<script>), CSS <style>, <meta> and other not supported tags does not generate an error but are ignored.

Tolerance for bad formed HTML

The parsing of the Html is done using a custom Regex-based enumerator. These are supported:

samples
Ignore case <span>Some text<SPAN>
Missing closing tag or invalid tag position <i>Here<b> is </i> some</b> bad formed html.
no need to be XHTML compliant Both <br> and <br/> are valid
Color red, #ff0000, #f00, rgb(255,0,0,.5), hsl(0, 100%, 50%) are all the red color
Attributes <table id=table1> or <table id="table1">

Acknowledgements

Thank you to all contributors that share their bug fixes: scwebgroup, ddforge, daviderapicavoli, worstenbrood, jodybullen, BenBurns, OleK, scarhand, imagremlin, antgraf, mdeclercq, pauldbentley, xjpmauricio, jairoXXX, giorand, bostjanKlemenc, AaronLS, taishmanov. And thanks to David Podhola for the Nuget package.

Logo provided with the permission of Enhanced Labs Design Studio.

Support

This project is open source and I do my best to support it in my spare time. I'm always happy to receive Pull Request and grateful for the time you have taken If you have questions, don't hesitate to get in touch with me!

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
.NET Core netcoreapp1.0 netcoreapp1.1 netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard1.3 netstandard1.4 netstandard1.5 netstandard1.6 netstandard2.0 netstandard2.1
.NET Framework net46 net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen30 tizen40 tizen60
Universal Windows Platform uap uap10.0
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on HtmlToOpenXml.dll:

Package Downloads
Magicodes.IE.Word

Import and export general library, support Dto import and export, template export, fancy export and dynamic export, support Excel, Csv, Word, Pdf and Html. 导入导出通用库,支持Dto导入导出、模板导出、花式导出以及动态导出,支持Excel、Csv、Word、Pdf和Html。 开源库地址:https://github.com/xin-lai 博客地址:http://www.cnblogs.com/codelove/ 更新记录:https://github.com/dotnetcore/Magicodes.IE/blob/master/RELEASE.md 公众号:麦扣聊技术 交流QQ群:85318032 **2022.04.17** - 优化了ColumnIndex在生成模板时的实现,增加了ColumnIndex的单测(见PR[#385](https://github.com/dotnetcore/Magicodes.IE/pull/385))。 - 添加了NPOI的独立扩展包——Magicodes.IE.Excel.NPOI,以便于后续给用户提供更多的支持。目前仅提供了 SaveToExcelWithXSSFWorkbook 扩展方法。 - 修复RequiredIfAttribute的Bug。 - 修复导出JPG图片在Linux环境下可能引起的无限循环的问题(见PR[#396](https://github.com/dotnetcore/Magicodes.IE/pull/396))。 - Excel图片导入时,图片列支持为空。 - 更新CsvHelper到最新版本,并修改相关代码。 **2022.03.06** - 完善筛选器注册机制,在指定了特性ImportHeaderFilter、ExporterHeaderFilter等值后,筛选器将匹配对于的类型,如不指定则作为全局筛选器。 **2022.03.02** - Excel导入时增加回调函数,方便增加自定义验证 - 优化获取DisplayName的逻辑 - 导出CSV支持ColumnIndex - 优化Pdf导出逻辑,统一各平台导出代码

Manacost.AB

Description

My-FyiReporting-Netstandard

My-FyiReporting netstandard 2.0 one assembly port

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on HtmlToOpenXml.dll:

Repository Stars
dotnetcore/Magicodes.IE
Import and export general library, support Dto import and export, template export, fancy export and dynamic export, support Excel, Csv, Word, Pdf and Html.
Version Downloads Last updated
2.3.0 12,069 3/1/2022
2.2.0 178,431 1/5/2021
2.1.0 45,483 7/9/2020
2.0.3 158,536 6/19/2019
2.0.2 65,766 8/27/2018
2.0.1 47,634 2/14/2018
2.0.0 10,850 1/8/2018
1.5.0 245,308 4/18/2014
1.4.1 5,594 9/26/2013