- Code: Select all
using (var gpStream = Utils.GenerateGpReport(connStr, dvrDate))
using (var stStream = Utils.GenerateStReport(connStr, dvrDate))
using (var riskPdfStream = GetRiskPdfForDate(config.RiskEmailUserName, config.RiskEmailPassword, config.RiskEmailAddress, riskDate))
using (var gpPdfStream = new MemoryStream())
using (var stPdfStream = new MemoryStream())
using (Workbook gpWorkbook = new Workbook())
using (Workbook stWorkbook = new Workbook())
{
gpWorkbook.LoadFromStream(gpStream);
log.Info("GP workbook loaded");
gpWorkbook.SaveToStream(gpPdfStream, FileFormat.PDF);
stWorkbook.LoadFromStream(stStream);
log.Debug("ST workbook loaded");
stWorkbook.SaveToStream(stPdfStream, FileFormat.PDF);
I get this GDI error message randomly. I know there is probably something that causes it to happen in a rational basis but as of yet I can't determine what causes it to happen and can't repeat the problem in any predictable manner. I get the following error when it crashes
Exception: System.Runtime.InteropServices.ExternalException (0x80004005): A generic error occurred in GDI+.
at System.Drawing.Image.Save(Stream stream, ImageCodecInfo encoder, EncoderParameters encoderParams)
at spr350.0()
at Spire.Xls.Core.Spreadsheet.XlsWorkbookShapeData.AddPicture(Image image, ImageFormatType imageFormat, String strPictureName)
at Spire.Xls.Core.Spreadsheet.Shapes.XlsBitmapShape.set_Picture(Image value)
at spr4315.0(XmlReader A_0, XlsBitmapShape A_1, RelationsCollection A_2, String A_3, spr262 A_4, List`1 A_5, Dictionary`2 A_6)
at spr4315.1(XmlReader A_0, XlsBitmapShape A_1, RelationsCollection A_2, String A_3, spr262 A_4, List`1 A_5, Dictionary`2 A_6)
at spr4315.0(XmlReader A_0, XlsWorksheetBase A_1, String A_2, List`1 A_3, Dictionary`2 A_4)
at spr4315.1(XmlReader A_0, XlsWorksheetBase A_1, String A_2, List`1 A_3, Dictionary`2 A_4)
at spr4315.4(XmlReader A_0, XlsWorksheetBase A_1, String A_2, List`1 A_3, Dictionary`2 A_4)
at spr511.0(XlsWorksheetBase A_0, spr5002 A_1, Dictionary`2 A_2)
at spr511.0(XlsWorksheetBase A_0, String A_1, Dictionary`2 A_2)
at spr4315.0(XmlReader A_0, XlsWorksheet A_1, Dictionary`2 A_2)
at spr4315.0(XmlReader A_0, XlsWorksheet A_1, MemoryStream& A_2, String A_3, Dictionary`2 A_4)
at spr511.1(XlsWorksheet A_0, Dictionary`2 A_1)
at Spire.Xls.Core.Spreadsheet.XlsWorksheet.ParseData(Dictionary`2 dictUpdatedSSTIndexes)
at spr4315.0(Dictionary`2 A_0)
at spr262.0(List`1& A_0)
at spr262.1(List`1& A_0)
at spr846.0(Object A_0, Stream A_1, ExcelVersion A_2, ExcelParseOptions A_3)
at spr995.0(Stream A_0, ExcelVersion A_1, ExcelParseOptions A_2)
at Spire.Xls.Workbook.LoadFromStream(Stream stream)
at Crestwood.Dvr.Integrations.DvrIntegration.Run(String configurationFilePath, String archivePath, ILog log, String database)
at Crestwood.Dvr.WebService.Controllers.IntegrationsController.Post(String database, String integration)
I believe I am using version 7.9.0.55040
Thanks for all your help