Answers:
你可以试试 unRTF 。
例如,让我们创建一个RTF文档。
然后将其转换为HTML(这是默认设置)。
unrtf test.rtf
这是输出:
<!DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN>
<html>
<head>
<meta http-equiv=content-type content=text/html charset=utf-8>
<!-- Translation from RTF performed by UnRTF, version 0.21.2 -->
<!--font table contains 0 fonts total-->
<!--invalid font number 0-->
</head>
<body><b><font size="3"><font color="#000000">This is a bold text<br>
<br>
<i>This is italics</i><br>
<br>
<u>This is underlined!</u></font></font></b></body>
</html>
在OS X上,TextEdit可以编辑RTF并另存为html。以下是它吐出的HTML类型的示例:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="1138.23">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
</style>
</head>
<body>
<p class="p1">this is a <b>test</b></p>
</body>
</html>