Presentation presentation = new Presentation();
Stream stream = new MemoryStream(ssppt);
presentation.LoadFromStream(stream, FileFormat.Pptx2013);
int count = 1;
foreach (ISlide slide in presentation.Slides)
{
byte[] bytes = null;
var img = slide.SaveAsImage();
using (var ms = new MemoryStream())
{
img.Save(ms,ImageFormat.Jpeg);
bytes = ms.ToArray();
}
RCImageItemRecord imageRC = new RCImageItemRecord();
STImageItemStructure imageST = new STImageItemStructure();
imageST.ssImageBinary = bytes;
imageST.ssImageName = "Slide_" + count + ".jpg";
count++;
imageRC.ssSTImageItem = imageST;
imageList.Add(imageRC);
}
Im using the code above to convert slides to images but some images are broken.