We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Split a PPT

Hi Guys, I'm trying to split a multi-slide PPT into multiple files. One file per slide. The result always seems to have two pages.

I've tried removig the 1st slide using slides.remove() but that doesn't seem to work. Does anyone have any ideas here?

License license = new License();
license.SetLicense("Aspose.Slides.lic");

string testFile = @"C:\\temp\Test.ppt";
Presentation pres = new Presentation(testFile);


for (int i = 1; i <= pres.Slides.Count; i++)
{

//Accessing a slide using its slide position
Slide slide = pres.GetSlideByPosition(i);

Presentation zNewPres = new Presentation();
zNewPres.CloneSlide(slide, 0);

//Writing the presentation as a PPT file
zNewPres.Write("C:\\temp\\Slide" + i + ".ppt");

Console.WriteLine(i);

}

Hi Warrick,


The presentation object when instantiated creates a presentation with default single empty slide. Once you are done with cloning, you need to remove the default slide. Please use following statement just before saving the presentation. Please share, if I may help you further in this regard.

pres.Slides.RemoveAt(0);

Many Thanks,