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

Free Support Forum - aspose.com

Merge more than one presentation files

Hi,


I am new to Aspose Slides and i have one issue. From my application i am createing one PPT file and save on file server. format will be fine for that. Now i want to merge more than one PPTX files in one presentation but while i do that format is massed.

Find attachment for the issue.


Hi Jonathan,


Thank you for your interest in Aspose.Slides.

I have observed your comments and like to request you to please try using following sample code on your end to serve the purpose. You were observing the problem because of different slide size. I have made necessary changes to the code and also I have attached the generated presentation “Result.pptx” for your kind reference.

public static Presentation MergePresentation(Presentation originalPres, Presentation presToBeAdded)
{
try
{
ISlideCollection slidesColl = presToBeAdded.Slides;
if (slidesColl.Count > 0)
{
foreach (ISlide objSld in slidesColl)
{
originalPres.SlideSize.Type = presToBeAdded.SlideSize.Type;
originalPres.SlideSize.Size = presToBeAdded.SlideSize.Size;
originalPres.Slides.AddClone(objSld);
}
}
}
catch (Exception ex)
{

}
return originalPres;
}


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

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

Best Regards,

Thanks Adnan, It works…

Hi Jonathan,


Thank you for your kind feedback.

We are glad to know that your problem is resolved and things have started working on your end. Please feel free to contact us if we could be of any help to you.

Best Regards,