[英]Is there any way to make text both bold as well as italic in ppt using apache poi?
In apache poi there are methods to make text bold or italic or underline, like I did as below,在 apache poi 中有一些方法可以使文本变为粗体或斜体或下划线,如下所示,
textBox.appendText(text, false).setBold(true);
textBox.appendText(text, false).setItalic(true);
textBox.appendText(text, false).setUnderlined(true);
textBox.appendText(text, false).setStrikethrough(true);
But I'm not able to do all the things on the same text like bold and italic and underline:但我不能在同一文本上做所有的事情,比如粗体、斜体和下划线:
" Example " “例子”
So, how to do that?那么,该怎么做呢?
Have you tried this:你有没有试过这个:
TextRun run = textBox.appendText(text, false);
run.setBold(true);
run.setItalic(true);
run.setUnderlined(true);
run.setStrikethrough(true);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.