HtmlToOpenXml.dll
2.4.1
See the version list below for details.
dotnet add package HtmlToOpenXml.dll --version 2.4.1
NuGet\Install-Package HtmlToOpenXml.dll -Version 2.4.1
<PackageReference Include="HtmlToOpenXml.dll" Version="2.4.1" />
paket add HtmlToOpenXml.dll --version 2.4.1
#r "nuget: HtmlToOpenXml.dll, 2.4.1"
// Install HtmlToOpenXml.dll as a Cake Addin #addin nuget:?package=HtmlToOpenXml.dll&version=2.4.1 // Install HtmlToOpenXml.dll as a Cake Tool #tool nuget:?package=HtmlToOpenXml.dll&version=2.4.1
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 (netstandard2.0) and .Net Framework 4.6, 6 and 8.
Depends on DocumentFormat.OpenXml.
See Also
- Documentation
- How to deliver a generated DOCX from server Asp.Net/SharePoint?
- Prevent Document Edition
- Convert dotx to docx
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 Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. 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. |
.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 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. |
-
.NETStandard 2.0
- DocumentFormat.OpenXml (>= 3.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 6.0.0)
-
net6.0
- DocumentFormat.OpenXml (>= 3.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 6.0.0)
-
net8.0
- DocumentFormat.OpenXml (>= 3.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 6.0.0)
NuGet packages (7)
Showing the top 5 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 |
|
BBTRulesEngine
BBT Rules Engine |
|
MiniWords
.NET Word(docx) exporting template engine without COM+ and interop (support Linux and Mac) |
|
BootstrapBlazor.Table.ImportExportsService
BootstrapBlazor Table 数据导入导出服务扩展包(Excel/Word/Html/Pdf) |
|
Manacost.AB
Description |
GitHub repositories (2)
Showing the top 2 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.
|
|
CervantesSec/cervantes
Cervantes is an open-source, collaborative platform designed specifically for pentesters and red teams. It serves as a comprehensive management tool, streamlining the organization of projects, clients, vulnerabilities, and reports in a single, centralized location.
|
Version | Downloads | Last updated | |
---|---|---|---|
3.2.2 | 7,479 | 12/11/2024 | |
3.2.1 | 21,937 | 10/16/2024 | |
3.2.0 | 21,122 | 9/24/2024 | |
3.1.1 | 13,885 | 9/4/2024 | |
3.1.0 | 5,066 | 8/23/2024 | |
3.0.1 | 4,762 | 8/10/2024 | |
3.0.0 | 9,625 | 7/8/2024 | |
3.0.0-beta | 745 | 6/18/2024 | |
2.4.2 | 66,276 | 2/18/2024 | |
2.4.1 | 756 | 2/16/2024 | |
2.4.0 | 6,839 | 1/25/2024 | |
2.3.0 | 650,648 | 3/1/2022 | |
2.2.0 | 558,720 | 1/5/2021 | |
2.1.0 | 109,297 | 7/9/2020 | |
2.0.3 | 418,698 | 6/19/2019 | |
2.0.2 | 113,014 | 8/27/2018 | |
2.0.1 | 103,585 | 2/14/2018 | |
2.0.0 | 24,258 | 1/8/2018 | |
1.5.0 | 415,685 | 4/18/2014 | |
1.4.1 | 36,375 | 9/26/2013 |