I came accros a StackOverflowException with the ISlide.SaveAsImage() method, using the attached PPTX file.
It contains one slide, with a converging radial diagram of 5 elements.
The C# code used to convert it is :
- Code: Select all
string inputFilePath = "test.pptx";
string outputDirPath = "thumbs";
using (SpirePres.Presentation presentation = new SpirePres.Presentation())
{
presentation.LoadFromFile(inputFilePath);
string fileName;
for (int i = 0; i < presentation.Slides.Count; i++)
{
fileName = "thumbnail_" + i + ".jpg";
using (Image img = presentation.Slides[i].SaveAsImage())
{
img.Save(Path.Combine(outputDirPath, fileName), System.Drawing.Imaging.ImageFormat.Jpeg);
}
}
}
If the diagram only contains the root element, no exception is thrown.