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

Free Support Forum - aspose.com

Exceptions during ppts building of presentation assembly

Hi,
We split individual slides from the attached PPT1.pptx and PPT2.pptx to presentations using Aspose slides 2.9.5. The slipt presentations were named PPT1_slide_0.pptx, PPT1_slide_1.pptx and so on.

Then later all the individual slide presentations were assembled with the following code:
(We were not able to upload the template potx file as the file upload widget does not allow pot and potx extensions. But we tried with a simple potx Document_POT07.potx with one single slide.)

//////////////////////// Code snippet from our production code lines /////////////////////
MasterSlideEx masterSlideX = null;
Hashtable pptxmasters = new Hashtable();
int masterIndex = -1;

PresentationEx srcTemplate = new PresentationEx(new FileInputStream(new File(getTemplateFilename())));
MasterSlideEx masterTemplateX = srcTemplate.getSlides().get(0).getLayoutSlide().getMasterSlide();
newPresentationEx = new PresentationEx();

////// LOOP FOR ALL THE SIDES PRESENTATIONS like PPT1_slide_0.pptx, PPT1_slide_1.pptx,… upto slide pres # 38 //////
do
{
PresentationEx srcPptEx = new PresentationEx(getSourceFilename()); //PPT1_slide_0.pptx, PPT1_slide_1.pptx, etc
SlideEx srcSlideEx = srcPptEx.getSlides().get(0);

if(masterTemplateX == null)
masterSlideX = srcSlideEx.getLayoutSlide().getMasterSlide();
else
masterSlideX = masterTemplateX;

if(pptxmasters.containsKey(masterSlideX.getSlideId()+""))
{
masterIndex = Integer.parseInt((String)pptxmasters.get(masterSlideX.getSlideId()+""));
}
else
{
masterIndex = newPresentationEx.getMasters().addClone(masterSlideX);
pptxmasters.put(masterSlideX.getSlideId()+"", masterIndex+"");
}

SlidesEx slds=newPresentationEx.getSlides();
slds.insertClone(pptSAI.getTargetIndex(), srcSlideEx, newPresentationEx.getMasters().get(masterIndex));

}while(continuePptProcessing())

/////////// END OF LOOP /////////////

REMOVE THE DEFAULT SLIDE MASTER FROM newPresentationEx

REMOVE DUPLICATE BLANK SLIDE FROM newPresentationEx

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

During PPT1.pptx slides assembly the processing fails for PPT1_slide_1.pptx with this exception

at com.intellij.rt.execution.application.AppMain.main(AppMain.java:115)
Caused by: java.lang.NullPointerException
at com.aspose.slides.pptx.SlidesEx.do(Unknown Source)
at com.aspose.slides.pptx.SlidesEx.do(Unknown Source)
at com.aspose.slides.pptx.SlidesEx.insertClone(Unknown Source)
at PPTAssemblyTest.assemblePresentation(PPTAssemblyTest.java:210)
… 7 more


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
During PPT2.pptx slides assembly the processing fails for PPT2_slide_27.pptx with this exception
Caused by: com.aspose.slides.pptx.PptxException: Unknown file format.
at com.aspose.slides.obfuscated.duk.(Unknown Source)
at com.aspose.slides.pptx.PresentationEx.do(Unknown Source)
at com.aspose.slides.pptx.PresentationEx.do(Unknown Source)
at com.aspose.slides.pptx.PresentationEx.(Unknown Source)
at com.aspose.slides.pptx.PresentationEx.(Unknown Source)
at PPTAssemblyTest.assemblePresentation(PPTAssemblyTest.java:142)
… 7 more
Caused by: com.aspose.slides.pptx.PptxException$PptxReadException: Error reading “/ppt/slides/slide1.xml” xml part
at com.aspose.slides.obfuscated.duk.do(Unknown Source)
at com.aspose.slides.obfuscated.duk.do(Unknown Source)
at com.aspose.slides.obfuscated.duk$25.do(Unknown Source)
at com.aspose.slides.obfuscated.bfk.if(Unknown Source)
at com.aspose.slides.obfuscated.bfk.(Unknown Source)
at com.aspose.slides.obfuscated.duk.if(Unknown Source)
… 13 more
Caused by: java.lang.NullPointerException
at com.aspose.slides.obfuscated.dsu.(Unknown Source)
at com.aspose.slides.obfuscated.dtz.if(Unknown Source)
at com.aspose.slides.obfuscated.dtz.do(Unknown Source)
at com.aspose.slides.obfuscated.dvl.goto(Unknown Source)
at com.aspose.slides.obfuscated.duj.goto(Unknown Source)
at com.aspose.slides.obfuscated.duj.goto(Unknown Source)
at com.aspose.slides.obfuscated.dva.goto(Unknown Source)
at com.aspose.slides.obfuscated.duj.goto(Unknown Source)
at com.aspose.slides.obfuscated.duj.goto(Unknown Source)
at com.aspose.slides.obfuscated.dui.a(Unknown Source)
… 19 more

Thanks & Regards,
Vimal

Hi Vimal,


Thanks for inquiring Aspose.Slides.

I have worked with the presentation files shared by you in detail. I have also observed the code snippet shared by you and it seems fine but I am unable to use that owing to missing template file. Also the code snippet for spiting presentation files is not there as well. However, I have develop the complete code on my end for splitting and then re-joining those presentations. For PPT1.pptx, I have not observed any issue with Slide 2 cloning. However, I have observed the cloning issue when recombining the slide 20 and slides 28 to 39. For PPT2.pptx, I have been able to observe the issue on my end with slide 28 as shared by you.

In order to add the issue in our issue tracking system, I would request you to please use the sample code shared by me and observe whether you are having the same issue on your end as I have not been able to observe the issue with Slide 2 of PPT1.pptx. Please also share the working sample code that I may use for splitting and then recombining those presentation along with your template presentation.


For your convenience, I have attached the combined presentations, sample code and output files as well. I will really appreciate your cooperation in terms of providing the requested data and feedback.

Many Thanks,

Hi Mudassir,
Please find the template file attached and also the modified java program to include template while merging ppt files.

During merging both the powerpoint’s PPT1.pptx and PPT2.pptx fail for certain slides.

Thank you for your assistance,
Vimal

Hi Vimal,


I have observed the code snippet shared by you and have been able to observe the issue on my end while recombining the slides using different master. Actually, the issue that I perceive is that when you merge the particular slide in target presentation and apply the master of target presentation on that during cloning process then if the layout used in the slide to be cloned is not available in already existing master slide in target presentation then there will be exception thrown. For further elaboration you can open the template and source PPT files in slide master view and observe the difference in layout slides. I hope you are getting my point here.

I have modified the code snippet for your convenience and this worked on my end. However, there are some formatting issues in merged presentation and that are due to layout slide. When you will use the POTX file with all used layout slides then I am hopeful that the formatting issues will also fades away.

Many Thanks,

Hi Mudassir,
Thank you for your assistance. The code snippet sent by you has produced an output file as compared to before when it used to throw exception. I, however, see certain issues:

  • When I view the master slide in the merged PPT, I can find many blank and duplicate slides. This seems to increase with the number of slides in the PPT. This is an issue for us.

  • When I opened PPT1_Combined.pptx in Office 2010, I get a prompt that the PPT needs to be repaired. If I say cancel then the PPT is not opened. There seems to be some issue with the PPT generated.

  • With PPT2_Combined.pptx I see the following issues:
  1. slide 4,8,20,24, etc: Airal 14 body text converted to Arial 24, resulting in text overflow in slide 24 etc.
  2. Starting slide 10, an oversized page number appears at the bottom. On
    Slide 20 this is printed oddly over the page number footer. Oversized
    body font size is also an issue in PPT1_Combined.pptx
Please let us know if these issues can be addressed.

Thanks & Regards,
Vimal
Hi Vimal,

I have observed the issue shared by you and will answer them one by one.

crunchy74:
When I view the master slide in the merged PPT, I can find many blank and duplicate slides. This seems to increase with the number of slides in the PPT. This is an issue for us.

I have observed the issue as well and I am not sure whether it may be regarded as issue or not. Actually, the layout slides used in presentation to be cloned is not present in target master slide. So, when slide is cloned then in place of missing layout slide the new layout slide is created in slide master. However, I have created an issue with ID SLIDESJAVA-33519 in our issue tracking system so that our development team may further investigate the issue and share their point of view.

crunchy74:
When I opened PPT1_Combined.pptx in Office 2010, I get a prompt that the PPT needs to be repaired. If I say cancel then the PPT is not opened. There seems to be some issue with the PPT generated.

I have been able to reproduce the issue on my end and an issue with ID SLIDESJAVA-33520 has been created in our issue tracking system to further investigate and resolve the issue.

crunchy74:
With PPT2_Combined.pptx I see the following issues:
slide 4,8,20,24, etc: Airal 14 body text converted to Arial 24, resulting in text overflow in slide 24 etc.

I humbly suggest that it does not seem to be an issue. Actually, the target layout slide has Arial font 24 for the text and when master slide changes the text height is also set according to target presentation. I have observed this effect in slides 5 and 24 of merged presentation and have not been able to observe it in other slides. I have also shared the generated presentation for your kind reference.

crunchy74:
Starting slide 10, an oversized page number appears at the bottom. On Slide 20 this is printed oddly over the page number footer. Oversized body font size is also an issue in PPT1_Combined.pptx

I have observed the issue of oversized slide number text in merged presentation for PPT2.pptx. An issue with SLIDESJAVA-33521 has been created in our issue tracking system to further investigate and resolve the issue. However, I need further elaboration from your end for your below comments so that I may investigate it further to help you out.

"Oversized body font size is also an issue in PPT1_Combined.pptx"

We are sorry for your inconvenience,

The issues you have found earlier (filed as SLIDESJAVA-33520) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

The issues you have found earlier (filed as SLIDESJAVA-33521;SLIDESJAVA-33519) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.