Telerik RadEditor 内存流/字符串保存为 RTF

发布于 2024-09-02 13:23:44 字数 387 浏览 2 评论 0原文

我想要的所需功能是从数据库中提取 RTF 内容,通过 Web 界面(使用所见即所得编辑器)对其进行编辑,然后将修改后的文本放回数据库(以 RTF 格式)。

我用来执行此操作的控件是 Telerik RadEditor(我们已经拥有这些控件的许可证)。在最新版本中,似乎有从字符串或流加载 RTF 内容的功能,但我能看到的唯一用于获取 RTF 的方法是 exportToRTF();此方法修改了标题并允许您将刚刚编辑的内容的 RTF 版本保存为文件。

从 HTML 转换为 RTF 的功能必须存在于其库中的某个位置,因为您可以导出 RTF 文件,但我找不到任何公开公开的方法来将其传递到流或字符串。

有谁知道我可以使用 Telerik 库将 HTML 转换回 RTF 而不保存到文件的方法吗?

谢谢

The required functionality I am aiming for is to pull out RTF content from a database, edit it through a web interface (with a WYSIWYG editor) and then place the modified text back in to the database (in RTF format).

The control that I am using to do this is Telerik RadEditor (we have a license already for these controls). In the most recent version there appears to be functionality to load in RTF content from a string or a stream, but the only method I can see that is exposed for getting RTF back out is exportToRTF(); this method modified the headers and allows you to save a RTF version of the content you have just edited as a file.

The functionality to convert from HTML to RTF must exist somewhere within their library as you can export a RTF file, but I can not find any publicly exposed methods to pass this in to a stream or a string.

Does anybody know of a way that I can convert the HTML back to RTF using the Telerik libraries without saving out to a file?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

新人笑 2024-09-09 13:23:44

我认为进行实际转换的方法在 Telerik 程序集中不公开,因此您唯一的选择是使用内置的导出功能。您可以为 ExportContent 事件添加处理程序。您将可以在实际操作之前访问将保存到文件中的内容。

由于导出调用会更改当前页面请求的响应,因此您可以创建一个新的虚拟页面,在其中添加编辑器,将其 .Content 属性设置为您要导出的内容,将处理程序附加到 ExportContent,最后调用导出方法编辑的。

I think the methods that do the actual conversion are not publicly available in the Telerik assembly, so your only choice is to use the built-in export functionality. You can add a handler for the ExportContent event. There you will have access to the content that will be saved to the file before the actual operation.

Since the export call changes the response of the current page request, you can create a new dummy page, add an editor there, set its .Content property to the content you wish to export, attach a handler to ExportContent and finally call the export method of the editor.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文