When you create a ppt, create a slide and add a textbox, define the font bold or italic, the font size will trun to 1. It's too small to seen. Check the below code: public static void test1() { try{ File ppt = new File("D:/temp/a.ppt"); //HSLFSlideShow hshow = new HSLFSlideShow(new FileInputStream(ppt)); HSLFSlideShow hshow = new HSLFSlideShow(); SlideShow show = new SlideShow(hshow); Slide slide = show.createSlide(); TextBox box = new TextBox(); // set box content // box.setItalic(true); box.setText("Text Box!!"); // set the box's size Rectangle rec = new Rectangle(100,100,100,100); box.setAnchor(rec); // set text box's color //box.setFillColor(Color.BLACK); box.setBackgroundColor(Color.BLUE); // set text box's font box.setFontName("Arial", show); box.setFontSize(20); box.setBold(true); box.setFillColor(Color.BLUE); slide.addShape(box); // line shape Line line = new Line(); line.setAnchor(new java.awt.Rectangle(50, 50, 100, 20)); line.setLineColor(new Color(0, 128, 0)); line.setLineStyle(Line.LineDashDotSys); slide.addShape(line); // write the file hshow.write(new FileOutputStream(ppt)); Trace("Export successful! " + ppt.getAbsolutePath()); }catch(Exception e) { e.printStackTrace(); } }
It seems another example of Bug 39324. When it is fixed this issue should be resolved.
A fix for bug 39324 has been committed. Could you please re-try with the latest SVN?
As we haven't heard anything to say it doesn't now work, marking as closed. Please re-open if the problem still exists.