(PowerBuilder) Convert HTML to plain-text
Demonstrates how to convert HTML to plain-text.
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
// Use "Chilkat_9_5_0.HtmlToText" for versions of Chilkat < 10.0.0
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
|