Sample code for 30+ languages & platforms
PowerBuilder

Convert HTML to plain-text

See more HTML-to-XML/Text Examples

Demonstrates how to convert HTML to plain-text.

Chilkat PowerBuilder Downloads

PowerBuilder
integer li_rc
oleobject loo_H2t
string ls_Html
string ls_PlainText

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

loo_H2t = create oleobject
li_rc = loo_H2t.ConnectToNewObject("Chilkat.HtmlToText")
if li_rc < 0 then
    destroy loo_H2t
    MessageBox("Error","Connecting to COM object failed")
    return
end if

// Set the HTML:

ls_Html = "<html><body><p>This is a test.</p><blockquote>Here is text within a blockquote</blockquote></body></html>"

ls_PlainText = loo_H2t.ToText(ls_Html)

Write-Debug ls_PlainText

// The output looks like this:

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


destroy loo_H2t