Hi,
we are upgrading from Aspose
Slides 7.9.0 to version 14.6.0.
We are generating PPTs from Template Files in a servlet of a web application. After adapting the code to the new version we get a null pointer exception when cloning shapes. We were able to isolate the problem in a few lines of code.
Running as standalone app (as shown below) that works fine. As soon as we execute that code in a servlet we get a NullPointerException at the red line (destSlide and sourceShape are valid, though).
public class PowerPoint {
public static void main(String[]
args) {
Presentation srcPres = new Presentation(“test.ppt”);
Presentation destPres = new Presentation();
ISlide
sourceSlide = srcPres.getSlides().get_Item(0);
ISlide
destSlide = destPres.getSlides().get_Item(0);
for (IShape
sourceShape : sourceSlide.getShapes()) {
IShape destShape = destSlide.getShapes().addClone(sourceShape);
destShape.setY(destShape.getY() + destShape.getHeight());
}
destPres.save(“test1.ppt”, SaveFormat.Ppt);
}
}
Do you have any suggestions how to solve the problem?
Thanks,
Manfred