Sample code for 30+ languages & platforms
PowerShell

Convert HTML to Plain Text

Demonstrates how to convert HTML to plain text.

Chilkat PowerShell Downloads

PowerShell
Add-Type -Path "C:\chilkat\ChilkatDotNet47-x64\ChilkatDotNet47.dll"

# This example requires the Chilkat API to have been previously unlocked.
# See Global Unlock Sample for sample code.

$h2t = New-Object Chilkat.HtmlToText

$html = $h2t.ReadFileToString("c:/temp/test.html","utf-8")
if ($h2t.LastMethodSuccess -eq $false) {
    $($h2t.LastErrorText)
    exit
}

$plainText = $h2t.ToText($html)
if ($h2t.LastMethodSuccess -eq $false) {
    $($h2t.LastErrorText)
    exit
}

$($plainText)