Free Support Forum - aspose.cloud

How to Merge two PowerPoint Presentations with Apose.Slides API

Hello Aspose Team,


is there a way to use Aspose Slides locally on the server for simple merging
of presentation pages of two different PPTX files without having to
subscribe to the Aspose Cloud API service? We don’t want to do fancy things
with our presentations, just merging their pages into one, new presentation.

And for evaluation we would need a demo site where we could merge two rather
complex presentations we use for testing different solutions. Is there something
like this already existing for short tests, just to see the outcome in Aspose Slides?

Thank you and best regards,
Sebastian Schulz

Hi Sebastian,


Thank you for your interest in Aspose.Slides.

I have observed your comments and like to share with you that presentations could be merged by cloning the slides. Below is the code to merge two presentations. For more details about slide cloning, please visit this documentation link for your kind reference.

public static Presentation MergePresentation(Presentation originalPres, Presentation presToBeAdded)
{
try
{
ISlideCollection slidesColl = presToBeAdded.getSlides();
if (slidesColl.size() > 0)
{
for (ISlide objSld : slidesColl)
{
originalPres.getSlides().addClone(objSld);
}
}
}
catch (Exception ex)
{

}
return originalPres;
}


Presentation source = new Presentation(“D:\File1.pptx”);
Presentation dest = new Presentation(“D:\File2.pptx”);
Presentation result = new Presentation();
result = MergePresentation(source, dest);
result.save(“D:\Result.pptx” , SaveFormat.Pptx);

About your query regarding demo site, there is no such service offered by Aspose. You have to execute this code on your end to serve the purpose.

I hope this will be helpful. Please share if I may help you further i this regard.

Best Regards,
Hello Mr. Ahmad,

thank you very much, the merge ran perfectly with your provided code example and had the desired outcome in our evaluation.

Best regards,
Sebastian Schulz

Hi Sebastian,


Thank you for your valuable feedback.

We are glad to know that, things have started working on your end.

Please feel free to contact us if we could be of any help to you.

Best Regards,

Moved here: https://forum.aspose.com/t/merging-slides-locally/12751