Sample code for 30+ languages & platforms
Classic ASP

Convert HTML to Plain Text

Demonstrates how to convert HTML to plain text.

Chilkat Classic ASP Downloads

Classic ASP
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
' This example requires the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.

set h2t = Server.CreateObject("Chilkat.HtmlToText")

html = h2t.ReadFileToString("c:/temp/test.html","utf-8")
If (h2t.LastMethodSuccess = 0) Then
    Response.Write "<pre>" & Server.HTMLEncode( h2t.LastErrorText) & "</pre>"
    Response.End
End If

plainText = h2t.ToText(html)
If (h2t.LastMethodSuccess = 0) Then
    Response.Write "<pre>" & Server.HTMLEncode( h2t.LastErrorText) & "</pre>"
    Response.End
End If

Response.Write "<pre>" & Server.HTMLEncode( plainText) & "</pre>"

%>
</body>
</html>