如何使用C#从Html文件转换为Rtf [英] How Can I Convert From Html File To Rtf Using C#

查看:236
本文介绍了如何使用C#从Html文件转换为Rtf的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我需要将HTML转换为RTF以进行打印。我的解决方案中有一个包含HTML文件的文件夹,我想要做的就是将该文件转换为C#中的RTF。



请帮帮我。



先谢谢。

--RG

In my application I need to convert HTML to RTF for print purpose.I have one folder in my solution that contains HTML file what I want to do is just take that file and convert to RTF in C#.

Please help me.

Thanks in Advance.
--RG

推荐答案

打印目的是将现代和积极开发的HTML转换为主要过时的RTF的一个非常糟糕的借口。但是CodeProject上有很多非常好的作品,它们的目的非常好。请参阅:

专业的HTML渲染器你将使用 [ ^ ],

WPF HTML支持的TextBlock [ ^ ]。



您可能会在第一眼看到这些文章无关,但要正确查看代码:它是通过以RTF形式呈现HTML来完成的。你想要达到的目标。



-SA
"Print purpose" is a really bad excuse for converting modern and actively developing HTML into majorly obsolete RTF. But there are couple of very good works on CodeProject where it is done for really good purposes. Please see:
A Professional HTML Renderer You Will Use[^],
WPF HTML Supported TextBlock[^].

You may find those article unrelated at first glance, but look properly at the code: it's done by rendering HTML in the form of RTF. Something which you are trying to achieve.

—SA


检查以下链接

http://stackoverflow.com/questions/150208/how-do-i-convert-html-to-rtf-rich-text-in-net-without-paying-for-a-component [ ^ ]

[ ^ ]

< a href =http://stackoverflow.com/questions/5922626/c-sharp-net-converting-html-to-rtf> http://stackoverflow.com / questions / 5922626 / c-sharp-net-converting-html-to-rtf [ ^ ]
check below links
http://stackoverflow.com/questions/150208/how-do-i-convert-html-to-rtf-rich-text-in-net-without-paying-for-a-component[^]
XHTML2RTF: An HTML to RTF conversion tool based on XSL[^]
http://stackoverflow.com/questions/5922626/c-sharp-net-converting-html-to-rtf[^]


这篇关于如何使用C#从Html文件转换为Rtf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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