Hi,
we are currently converting a number og Excel workbooks into Tiff files. Some of these workbooks result in a GDI+ errors.
We only get the error whrn running the con version on Windows Server 2003 or Windows XP. Never on Windows 7 or Windows Server 2008.
We are using Cells 5.3.3.0.
This is the error:
Framework Version: v4.0.30319<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Exception Info: System.AccessViolationException
Stack:
at System.Drawing.SafeNativeMethods+Gdip.GdipSaveImageToStream(System.Runtime.InteropServices.HandleRef, IStream, System.Guid ByRef, System.Runtime.InteropServices.HandleRef)
at System.Drawing.Image.Save(System.IO.Stream, System.Drawing.Imaging.ImageCodecInfo, System.Drawing.Imaging.EncoderParameters)
at 䌷.䪣.䪴(System.IO.Stream, Aspose.Cells.Rendering.ImageOrPrintOptions)
at Aspose.Cells.Rendering.WorkbookRender.ToImage(System.String)
Here's the code we're using:
Aspose.Cells.Workbook doc = new Workbook(fileName);
Aspose.Cells.Rendering.ImageOrPrintOptions tiffoptions = new Aspose.Cells.Rendering.ImageOrPrintOptions();
tiffoptions.ImageFormat = System.Drawing.Imaging.ImageFormat.Tiff;
tiffoptions.TiffCompression = Aspose.Cells.Rendering.TiffCompression.CompressionLZW;
tiffoptions.HorizontalResolution = 200;
tiffoptions.VerticalResolution = 200;
Aspose.Cells.Rendering.WorkbookRender tiffRender = new Aspose.Cells.Rendering.WorkbookRender(doc, tiffoptions);
tiffRender.ToImage(outputFilename);
I have attached one of the workbooks that throws the GDI+ error.
Regards
Thomas