Dear sir! when are using hslf ppt2png,i can do this code[see code1].how to do it by xslf ppt2png? Looking forward to your reply at the soonest. my email: skygongle@gmail.com code1: Slide[] slide = ppt.getSlides(); for (int i = 0; i < slide.length; i++) { if ((slidenum != -1) && (slidenum != i + 1)) continue; // ####支持中文#### TextRun[] truns = slide[i].getTextRuns(); String title = slide[i].getTitle(); for (int k = 0; k < truns.length; k++) { RichTextRun[] rtruns = truns[k].getRichTextRuns(); for (int l = 0; l < rtruns.length; l++) { int index = rtruns[l].getFontIndex(); String name = rtruns[l].getFontName(); rtruns[l].setFontIndex(1); rtruns[l].setFontName("宋体"); // System.out.println(rtruns[l].getText()); } }
Well the soonest is already long ago ... The code to export PPT and PPTX to PNG can be found under [1] - maybe there's a problem with chinese font encoding. Feel free to reopen this bug, but please add an example ppt. Andi [1] https://svn.apache.org/repos/asf/poi/trunk/src/ooxml/java/org/apache/poi/xslf/util/PPTX2PNG.java