Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
using Syncfusion.Presentation;

//Opens the source PPTX document.
IPresentation sourcePptx = Presentation.Open(Path.GetFullPath(@"Data/Template.pptx"));
IPresentation sourcePptx = Presentation.Open(Path.GetFullPath(@"Data/Template.pptx"));

//Iterates through each section.
foreach (ISection section in sourcePptx.Sections)
foreach (ISection section in sourcePptx.Sections)
{
//Creates a destination PPTX document. Existing presentations can also be used here.
IPresentation destinationPptx = Presentation.Create();
// Clone the slides from the section and move to new PPTX document.
foreach (ISlide slide in section.Slides)
{
destinationPptx.Slides.Add(slide.Clone(), PasteOptions.SourceFormatting, sourcePptx);
}
//Saves the destination PPTX document.
string outputPath = Path.Combine(Path.GetFullPath("Output"), section.Name + "_Slides.pptx");
destinationPptx.Save(outputPath);
destinationPptx.Close();
}
//Creates a destination PPTX document. Existing presentations can also be used here.
IPresentation destinationPptx = Presentation.Create();
// Clone the slides from the section and move to new PPTX document.
foreach (ISlide slide in section.Slides)
{
destinationPptx.Slides.Add(slide.Clone(), PasteOptions.SourceFormatting, sourcePptx);
}
//Saves the destination PPTX document.
string outputPath = Path.Combine(Path.GetFullPath("Output"), section.Name + "_Slides.pptx");
destinationPptx.Save(outputPath);
destinationPptx.Close();
}
//Closes the PPTX document.
sourcePptx.Close();
sourcePptx.Close();
Loading