(DataFlex) Convert HTML to Plain Text
Demonstrates how to convert HTML to plain text.
Use ChilkatAx-win32.pkg
Procedure Test
Handle hoH2t
String sHtml
String sPlainText
String sTemp1
Boolean bTemp1
// This example requires 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
Get ComReadFileToString Of hoH2t "c:/temp/test.html" "utf-8" To sHtml
Get ComLastMethodSuccess Of hoH2t To bTemp1
If (bTemp1 = False) Begin
Get ComLastErrorText Of hoH2t To sTemp1
Showln sTemp1
Procedure_Return
End
Get ComToText Of hoH2t sHtml To sPlainText
Get ComLastMethodSuccess Of hoH2t To bTemp1
If (bTemp1 = False) Begin
Get ComLastErrorText Of hoH2t To sTemp1
Showln sTemp1
Procedure_Return
End
Showln sPlainText
End_Procedure
|