The Syncfusion .NET PowerPoint Library lets you merge or combine multiple PowerPoint presentations into a single presentation with just a few lines of C# code, without Microsoft PowerPoint. It also allows you to merge specific slides from one presentation to another.
This example code shows how to merge all slides from two presentations by using the Syncfusion .NET PowerPoint Library with just a few lines of C#.
using Syncfusion.Presentation;
//Open an existing source presentation
using FileStream sourceStream = new FileStream("SourcePresentation.pptx", FileMode.Open);
using IPresentation sourcePresentation = Presentation.Open(sourceStream);
//Open an existing destination presentation
using FileStream destinationStream = new FileStream("DestinationPresentation.pptx", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
using IPresentation destinationPresentation = Presentation.Open(destinationStream);
//Iterate each slide in the source and merge it into a presentation
for (int i = 0; i < sourcePresentation.Slides.Count; i++)
{
//Clone the slide of the source presentation
ISlide clonedSlide = sourcePresentation.Slides[i].Clone();
//Merge the cloned slide into the destination presentation
destinationPresentation.Slides.Add(clonedSlide, PasteOptions.UseDestinationTheme, sourcePresentation);
}
//Save the PowerPoint presentation
using FileStream outputStream = new FileStream("Result.pptx", FileMode.Create);
destinationPresentation.Save(outputStream);
Quickly and easily merge multiple presentations into a single file.
Clone specific slides from one presentation and merge them into another.
Exert complete control over themes when merging presentations. Choose between applying the destination presentation’s style or retaining the source presentation’s design.
Explore these resources for comprehensive guides, knowledge base articles, insightful blogs, and ebooks.
Product Updates
Technical Support
The .NET PowerPoint Library supports merging PPTX, PPTM, POTX, and POTM formats only.
Yes, you can merge specific slides from multiple PowerPoint presentations into a single presentation.
Yes, the .NET PowerPoint Library supports merging password-protected PowerPoint presentations.
Yes, you can automate the merging of a batch of PowerPoint presentations with C# by using the .NET PowerPoint Library.
Yes, with the .NET PowerPoint Library you can set options on whether to use source or destination themes while merging presentations.
You can access the feature through the Syncfusion.Presentation.Net.Core NuGet package. Detailed code samples and a video tutorial are available in the documentation to help.
Greatness—it’s one thing to say you have it, but it means more when others recognize it. Syncfusion® is proud to hold the following industry awards.