见附件BugPpt.zip (2.5 MB)
嵌入的excel文件名乱码了
转换代码
// Instantiate a Presentation object that represents a presentation file
Presentation pres = new Presentation(sourceFileName,loadOptions);
File path = new File(targetFileName.substring(0, targetFileName.lastIndexOf('.')));
path.mkdirs();
// Add font rule collection to rule list
IFontsManager fontsManager = pres.getFontsManager();
fontsManager.setFontSubstRuleList(fontSubstRuleCollection);
StringBuilder fs = new StringBuilder();
IFontData[] fonts = fontsManager.getFonts();
for (int i = 0; i < fonts.length; i++) {
fs.append(" ").append(fonts[i].getFontName());
}
LOG.info("ppt " + sourceFileName + " use " + fs);
// Saving the presentation to HTML
// pres.save(targetFileName.replaceAll("//", “/”)+".html", com.aspose.slides.SaveFormat.Html, options);
for(int i = 0; i < pres.getSlides().size(); i++){
// access the first slide from the collection
ISlide slide = pres.getSlides().get_Item(i);
// create a full scale image of the slide
BufferedImage image = slide.getThumbnail(2f, 2f);
try {
// save the image in jpg format
ImageIO.write(image, “jpg”, new File(path +"/"+i+".jpg"));
} catch (IOException e) {
LOG.error(e.getLocalizedMessage(),e);
}
}