HtmlToOpenXml.dll 2.4.2
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 Framework 4.6.2, .NET Standard 2.0 and .NET 8 which are all LTS.
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!
Showing the top 20 packages that depend on HtmlToOpenXml.dll.
Packages | Downloads |
---|---|
Magicodes.Next.Word
The next version of [Magicodes.IE]( https://github.com/dotnetcore/Magicodes.IE ), a more friendly library to use in ABP framework.
|
2 |
Magicodes.Next.Word
The next version of [Magicodes.IE]( https://github.com/dotnetcore/Magicodes.IE ), a more friendly library to use in ABP framework.
|
1 |
Magicodes.Next.Word
The next version of [Magicodes.IE]( https://github.com/dotnetcore/Magicodes.IE ), a more friendly library to use in ABP framework.
|
0 |
.NET Framework 4.6.2
- DocumentFormat.OpenXml (>= 3.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 6.0.0)
.NET 8.0
- DocumentFormat.OpenXml (>= 3.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 6.0.0)
.NET Standard 2.0
- DocumentFormat.OpenXml (>= 3.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 6.0.0)
Version | Downloads | Last updated |
---|---|---|
3.1.1 | 1 | 9/19/2024 |
3.1.0 | 0 | 8/23/2024 |
3.0.1 | 0 | 8/10/2024 |
3.0.0 | 0 | 7/8/2024 |
3.0.0-beta | 0 | 6/18/2024 |
2.4.2 | 3 | 3/5/2024 |
2.4.1 | 1 | 4/12/2024 |
2.4.0 | 1 | 4/12/2024 |
2.3.0 | 9 | 12/30/2022 |
2.2.0 | 1 | 10/21/2023 |
2.1.0 | 0 | 7/9/2020 |
2.0.3 | 0 | 6/19/2019 |
2.0.2 | 0 | 8/27/2018 |
2.0.1 | 0 | 2/14/2018 |
2.0.0 | 0 | 1/8/2018 |
1.5.0 | 0 | 4/18/2014 |
1.4.1 | 0 | 9/26/2013 |