Html到RTF [英] Html to RTF

查看:105
本文介绍了Html到RTF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,

如何使用C#.net代码将html页面转换为RTF格式?

                    How to convert the html pages into RTF format using the C#.net code?

任何人都可以请发送详细信息...如何转换?

                    Can any one please send the details...how to convert?

问候

Divakar

推荐答案

HTML通常不是格式良好的XML,XML解析器和工具无法处理它。解析HTML可以使用MSHTML完成,但AFAIK不提供"另存为RTF"。功能。如果输入HTML是XHTML,那么从理论上讲,您可以编写一个将XHTML转换为RTF的XSLT样式表。转换没有严格定义,因为有许多不同的方法可以将XHTML文档格式化为RTF。

想到一个实用的解决方案:自动化一个应用程序,如Word,可以打开HTML文档并将其另存为RTF(此讨论组中的偏离主题)

JavaScript示例:


HTML in general is not a well-formed XML and it can't be processed by XML parsers and tools. Parsing HTML can be done with MSHTML, but AFAIK it doesn't provide "Save as RTF" function. If the input HTML is XHTML then, in theory, you can write an XSLT stylesheet that transforms XHTML to RTF. The transform is not strictly defined because there are many different ways to format XHTML document as RTF.

A practical solution that comes to mind: Automate an application, such as Word, that can open HTML documents and save them as RTF (off-topic in this discussion group)

JavaScript example:



Code Snippet


这篇关于Html到RTF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆