简体   繁体   English

有没有办法使用 apache poi 在 ppt 中使文本既粗体又斜体?

[英]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.

相关问题 使用 Apache POI 将整行加粗 - Make the entire row bold using Apache POI 使用apache poi hslf在ppt文本框中的标题为粗体,但非标题应为非粗体 - Heading to be bold but non heading should be non bold in ppt textbox using apache poi hslf 有没有办法使用Apache POI读取.xls和.xlsx文件? - Is there any way to read both .xls and .xlsx files using Apache POI? 如何使用 Apache POI PPT API 设置文本高亮? - How to set text hightlight using Apache POI PPT API? 如何使用Apache POI PPT API设置文本字体? - How to set text font using Apache POI PPT API? 使用apache-poi 4.0.1库将单元格内容的某些部分设置为粗体/斜体 - Setting Some part of cell content to bold/italic using apache-poi 4.0.1 library 无法为使用 apache poi 的行的某些部分添加项目符号和 styles(如粗体和斜体) - Not able to add bullet points and styles like bold and italic for some portion of a line using apache poi 在 Streaming XSSFWorkbook 中,使用 apache poi 将部分单元格内容变为粗体 - In Streaming XSSFWorkbook make part of cell content to bold using apache poi 如何使用 Apache POI 为整行应用粗体文本样式? - How to apply bold text style for an entire row using Apache POI? 如何在 android studio 的 EditText Bold 或 Italic 中制作任何选定的文本并将其存储到 SQLite 数据库中? - How can I make any selected text in an EditText Bold or Italic in android studio and store it into a SQLite database?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM