Convert HTML to Text with NPOI — Zerone Consulting

Convert HTML to Text with NPOI

The HTML styles used in this scope are:

  1. Line-breaks (BR, P, DIV)
  2. Bulleting
  3. Numbering
  4. Bold, Italic, and Underline

Installing dependencies:

  • Install-Package NPOI -Version 2.5.1
  • Install-Package HtmlAgilityPack -Version 1.11.24
HtmlAgilityPack namespace
Selecting a node safely
HtmlAgilityPack namespace
convert-HTML-text-to-NPOI-rich-text
convert-HTML-text-to-NPOI-rich-text
This method uses NPOI.SS.UserModel and NPOI.XSSF.UserModel namespaces
Convert-HTML-to-Text-with-NPOI-using-NPOI.SS_.UserModel-and-NPOI.XSSF_.UserModel-namespaces-2
Convert-HTML-to-Text-with-NPOI-using-NPOI.SS_.UserModel-and-NPOI.XSSF_.UserModel-namespaces-3

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store