Xbase++
Xbase++
Convert HTML to Plain Text
Demonstrates how to convert HTML to plain text.Chilkat Xbase++ Downloads
LOCAL oH2t
LOCAL cHtml
LOCAL cPlainText
// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
oH2t := CreateObject("Chilkat.HtmlToText")
cHtml := oH2t:ReadFileToString("c:/temp/test.html", "utf-8")
IF (oH2t:LastMethodSuccess == 0)
? oH2t:LastErrorText
oH2t:destroy()
RETURN
ENDIF
cPlainText := oH2t:ToText(cHtml)
IF (oH2t:LastMethodSuccess == 0)
? oH2t:LastErrorText
oH2t:destroy()
RETURN
ENDIF
? cPlainText
oH2t:destroy()