Ppt转图片嵌入文件标题乱码


#1

见附件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);
}
}


#2

@wangwenyou,

我使用过您共享的源文件。您共享的代码段包含一些未声明的变量,所以请您分享您的SSCCE代码重现问题,以便我们可以尝试在我们的环境中重现和调查它。


#3

Presentation pres = new Presentation(sourceFileName);

File path = new File(targetFileName.substring(0, targetFileName.lastIndexOf(’.’)));

path.mkdirs();

StringBuilder fs = new StringBuilder();

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);

}

}


#4

@wangwenyou,

我使用了您共享的演示文件,并观察了指定的问题。 我们的问题跟踪系统已经创建了ID SLIDESJAVA-37617的问题,以进一步调查和解决该问题。 此主题已与问题相关联,因此一旦问题得到解决,您可能会收到通知。


#5

The issues you have found earlier (filed as SLIDESJAVA-37617) have been fixed in this update.