You can find detailed information at: Split PowerPoint Presentations using C++
Last active
September 22, 2021 14:15
-
-
Save aspose-com-gists/77104b44d5371e3944d2f7d2e9b3a6de to your computer and use it in GitHub Desktop.
Split PowerPoint Presentations using C++
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Source file path | |
const String sourceFilePath = u"SourceDirectory\\Slides\\SamplePresentation.pptx"; | |
// Load the presentation file | |
auto presentation = System::MakeObject<Presentation>(sourceFilePath); | |
// Loop through the slides | |
for (SharedPtr<ISlide> slide : presentation->get_Slides()) | |
{ | |
// Create an instance of the Presentation class | |
auto newPresentation = System::MakeObject<Presentation>(); | |
// Remove the default slide | |
newPresentation->get_Slides()->idx_get(0)->Remove(); | |
// Add the slide to presentation | |
newPresentation->get_Slides()->AddClone(slide); | |
// Save the presentation | |
newPresentation->Save(String::Format(u"OutputDirectory\\SplitPresentation_out_{0}.pptx", slide->get_SlideNumber()), SaveFormat::Pptx); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment