简体   繁体   English

(Java) 如何使用彩色文本写入 RTF 文件

[英](Java) How to write to RTF file with colored text

I already know how to write to an rtf file in Java, but is there a way to do it with colored texts?我已经知道如何在 Java 中写入 rtf 文件,但是有没有办法用彩色文本来做到这一点? I want to do it in a way that would let me alternate the color between words.我想以一种可以让我在单词之间交替颜色的方式来做到这一点。

You might want to check this link to the documentation about color in RTF.您可能想查看此链接到有关 RTF 中颜色的文档。 You need to declare a color table and then select the color of your choosing for foreground/background.您需要声明一个颜色表,然后 select 为您选择的前景/背景颜色。

Hope this helps希望这可以帮助

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

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