Hi Team,
file1 can be anything, you can keep your own pptx of 1 page and test…
Hi Kranthi,
As you are creating a new presentation file as destination file, it adds an empty slide on when empty presentation is created. After adding the slides, you can remove the first slide using destPres.getSlides().removeAt(0);
. Please see the following updated code:
File file1 = new File("C:/Aspose_lib/Pitchbook_TOC.pptx");
FileInputStream input1 = new FileInputStream(file1);
PresentationEx srcPres = new PresentationEx(input1);
PresentationEx destPres = new PresentationEx();
SlideExCollection slds = destPres.getSlides();
for (int i = 0; i <= srcPres.getSlides().getCount() - 1; i++) {
slds.insertClone(destPres.getSlides().getCount(), srcPres.getSlides().get_Item(i));
}
destPres.getSlides().removeAt(0);
destPres.write("c:/Aspose_lib/output.pptx");
input1.close();
System.out.println("End");
Thanks & Regards,
Hi Ahmad,
Hi Kranthi,
Thank you for the feedback.
Please share your input presentation files and output file with us for further investigation of the issue.
Thanks & Regards,
Hi Ahmad,
Hi Kranthi,
You can upload / attach the files using the "Add/Update" button while replying the post (right after the text editor ends). Please check the attached screenshot for reference.
Thanks & Regards,
I could not see ,maybe browser compatability issue, please share your support email id, I will send the pptx through mail
Hi Kranthi,
I am afraid, we don’t accept attachments via email. I would suggest you to try a different browser to upload the
files to the forum. If, in case, that doesn’t work, please upload your files to
some third party file hosting site like dropbox and share the link with us in your
forum thread.
Thanks & Regards,
Hi Team,
Hi Team,
Hi Kranthi,
Well, you need to set the size of the slides for the new presentation as per your source presentation so that content is displayed fine after cloning. Please see the following sample code to get an idea how this can be done.
File file1 = new File("C:\\Data\\PPTX_Files\\PPTX_Files\\input-1.pptx");
FileInputStream input1 = new FileInputStream(file1);
PresentationEx srcPres = new PresentationEx(input1);
PresentationEx destPres = new PresentationEx();
destPres.getSlideSize().setType(SlideSizeTypeEx.Custom);
destPres.getSlideSize().setSize(srcPres.getSlideSize().getSize());
SlideExCollection slds = destPres.getSlides();
for (int i = 0; i <= srcPres.getSlides().getCount() - 1; i++)
{
slds.insertClone(destPres.getSlides().getCount(), srcPres.getSlides().get_Item(i));
}
destPres.getSlides().removeAt(0);
destPres.write("c:/data/output.pptx");
Thanks & Regards,
Thanks Team,
Hi Kranthi,
Thank you for the feedback.
We are pleased to know that your reported issue is resolved. Please feel free to contact support in case you need any further assistance.
Thanks & Regards,