We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Delete Unused Masters causing problems for PowerPoint 2007

If you open the attached Presentation and call DeleteUnusedMasters() the resulting presentation will not open in PowerPoint 2007

I’m using 2.7.2

any ideas?

Yes, I can see this problem. How did you create this presentation, did you use MS-PowerPoint or Aspose.Slides to create it?

BTW, I created the presentation with unused masters and resulting presentation could be viewed in MS-PowerPoint 2007.

The template was created by extracting it from a normal presentation. here are the steps I used.

Presentation srcPresentation = new Presentation(“legalPres.ppt”);
Presentation templatePres = new Presentation();
srcPresentation.CloneSlide(srcPresentation.GetSlideByPosition(1), 2, templatePres, new SortedList());
templatePres.Slides.Remove(templatePres.GetSlideByPosition(2));
templatePres.DeleteUnusedMasters();
templatePres.DeleteHandout();
templatePres.Write(“newTemplate.ppt”);

If I don’t call DeleteUnusedMasters() then the newTemplate.ppt file will open fine in PowerPoint2007.

It looks like Handout has one more cross reference to other objects and DeleteHandout method doesn’t clear this information. We will publish new hot fix tomorrow. Hope it should help.

The 2.7.3 hot fix did help with the senario I posted above, but when I attempt to change the master of slide 1 in the templatePresentation to the master of slide 2 that I cloned I still get the same behavior as before where the output will not open in 2007 unless I remove the DeleteUnusedMasters call.

Presentation sourcePres = new Presentation(pptInput);
Presentation templatePres = new Presentation();
Slide newSlide = sourcePres.CloneSlide(sourcePres.GetSlideByPosition(1), 2, templatePres, new SortedList());
Slide newmaster = templatePres.GetSlideById(newSlide.MasterId);
templatePres.GetSlideByPosition(1).ChangeMaster(newmaster);
templatePres.Slides.Remove(newSlide);
templatePres.DeleteUnusedMasters();
templatePres.DeleteHandout();
templatePres.Write(@“newTemplate.ppt”);

I have looked into this problem and could not reproduce it using PP Viewer 2007, because it opens newTemplate.ppt fine.

I used the same code provided by you and attached the source and generated presentations. Delete unused masters did not cause the problem you stated.

Please open newTemplate.ppt at your side in PP 2007 and let me know.

I was able to confirm that the newTemplate file will open in PowerPoint03 and in PPTView07, but It will not open in PowerPoint07.


Does it open in PP2007? Did you check it? I just need confirmation before reporting it.

No, it will not open PP2007. I have tested it on a couple of computers.

Dear Plunk,

I have reported it as a bug and fix will be available as soon as possible.

Thank you for your reply and addressing this as a bug to be fixed. Is it possible that this might be resolved within the next day as we have a product release on hold due to this issue?

Thanks,

-Lamont

Dear Lamont,

I have requested the technical team lead to look into this issue and fix it. He will also tell you when the fix could be available.

I’m afraid it’s not possible to resolve it in a short time (in a day).
Actually, I don’t have ideas yet why PP2007 can’t read this presentation.

As a quick solution, don’t use DeleteUnusedMasters() method.
“new Presentation()” object has tiny master so I don’t see any reasons to delete it.

Hello Alexey

Our application makes use of the Aspose Slides API to support an interactive process of constructing new presentations from multiple presentations.

As each slide from a presentation is merged into the working presentation, the template master of the working presentation is applied to the newly merged slide.

As numerous slides may be added to the working presentation from numerous other presentations, we delete unused masters or we could potentially accumulate several template masters within the presentation that are un-used. Based on your previous post we attempted to remove all references to deleting unused masters -- when we did so we found that slides could not be edited in PowerPoint 2003 without failure. We will shortly add another post to this entry with details.

I should also mention that the attached presentation is just an example of a presentation where we have had the issue of the resulting output not being readable by PowerPoint 2007. In fact, since the 2.7.x release of Aspose Slides, we no longer have a reliable means of generating PPT outputs that are readable by PowerPoint 2007.

We are certainly open to other suggestions of how we might get around this problem. However, it is essential that we be able to delete un-used masters as described above.

Thanks,

-Lamont

Hello Alexey,

It looks like we may have found a way to leave the un-unused template masters (as you recommended) in the presentation output without creating problems for PP2007. Therefore, this situation is a little less critical for now. We will want to delete the un-unused masters when you are able to address this in a later hot fix.

Thanks again for your help!

-Lamont

Dear plunk and lamontg,

This bug has been resolved.

Please download the latest Aspose.Slides 2.7.6.0 from this link.

http://www.aspose.com/Community/Files/51/aspose.slides/default.aspx