Click here to Skip to main content
15,883,809 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I used POI library to create a Presentation. I want to put a bold Italic text. I used following code to set font style. But the presentation is generated without any font style. Is there any issue with the code?
Java
XMLSlideShow ppt = new XMLSlideShow();
XSLFSlideMaster defaultMaster = ppt.getSlideMasters()[0];
XSLFSlideLayout titleContentLayout = defaultMaster.getLayout(SlideLayout.TITLE_AND_CONTENT);
XSLFSlide titleContentSlide = ppt.createSlide(titleContentLayout);
XSLFTextShape slideContent = titleContentSlide.getPlaceholder(1);
XSLFTextRun txtRun = slideContent.addNewTextParagraph().addNewTextRun();
txtRun.setBold(true);
txtRun.setItalic(true);
txtRun.setText("Bold Text");
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900