Sample code for 30+ languages & platforms
DataFlex

Convert HTML to plain-text

See more HTML-to-XML/Text Examples

Demonstrates how to convert HTML to plain-text.

Chilkat DataFlex Downloads

DataFlex
Use ChilkatAx-win32.pkg

Procedure Test
    Handle hoH2t
    String sHtml
    String sPlainText

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

    Get Create (RefClass(cComChilkatHtmlToText)) To hoH2t
    If (Not(IsComObjectCreated(hoH2t))) Begin
        Send CreateComObject of hoH2t
    End

    // Set the HTML:

    Move "<html><body><p>This is a test.</p><blockquote>Here is text within a blockquote</blockquote></body></html>" To sHtml

    Get ComToText Of hoH2t sHtml To sPlainText

    Showln sPlainText

    // The output looks like this:

    // This is a test.
    // 
    //     Here is text within a blockquote


End_Procedure