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

Free Support Forum - aspose.com

Generic error occurred in GDI+


I’m getting error when rendering worksheet as image for some files. One of them is attached to this message.

My code is something like that :

Aspose.Cells.Rendering.ImageOrPrintOptions imgOptions = new Aspose.Cells.Rendering.ImageOrPrintOptions();
imgOptions.ImageFormat = System.Drawing.Imaging.ImageFormat.Jpeg;
imgOptions.OnePagePerSheet = true;
Aspose.Cells.Worksheet sheet = doc.Worksheets[0];
Aspose.Cells.Rendering.SheetRender sr = new Aspose.Cells.Rendering.SheetRender(sheet, imgOptions);

System.Drawing.Bitmap bitmap = sr.ToImage(0);

Thank you,


Thanks for your posting and using Aspose.Cells.

Please download and use the latest version: Aspose.Cells for .NET (Latest Version) it works fine and does not throw any exception.