如何使用java将预格式化文本转换为RTF

发布于 2024-09-30 10:48:56 字数 407 浏览 0 评论 0原文

你好,我有一个纯文本 emial(用简单的换行符预先格式化),我想将其转换为 RTF 以将其存储在数据库中

我有一个用 .NET/C# 编写的桌面应用程序,并且必须创建一个 Web 界面(用 JAVA 编写) )所以这就是为什么我需要 rtf2text 和 text2rtf 转换

我可以使用 swing 包中的 rtfeditorkit 进行 rtf2text 转换....

我可以使用 rtfeditorkit 做相反的事情还是我必须找到另一个解决方案?

我已经尝试过 srv (简单的 rtf writer)来进行从文本到 rtf 的转换,但它不起作用,因为转换后所有格式都消失了:(

那么如何进行 text2rtf 转换以保留原始格式 话,

如果可能的

请给我一个代码示例提前致谢

hello I have a plain text emial (preformated with simple line-breaks) which I would like to convert to RTF to store it in database

I have a desktop application written in .NET/C# and have to create a web interface (written with JAVA ) for that So that's why I need rtf2text and, text2rtf conversion

I could do the rtf2text conversion with rtfeditorkit from the swing package....

can I do the opposite with rtfeditorkit or I have to find another solution?

I have already tried srv ( simple rtf writer ) to do the conversion from text to rtf, but it didn't work because all the formatting was gone after the conversion :(

So how to do the text2rtf conversion to preserve the original formating of the text?

Please give me a code sample if it is possible

Thanks in advance

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

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

发布评论

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

评论(1

百思不得你姐 2024-10-07 10:48:56

iText 支持 RTF 生成
http://www.lowagie.com/iText/

顺便说一句,您声明您的电子邮件是纯文本然后保留格式。这些不是很矛盾吗?

iText support RTF generation
http://www.lowagie.com/iText/

BTW, you state that your email are plain text and then to retain formatting. Aren't those contradictory?

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