Merge PPTX Files in C#
Combine PPTX documents with server-side Aspose.Slides for .NET APIs.
Merge PPTX File Using C#
To merge PPTX files, use Aspose.Slides for .NET , a C# API for creating, converting, and combining presentation documents. Install the package from NuGet or run the following command in the Package Manager Console.
Command
PM> Install-Package Aspose.Slides.NET
Merge PPTX Files - C#
using var firstPresentation = new Presentation("first.pptx");
using var secondPresentation = new Presentation("second.pptx");
using var mergedPresentation = new Presentation();
mergedPresentation.Slides.RemoveAt(0);
foreach (var slide in firstPresentation.Slides)
{
mergedPresentation.Slides.AddClone(slide);
}
foreach (var slide in secondPresentation.Slides)
{
mergedPresentation.Slides.AddClone(slide);
}
mergedPresentation.Save("merged.pptx", SaveFormat.Pptx);
Steps for Merging PPTX Files in C#
Merge PPTX files with Aspose.Slides for .NET in a few lines of C# code.
Load the source PPTX files with
Presentation.Create a destination
Presentationobject.Add slides from each source file with
Slides.AddClone.Save the merged presentation with
SaveFormat.Pptx.Open the merged PPTX file in a compatible program.
System Requirements
Aspose.Slides for .NET is supported on major platforms and operating systems. Before running the code below, make sure that your system meets the following requirements.
- A supported operating system with .NET or Mono installed.
- Development environment like Microsoft Visual Studio
- Aspose.Slides for .NET DLL referenced in your project - Install from NuGet using the Download button above
Merge PPTX Files Online
Combine files online with Aspose.Slides Merger.
About Aspose.Slides for .NET API
The Aspose.Slides API can read, write, manipulate, and convert Microsoft PowerPoint presentations to PDF, XPS, HTML, TIFF, ODP, and other supported formats. You can create presentations from scratch and save them in a supported output format. Aspose.Slides is a standalone API for creating, parsing, and manipulating presentations, slides, and their elements; it does not require Microsoft PowerPoint or OpenOffice.Online PPTX Merger Live Demos
PPTX What is PPTX File Format?
Files with the `.PPTX` extension use the PowerPoint Open XML Presentation format introduced with PowerPoint 2007. Unlike the older binary PPT format, PPTX stores presentation data in an Office Open XML package. A PPTX file contains a collection of slides that can include text, images, formatting, animations, and other media, along with presentation settings.
Read MoreOther Supported Merging Formats
You can also merge many other file formats in C#.