There might be scenarios where you need to split PowerPoint presentations into multiple files. For example, your presentation may have various sections, and you want each section to be in a separate file. To that end, this article will teach you how to split PowerPoint PPTX/PPT presentations using C++.
C++ API for Splitting PowerPoint Presentations
Aspose.Slides for C++ is a powerful and feature-rich API that allows you to create, read and modify PowerPoint files without requiring Microsoft PowerPoint to be installed. Furthermore, the API supports splitting PowerPoint presentations. You can either install the API through NuGet or download it directly from the Downloads section.
PM> Install-Package Aspose.Slides.Cpp
Split a PowerPoint Presentation using C++
The following are the steps to split a PowerPoint presentation using C++.
- Load the PowerPoint file using the Presentation class.
- Iterate through the slides of the presentation.
- Within the loop, create an instance of the Presentation class to represent a new PowerPoint file.
- Remove the default slide.
- Add the slide using the Presentation->get_Slides()->AddClone(System::SharedPtr<ISlide> sourceSlide) method.
- Save the presentation using the Presentation->Save(System::String fname, Export::SaveFormat format) method.
The following sample code shows how to split a PowerPoint presentation using C++.
Get a Free License
In order to try the API without evaluation limitations, you can request a free temporary license.
In this article, you have learned how to split PowerPoint presentations using C++. The shared code snippet shows how to split PowerPoint files with just a few lines of code. Aspose.Slides for C++ API provides a bunch of additional features for working with PowerPoint files. You can explore the API in detail by visiting the official documentation. In case of any queries, please feel free to reach us at our free support forum.