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

Free Support Forum - aspose.com

Why in the world would this code be corrupting my pres?

Thanks in advance for the help.


I have a code snippet, which by all accounts should NOT be affecting a presentation (after all, there is no code actually doing anything). Any help sincerely appreciated:

PresentationEx pres = new PresentationEx(FileName);

ChartEx chart = null;

foreach (SlideEx slide in pres.Slides)
{
foreach (ShapeEx shape in slide.Shapes)
{
chart = shape as ChartEx;
if (chart != null)
{
//this Line is causing the corruption
foreach (Aspose.Slides.Pptx.Charts.ChartSeriesEx series in chart.ChartData.Series)
{
//do absolutely nothing
}
}
}
}

attached is the .pptx file I am using for input.

Forgive my noob ness. I am a developer and am just now delving into Aspose.Slides (which thus far has been great).

Cheers.

Hi Scott,

Thank you for sharing the sample code and template file.

I have tested the issue with the latest version of Aspose.Slides for .NET v14.7.0 and I am not able to reproduce any issue. I would suggest you to download and try the latest version and see if you still face the issue.

I am using the following code to test the issue with the latest version.

Presentation pres = new Presentation(“d:\data\Sample.pptx”);

IChart chart = null;

foreach (ISlide slide in pres.Slides)
{
foreach (IShape shape in slide.Shapes)
{
chart = shape as IChart;
if (chart != null)
{
//this Line is causing the corruption
foreach (ChartSeries series in chart.ChartData.Series)
{
//do absolutely nothing
}
}
}
}
pres.Save(“d:\data\sample2.pptx”, Aspose.Slides.Export.SaveFormat.Pptx);

Thanks & Regards,