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

Free Support Forum - aspose.com

Error in GetThumbnail() .Net

I'm getting an error 'A generic error occurred in GDI+.' when using GetThumbnail() function.

Dear myliba,

Thanks for considering Aspose.Slides for .NET

I think, this error has been resolved already, please try the latest Aspose.Slides from this link. If the problem still occurs then, please attach the source presentation(s).

I'm getting this error even with the latest download. And i'm getting it with any presentation i try. I'm attaching attach one of them now.

What is the version of .NET Framework on your computer? Please see the system requirements from this link.


That is normal for web application with medium trust level.
System.Drawing.Imaging.Metafile class doesn’t work in such applications
so rendering slides with metafiles will throw exception.

The .Net Framework version used is 2.0.

Is there any solution for this?

As Alexey mentioned, change the trust level of your web application.

Add the following XML in your Web.config

Changing trust level also did not help. The exception is still occuring.

Try running this code as console application and let me know your findings.

Presentation srcPres = new Presentation(@"d:\downloads\demoppt.ppt");
Slide sld = srcPres.GetSlideByPosition(1);

System.Drawing.Image img = sld.GetThumbnail(1.0, 1.0);

Then run it as ASP.net application. Let me know which Visual Studio you are using for development? Please attach the complete project, so I can run it and check here.

Please see this link

<A href="</A></P> <P><EM><FONT color=#0000ff>I finally figured out what was the problem.</FONT></EM></P> <DIV class=ForumPostContentText id=ctl00_ctl01_bcr_ctl00___PostRepeater_ctl05_PostViewWrapper> <P><EM><FONT color=#0000ff>My IIS was running in medium trust level and apparently that caused the problem!!<BR>When I changed it to run in low trust it suddenly worked. The graphs appeared!<BR>Might be good for you to know.</FONT></EM></P> <P><EM><FONT color=#0000ff>Thanks for your help</FONT></EM></P></DIV>

As instructed I tried created a console application and then an ASP .Net application. The code snippet you provided works fine in both. I was able to generate a thumbnail.

But the ASP .Net application I was working on earlier gave the same old exception with that code. The settings of both applications are similar. Seems strange...

I'm using .Net 2.0.

Thank You very much for all the help