i am using apache poi hslf for ppt genertion. I want to write in text box like first line is heading and is bold, rest is content and non bold. I have used HSLFTextRun to keep the settings different for heading and content.I am facing issue that whenever i apply setbold(true) for heading text run. It also makes the content bold as well. although i have tried setting setbold(false) for the content but of no use. Following is the code
public static void main(String[] args) throws IOException {
HSLFSlideShow ppt = new HSLFSlideShow();
HSLFSlide slide = ppt.createSlide();
HSLFTextBox tb = slide.createTextBox();
tb.setAnchor(new Rectangle(100, 100, 200, 200));
HSLFTextRun titleTR = tb.appendText("Title", true);
titleTR.setBold(true);
HSLFTextRun bullet1TR = tb.appendText(" bullet1", true);
bullet1TR.getTextParagraph().setBullet(true);
bullet1TR.setBold(false);
HSLFTextRun bullet2TR = tb.appendText(" bullet2", true);
bullet2TR.getTextParagraph().setBullet(true);
bullet2TR.setBold(false);
FileOutputStream fos = new FileOutputStream("bullet.ppt");
ppt.write(fos);
fos.close();
ppt.close();
}
Any help on this matter is appreciate, Thanks.