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
This method uses NPOI.SS.UserModel and NPOI.XSSF.UserModel namespaces



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