Parse/display RTF text in HTML?

假装没事ソ 提交于 2019-12-21 23:27:42

问题


I'm looking to take some RTF code, such as this sample excerpt below, and displaying it in an HTML page. I don't need it to be editable, and don't want it to be at this time. In researching this I've seen plenty of RTF-capable WYSIWYG editors, but that's not really what I'm after.

{}
{\rtf1\ansi\ansicpg1252\uc1\htmautsp\deff2
    {\fonttbl{\f0\fcharset0 Times New Roman;}
    {\f2\fcharset0 Segoe UI;}
    {\f3\fcharset0 Microsoft Yi Baiti;}
}
{\colortbl\red0\green0\blue0;\red255\green255\blue255;}
\loch\hich\dbch\pard\plain\ltrpar\itap0
{\lang1033\fs18\f2\cf0 \cf0\ql{\fs24\f2 
{\loch\f3\ltrch Hello }

Is there any way to display RTF in an HTML page? Would it be better to try and parse it into HTML/CSS or is that even possible? I also considered parsing it on the .NET side, but haven't came across any solutions.

Any insight would be greatly appreciated!


回答1:


FWIW, I'm going to go with the solution found here, as it seems the most flexible.

Converting Between RTF and HTML



来源:https://stackoverflow.com/questions/16152424/parse-display-rtf-text-in-html

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!