Hi,
I have .pptx and .ppt versions of the presentation with footers added to each slide. In .pptx file, footers are recognized as Placeholders, but in .ppt files that’s not the case.
Here’s the code I use:
public void testPpt() throws Exception {
String presentationPath = “FooterRegularSlidesTest.ppt”;
InputStream inputStream = new FileInputStream(presentationPath);
Presentation presentation = new Presentation(inputStream);
inputStream.close();
ISlideCollection slides = presentation.getSlides();
ISlide slide = slides.get_Item(0);
IShapeCollection shapes = slide.getShapes();
IAutoShape shape = (IAutoShape) shapes.get_Item(2);
System.out.println(“PPT”);
System.out.println("isPlaceholder: " + shape.isTextHolder());
System.out.println(shape.getTextFrame().getText());
}
public void testPptx() throws Exception {
String presentationPath = “FooterRegularSlidesTest.pptx”;
InputStream inputStream = new FileInputStream(presentationPath);
Presentation presentation = new Presentation(inputStream);
inputStream.close();
ISlideCollection slides = presentation.getSlides();
ISlide slide = slides.get_Item(0);
IShapeCollection shapes = slide.getShapes();
IAutoShape shape = (IAutoShape) shapes.get_Item(2);
System.out.println(“PPTX”);
System.out.println("isPlaceholder: " + shape.isTextHolder());
System.out.println(shape.getTextFrame().getText());
}
Here’s the output:
PPT
isPlaceholder: false
Footer text added to Title Slide Layout.
PPTX
isPlaceholder: true
Footer text added to Title Slide Layout.
I’m using Aspose.Slides for Java 16.9.0.
Can you check this?
Thanks,
Zeljko