Free Support Forum - aspose.com

Slide Masters and Layouts difference in .ppt and .pptx files

Hi,


I created a .pptx presentation and added text boxes to the slide master, the first and the second slide layout, using MS PowerPoint 2013. I also saved it as .ppt.

I then printed all slide masters and slide layouts in both presentations and there are differences.

Here’s the code I use to print all slide masters and slide layouts in both presentations:

@Test
public void test() throws Exception {

String presentationPath = “SlideMastersTest.ppt”;

InputStream inputStream = new FileInputStream(presentationPath);

Presentation presentation = new Presentation(inputStream);

inputStream.close();

IMasterSlideCollection slideMasters = presentation.getMasters();

System.out.println(“PPT file”);

for (int i = 0; i < slideMasters.size(); i++) {
System.out.println("Slide Master " + i);

ILayoutSlideCollection slideLayouts = slideMasters.get_Item(i).getLayoutSlides();

for (ILayoutSlide layoutSlide : slideLayouts) {
System.out.println("Slide Layout type: " + layoutSlide.getLayoutType());
}
}
}

@Test
public void testPptx() throws Exception {

String presentationPath = “SlideMastersTest.pptx”;

InputStream inputStream = new FileInputStream(presentationPath);

Presentation presentation = new Presentation(inputStream);

inputStream.close();

IMasterSlideCollection slideMasters = presentation.getMasters();

System.out.println(“PPTX file”);

for (int i = 0; i < slideMasters.size(); i++) {
System.out.println("Slide Master " + i);

ILayoutSlideCollection slideLayouts = slideMasters.get_Item(i).getLayoutSlides();

for (ILayoutSlide layoutSlide : slideLayouts) {
System.out.println("Slide Layout type: " + layoutSlide.getLayoutType());
}
}
}

Here’s the output:

PPTX file
Slide Master 0
Slide Layout type: 0
Slide Layout type: 15
Slide Layout type: 31
Slide Layout type: 28
Slide Layout type: 32
Slide Layout type: 10
Slide Layout type: 11
Slide Layout type: 33
Slide Layout type: 34
Slide Layout type: 24
Slide Layout type: 26
PPT file
Slide Master 0
Slide Layout type: 31
Slide Layout type: 28
Slide Layout type: 32
Slide Layout type: 10
Slide Layout type: 11
Slide Layout type: 33
Slide Layout type: 34
Slide Layout type: 24
Slide Layout type: 26
Slide Master 1
Slide Layout type: 0
Slide Master 2
Slide Layout type: 15

As you can see, in case of .pptx everything is fine, but in case of .ppt two new slide masters are created and they contain slide layouts I edited, respectively.

Can you check this?

Thanks,
Zeljko
Hi Zeljko,

I have observed your comments. I have been able to reproduce the issue. A ticket with ID SLIDESJAVA-35681 has been logged in our issue tracking system to further investigate and resolve the issue.This thread has been linked with the issue so that you may be notified automatically as soon as the issue will be resolved.

We are sorry for your inconvenience,

Hi,

What’s the status of this issue? I’m not reproducing it anymore with Aspose.Slides for Java 18.8.

Thanks,
Zeljko

@Zeljko,

Yes, you are right the issue has been fixed in latest Aspose.Slides for Java 18.8 and is no more reproducible.

1 Like