C# .NET RTF 到 HTML 转换器和 HTML 到 RTF 转换器库
我的 ASP.NET MVC3 应用程序需要一个可以在 HTML 和 RTF 之间相互转换的库。
有很多工具只做一项工作,将 RTF 转换为 HTML。但我也需要能够倒退。
我最接近的是: http://code.msdn.microsoft.com/windowsdesktop/Converting - Between-RTF-and-aaa02a6e
但这会引发错误 调用线程必须是 STA,因为许多 UI 组件需要此。
我根本没有更改代码。
I need a library for my ASP.NET MVC3 Application that can convert to and from HTML and RTF.
There are a lot out there that do just one, converting RTF to HTML. But I need to be able to go backwards too.
The closest Ive come is:
http://code.msdn.microsoft.com/windowsdesktop/Converting-between-RTF-and-aaa02a6e
But that throws the error The calling thread must be STA, because many UI components require this.
Despite Ive not changed the code at all.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
免责声明:我在这家公司工作。
Doomsknight,尝试使用我们的 dll 库。关于RTF到HTML我已经发布了这里,那么HTML呢到 RTF 我们公司也有这个“HTML 到 RTF”的组件在这里 http://www.htmltortf。 com/convert-html-to-rtf-net/html-to-rtf-csharp-aspnet.php。还提供 HTML 到 RTF Pro DLL.Net 的在线版本。
有帮助的小示例代码:
在 C# 中将 HTML 文件转换为 RTF 文件:
祝一切顺利:)
Disclaimer: I'm working for this company.
Doomsknight, try to use our dll library. about RTF to HTML i have posted here, what about HTMl to RTF our company also have the component for this "HTML to RTF" here http://www.htmltortf.com/convert-html-to-rtf-net/html-to-rtf-csharp-aspnet.php. Online version of HTML to RTF Pro DLL.Net also available.
Small sample code to help:
Convert HTML file to RTF file in C#:
All the best :)
如果您的 html 符合 xml 格式以转换为 rtf,则应该使用 xslt。搜索 html2rtf.xsl[t],您应该能够找到一些东西。
You should use xslt, if your html is xml compliant for the converstion to rtf. Do a search for html2rtf.xsl[t] and you should be able to find something.