Merge PPTX Files using C++

Use Aspose.Slides for C++ to merge PPTX files with server-side C++ APIs.

Merge PPTX Files Using C++

To merge PPTX files, use Aspose.Slides for C++ , a C++ API for working with presentation files. Install the latest package from NuGet or use the Package Manager Console command below.

Command

PM> Install-Package Aspose.Slides.Cpp

Merge PPTX Files - C++

auto destinationPresentation = MakeObject<Presentation>(u"first.pptx");
auto sourcePresentation = MakeObject<Presentation>(u"second.pptx");

for (auto&& slide : sourcePresentation->get_Slides())
{
    destinationPresentation->get_Slides()->AddClone(slide);
}

destinationPresentation->Save(u"merged.pptx", SaveFormat::Pptx);
sourcePresentation->Dispose();
destinationPresentation->Dispose();

Steps for Merging PPTX Files in C++

Merge PPTX files with Aspose.Slides for C++ by cloning slides from one presentation into another.

  1. Load the destination and source PPTX files with the Presentation class.
  2. Iterate through the source slides with get_Slides.
  3. Add each slide to the destination presentation with AddClone.
  4. Save the merged file with SaveFormat::Pptx.

System Requirements

Aspose.Slides for C++ is supported on all major platforms and operating systems. Please make sure that you have the following prerequisites.

  • Microsoft Windows, Linux, macOS, or another compatible OS with the supported C++ runtime.
  • Aspose.Slides for C++ library referenced in your project.

Built with Aspose.Slides

Merge PPTX Files Online

The free Aspose.Slides Merger app is built with Aspose.Slides for C++, the same API as the code above. Open it and see what the API can do with your own PPTX files.

  • Runs in your browser, nothing to install.
  • See how Aspose.Slides merges files before you write code.
  • Upload several PPTX files and combine them into one.
  • Download the merged result as one file.

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 More