rtf 和 html 可以存在于同一个应用程序中吗?
我认为这是一个非常受欢迎的问题。我有一个包含 rtf 字段的旧应用程序。就我而言,rtf 仅用于非常基本的功能(字体:大小、样式、颜色……超链接)。不管怎样,因为我允许从word粘贴,有时一些更复杂的东西可以放进去。
现在 rtf 就可以了,即使是因为使用报表生成器我可以在打印 rtf 的地方获得报表。
问题来自网络应用程序。我正在开发一个 Web 应用程序,它基本上是我的遗留应用程序的可选界面。
在这个阶段,我通过删除 rtf 格式解决了问题(我使用讨论的 TRichEdit 技巧
无论如何,理想情况下我希望能够在 Web 应用程序和 win32 应用程序中查看和编辑格式化文本。
有什么解决办法吗?
在这个问题中,我找到了ScroogeHTML 转换器。
但即使我进行转换,也有以下几点我无法调和:
- 存储:存储什么?目前我当然存储rtf。
- 每次在Web应用程序中显示富文本时,是否应该将rtf转换为html,然后将其转换回rtf进行存储?
I have what I think it is a very popular problem. I have a legacy app that contains rtf fields. rtf in my case is used only for very basic features (font: size, style, color, ... hyperlinks). Anyway since I allow to paste from word sometimes some more complex things can go in there.
Now rtf is ok, even because with Report Builder I can get reports where rtf is printed.
The problem comes with web application. I am developing a web application that is basically an optional interface for my legacy application.
At this stage I solved the probelm by removing the rtf formatting (I use the TRichEdit trick discussed here).
Anyway ideally I would like to be able to see and edit formatted text in both the web application and the win32 application.
What can be the solution?
In this question I found a link to the ScroogeHTML converter.
But even if I convert there are these points that i cannot reconcile:
- Storage: what to store? Currently of course I store rtf.
- Should I convert rtf to html every time I show the rich text in web app and then convert it back to rtf for storage?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在 Web 应用程序中实现 RTF 编辑器。
http://en.wikipedia.org/wiki/Online_rich-text_editor
这样你就不会不必更改存储格式。
Your could implement a RTF editor in your web application.
http://en.wikipedia.org/wiki/Online_rich-text_editor
This way you don't have to change the storage format.