Spire.Presentation for Java 11.5.1 已发布。该版本新增了一个压缩图片的功能,并同时修复了一个在转换 PPT 到 PDF 时出现的问题。详情请查看以下内容。
新功能:
- 支持压缩图片。
Presentation presentation = new Presentation();
presentation.loadFromFile(inputFile);
SlideCollection slides = presentation.getSlides();
for (int i = 0; i < slides.getCount(); i++) {
ISlide slide = slides.get(i);
ShapeCollection shapes = slide.getShapes();
for (int j = 0; j < shapes.getCount(); j++) {
IShape shape = shapes.get(j);
if (shape instanceof SlidePicture) {
SlidePicture slidepicture = (SlidePicture) shape;
// 压缩图片,目标分辨率50 DPI(数值越小压缩越大)
boolean result = slidepicture.getPictureFill().getCompressImage( true, 50f);
}
}
}
问题修复:
- 修复了 PPT 转 PDF,背景色不正确的问题。
获取Spire.Presentation for Java 11.5.1请点击:
https://www.e-iceblue.cn/Downloads/Spire-Presentation-JAVA.html







