尝试过了最新版本,依旧不行,运行环境Windows10 ppt2010/2016
public static String write(IShape shape) {
String pathname = PptConfig.getPath() + PptConfig.getName() + “/”;
File path = new File(pathname);
if (!path.exists()) {
path.mkdirs();
}
String sourceName = “media/” + System.nanoTime() + “.svg”;
try {
FileOutputStream os = new FileOutputStream(pathname + sourceName);
shape.writeAsSvg(os);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
return sourceName;
}