I was applying a master slide from a theme PPTX to a target presentation. The chart colors and background colors are all fine when applying but the background graphics is hidden from view. I wasn’t able to find an API to unhide it but I can do it manually in Powerpoint. Could you help me with this?
Code to convert and sample PPTX files are attached:
@srijal,
I’ve reproduced the problem with missing background graphics when cloning the master slide to another presentation and added a ticket with ID SLIDESJAVA-39084 to our issue-tracking system. We apologize for any inconvenience. Our development team will investigate the case. You will be notified when a new release of Aspose.Slides with the update is published.
Please also share the following additional information:
@srijal,
Our developers have carefully studied the problem you described and they found the following code lines:
try (var document = new Document("saved.pdf")) {
document.save("saved.pptx", SaveFormat.Pptx);
The Document object (Aspose.PDF) creates a new presentation from the PDF. Please look at the background properties of the presentation created by Aspose.PDF: backgroud.png (56.0 KB). We can easily find that the “hide background graphics” property is already set to true, therefore, all subsequent operations already take this property into account. This leads to the conclusion that the problem occurs when Aspose.PDF converts PDF to PPTX.
Thanks for the solution. It seems to work well for the Theme.pptx file. However, I am facing an exception converting for another theme. Please use the attached Theme2.pptx file with the above code to reproduce.
Exception
Exception in thread "main" class com.aspose.slides.exceptions.KeyNotFoundException: The given key was not present in the dictionary. com.aspose.slides.Collections.Generic.SortedList$ThrowHelper.throwKeyNotFoundException(Unknown Source) com.aspose.slides.Collections.Generic.SortedList.get_Item(Unknown Source) com.aspose.slides.internal.o0.break.<init>(Unknown Source) com.aspose.slides.internal.o0.long.goto(Unknown Source) com.aspose.slides.internal.o0.long.case(Unknown Source) com.aspose.slides.internal.o0.extends.do(Unknown Source) com.aspose.slides.sd.do(Unknown Source) com.aspose.slides.sd.do(Unknown Source) com.aspose.slides.sd.do(Unknown Source) com.aspose.slides.sd.do(Unknown Source) com.aspose.slides.rr.do(Unknown Source) com.aspose.slides.av2.do(Unknown Source) com.aspose.slides.rr.do(Unknown Source) com.aspose.slides.ol.do(Unknown Source) com.aspose.slides.sj.do(Unknown Source) com.aspose.slides.ax1.static(Unknown Source) com.aspose.slides.z2.do(Unknown Source) com.aspose.slides.axu.do(Unknown Source) com.aspose.slides.axu.<init>(Unknown Source) com.aspose.slides.axl.do(Unknown Source) com.aspose.slides.axm.do(Unknown Source) com.aspose.slides.axm.do(Unknown Source) com.aspose.slides.axm.do(Unknown Source) com.aspose.slides.axm.if(Unknown Source) com.aspose.slides.al.do(Unknown Source) com.aspose.slides.u6.do(Unknown Source) com.aspose.slides.u6.do(Unknown Source) com.aspose.slides.ce.do(Unknown Source) com.aspose.slides.z5.do(Unknown Source) com.aspose.slides.ase.do(Unknown Source) com.aspose.slides.amj.do(Unknown Source) com.aspose.slides.amj.do(Unknown Source) com.aspose.slides.al9.do(Unknown Source) com.aspose.slides.MasterSlideCollection.do(Unknown Source) com.aspose.slides.MasterSlideCollection.addClone(Unknown Source) App.convertToPptxWithTheme(App.java:116) App.main(App.java:13) at com.aspose.slides.Collections.Generic.SortedList$ThrowHelper.throwKeyNotFoundException(Unknown Source) at com.aspose.slides.Collections.Generic.SortedList.get_Item(Unknown Source) at com.aspose.slides.internal.o0.break.<init>(Unknown Source) at com.aspose.slides.internal.o0.long.goto(Unknown Source) at com.aspose.slides.internal.o0.long.case(Unknown Source) at com.aspose.slides.internal.o0.extends.do(Unknown Source) at com.aspose.slides.sd.do(Unknown Source) at com.aspose.slides.sd.do(Unknown Source) at com.aspose.slides.sd.do(Unknown Source) at com.aspose.slides.sd.do(Unknown Source) at com.aspose.slides.rr.do(Unknown Source) at com.aspose.slides.av2.do(Unknown Source) at com.aspose.slides.rr.do(Unknown Source) at com.aspose.slides.ol.do(Unknown Source) at com.aspose.slides.sj.do(Unknown Source) at com.aspose.slides.ax1.static(Unknown Source) at com.aspose.slides.z2.do(Unknown Source) at com.aspose.slides.axu.do(Unknown Source) at com.aspose.slides.axu.<init>(Unknown Source) at com.aspose.slides.axl.do(Unknown Source) at com.aspose.slides.axm.do(Unknown Source) at com.aspose.slides.axm.do(Unknown Source) at com.aspose.slides.axm.do(Unknown Source) at com.aspose.slides.axm.if(Unknown Source) at com.aspose.slides.al.do(Unknown Source) at com.aspose.slides.u6.do(Unknown Source) at com.aspose.slides.u6.do(Unknown Source) at com.aspose.slides.ce.do(Unknown Source) at com.aspose.slides.z5.do(Unknown Source) at com.aspose.slides.ase.do(Unknown Source) at com.aspose.slides.amj.do(Unknown Source) at com.aspose.slides.amj.do(Unknown Source) at com.aspose.slides.al9.do(Unknown Source) at com.aspose.slides.MasterSlideCollection.do(Unknown Source) at com.aspose.slides.MasterSlideCollection.addClone(Unknown Source) at App.convertToPptxWithTheme(App.java:116) at App.main(App.java:13)