Spire.Presentation for Java 3.4.3已正式发布。该版本新增了支持转换形状到图片时设置分辨率、获取文本在形状中的位置的功能;同时也修复了转换PPT到PDF/Word、添加HMTL时出现的一些问题。新功能及问题修复详情如下。
新功能:
- 支持转换形状到图片时,设置分辨率
Presentation ppt = new Presentation();
ppt.loadFromFile(input);
for (int i = 0; i < ppt.getSlides().get(0).getShapes().getCount(); i++){
String fileName = outputPath + "shapeToImage_demo"+i+".png";
BufferedImage image = ppt.getSlides().get(0).getShapes().saveAsImage(i,300,300);
ImageIO.write(image, "PNG", new File(fileName));
}
Presentation ppt = new Presentation();
ppt.loadFromFile(inputFile);
IAutoShape shape = (IAutoShape)ppt.getSlides().get(0).getShapes().get(0);
Point2D location =shape.getTextFrame().getTextLocation();
String concent = "text在第一张幻灯片中Shape中的坐标: x= " + (location.getX() - shape.getLeft()) + " y= " + (location.getY() - shape.getTop());
System.out.println(concent);
问题修复:
- 修复了转换PPT到PDF/Word时,图表不正确的问题
- 修复了添加Html内容失败的问题
- 修复了设置DOUGHNUT图表的图例字体以及颜色失败的问题
- 修复了添加html后,h1标签加粗样式丢失的问题
- 修复了创建图表保存文档失败的问题
获取Spire.Presentation for Java 3.4.3,请点击:
https://www.e-iceblue.cn/Downloads/Spire-Presentation-JAVA.html