Merge Powerpoint, PDF, PPT or other documents together in C#

High-speed C# library to merge PPT, PPTX, PDF, PNG, JPEG and other formats.

Merge PPT, PPTX, PDF using C#

Aspose.Slides for .NET is a powerful C# library for creating and manipulating presentation files. Moreover, it provides flexible ways to combine multiple PPT/PPTX presentations. When you merge one presentation to another, you are effectively combining their slides in a single presentation to obtain one file. Aspose.Slides allows you merge two presentations in different ways. You get to merge presentations with all their shapes, styles, texts, formatting, comments, animations, etc. without having to worry about loss of quality or data.

Merge PowerPoint presentations in C#

To merge the PowerPoint presentations, you will need to clone the slides from one presentation to the other.

Merge PPTX files using C#


// Instantiate a Presentation object that represents a target presentation file
using (Presentation presentation1 = new Presentation("presentation1.pptx"))
{
    // Instantiate a Presentation object that represents a source presentation file
    using (Presentation presentation2 = new Presentation("presentation2.pptx"))
    {
        foreach (ISlide slide in presentation2.Slides)
        {
            // Merge slides from source to target 
            presentation1.Slides.AddClone(slide);
        }
    }
    // Save the presentation
    presentation1.Save("merged-presentation.pptx", Export.SaveFormat.Pptx);
}

Merge Presentations with Slide Master using C#

This C# code demonstrates how merge several presentations into one and apply styles from slide master presentation template. So, result presentation will keep same source formatting and will contain formatting from master slide of another presentation.

Merge multiple PPT into single in C#


// Instantiate a Presentation object that represents a target presentation file
using (Presentation presentation1 = new Presentation("presentation1.pptx"))
{
    // Instantiate a Presentation object that represents a source presentation file
    using (Presentation presentation2 = new Presentation("presentation2.pptx"))
    {
        // Merge first two slides only using slide master
        presentation1.Slides.AddClone(presentation2.Slides[0], presentation1.Masters[0], true);
        presentation1.Slides.AddClone(presentation2.Slides[1], presentation1.Masters[0], true);
    }
    presentation1.Save("merged-presentation-master.pptx", Export.SaveFormat.Pptx);
}

How to merge Presentations using Aspose.Slides for .NET API

These are the steps to merge two PPTX files and save result as PDF in .NET.

  1. Install Aspose.Slides for .NET .

  2. Add a library reference (import the library) to your C# project.

  3. Open the source PPTX files in C#.

  4. Combine PPTX files using AddClone method.

  5. Save presentation and get result as single PDF file.

Other Supported Formats To Merge

You can also combine other file formats. See other supported formats below.

OTP (OpenDocument Standard Format)
POT (Microsoft PowerPoint Template Files)
POTM (Microsoft PowerPoint Template File)
POTX (Microsoft PowerPoint Template Presentation)
PPS (PowerPoint Slide Show)
PPSM (Macro-enabled Slide Show)
PPSX (PowerPoint Slide Show)
PPT (Microsoft PowerPoint 97-2003)
PPTM (Macro-enabled Presentation File)
PPTX (Open XML presentation Format)