GetThumbnail does not render graphs

The GetThumbnail method does not render graph objects within a slide. I suppose this accounts for any type of embedded object.

Do you plan to fix this? In that case, when? To me it's rather urgent...

Dear Piano,

Thanks for considering Aspose.Slides.

Please download the latest version of Aspose.Slides 2.7.5.0, because this problem does not appear with it. Please see the attached image.

Below is the C# code used by me.

Presentation srcPres = new Presentation(@"d:\downloads\Test.ppt");
Slide srcSld = srcPres.GetSlideByPosition(1);
srcSld.GetThumbnail(1.0, 1.0).Save("c:\\outImg.jpg");

Hi,

It does not work in my application.

I use the same type of code as you suggest. Here's a snippet:

Presentation pres = new Presentation(Server.MapPath(pptPath + fname));
ArrayList slides = GetOrderedSlides(pres);
for (int i=0; i < slides.Count; i++) {
String currurl = thumbPath + name + "/" + i + "_" + size + ".jpg";
System.Drawing.Image thumb = ((Slide)slides[i]).GetThumbnail(size,size);
thumb.Save(Server.MapPath(currurl));
}

I've also copied your code exactly and it still does not work.

I'm using the latest version Aspose.Slides 2.7.5.0

The slide contains a pie chart within a circle and in the thumbnail only the circle appears. I've attached a generated thumbnail. The circle remains empty also for a thumbnail with size 1.0, 1.0.

If it works for you, what can be the difference between your setup and mine?

Please check this asp.net application attached by me namely Website1.zip works for you.

Actually it works for me and successfully generates the thumbnail image in thumbnails directory.

The only modification made by me in your code is that I do not retrieve the slide reference from array; I use Presentation.GetSlideByPosition method for it.

Please let me know your findings and your version of .NET framework.

string pptPath = Server.MapPath("Test.ppt");
string thumbPath = "thumbnails";

Presentation pres = new Presentation(pptPath);

for (int i = 1; i <= pres.Slides.LastSlidePosition; i++)
{
    String currurl = thumbPath + "/" + i + "_.jpg";
    Slide sld = pres.GetSlideByPosition(i);
    System.Drawing.Image thumb = sld.GetThumbnail(1.0, 1.0);

    thumb.Save(Server.MapPath(currurl));
}

I finally figured out what was the problem.

My IIS was running in medium trust level and apparently that caused the problem!!
When I changed it to run in low trust it suddenly worked. The graphs appeared!
Might be good for you to know.

Thanks for your help

Hello Piano,

Yes, that is known problem of System.Drawing.Imaging.Metafile class.
It doesn’t work properly in the medium trust level.

Dear Piano and Alexey,

Thanks for sharing this useful information.