简体   繁体   English

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

[英]how to convert preformated text to RTF with java

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 你好,我有一个纯文本emial(预先格式化简单的换行符),我想转换为RTF将其存储在数据库中

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 我有一个用.NET / C#编写的桌面应用程序,必须创建一个Web界面(用JAVA编写),这就是为什么我需要rtf2text和text2rtf转换

I could do the rtf2text conversion with rtfeditorkit from the swing package.... 我可以用swing包中的rtfeditorkit进行rtf2text转换....

can I do the opposite with rtfeditorkit or I have to find another solution? 我可以与rtfeditorkit做相反的事情,还是我必须找到另一种解决方案?

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 :( 我已经尝试过srv(简单的rtf编写器)来执行从文本到rtf的转换,但是它没有用,因为转换后所有格式都消失了:(

So how to do the text2rtf conversion to preserve the original formating of the text? 那么如何进行text2rtf转换以保留文本的原始格式呢?

Please give me a code sample if it is possible 如果可能,请给我一个代码示例

Thanks in advance 提前致谢

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

BTW, you state that your email are plain text and then to retain formatting. 顺便说一句,您声明您的电子邮件是纯文本,然后保留格式。 Aren't those contradictory? 那些矛盾吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM