We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Intermitten Overflow Exception thrown By PdfGraphics.DrawImage

Hello,


I get an Overflow Exception that occurs intermittently when calling PdfGraphics.DrawImage(). It seems to occur roughly 10% of the time. The call stack is below. Any help resolving this problem would truly be appreciated. Thanks.

Call Stack:

System.OverflowException: Arithmetic operation resulted in an overflow.
at Syncfusion.Pdf.Graphics.PdfBitmap.SaveAsRawImage()
at Syncfusion.Pdf.Graphics.PdfBitmap.SaveImageByFormat()
at Syncfusion.Pdf.Graphics.PdfBitmap.Save()
at Syncfusion.Pdf.Graphics.PdfBitmap.SetMask()
at Syncfusion.Pdf.Graphics.PdfBitmap.Save()
at Syncfusion.Pdf.Graphics.PdfGraphics.DrawImage(PdfImage image, Single x, Single y, Single width, Single height)
at Syncfusion.Pdf.Graphics.PdfGraphics.DrawImage(PdfImage image, PointF point, SizeF size)



SyncFusion Product version is 8.303.0.21


7 Replies

GM Geetha M Syncfusion Team June 13, 2011 08:38 AM UTC

Hi Jim,

Thank you for your interest in Syncfusion products.

I am afraid that I am not able to reproduce the problem. I have placed the test sample in the following link:
ImageInsertion-548317770.zip

Could you please modify it and send back to me?

Regards,
Geetha



SL Søren Løfvall August 28, 2013 10:45 AM UTC

I'm seeing the error. I have made this small test program:
RectangleF headerRect = new RectangleF(0, 0, 48, 48);
PdfPageTemplateElement header = new PdfPageTemplateElement(headerRect);
header.Graphics.DrawImage(PdfImage.FromFile(@"Icon.png"), PointF.Empty);

When I run this I get the Overflow Exception with this call stack:
at System.IntPtr.ToInt32()
at Syncfusion.Pdf.Graphics.PdfBitmap.SaveAsRawImage()
at Syncfusion.Pdf.Graphics.PdfBitmap.SaveImage(PdfArray filters)
at Syncfusion.Pdf.Graphics.PdfBitmap.SaveImageByFormat()
at Syncfusion.Pdf.Graphics.PdfBitmap.Save()
at Syncfusion.Pdf.Graphics.PdfBitmap.SetMask()
at Syncfusion.Pdf.Graphics.PdfBitmap.Save()
at Syncfusion.Pdf.Graphics.PdfGraphics.DrawImage(PdfImage image, Single x, Single y, Single width, Single height)
at Syncfusion.Pdf.Graphics.PdfGraphics.DrawImage(PdfImage image, Single x, Single y)
at Syncfusion.Pdf.Graphics.PdfGraphics.DrawImage(PdfImage image, PointF point)
at ImageInsertion.Form1.button1_Click(Object sender, EventArgs e)

My guess is that this has to do with the fact that I'm running 64bit.

P.S. I using version 9.3


PH Praveenkumar H Syncfusion Team September 2, 2013 03:55 AM UTC

Hi Soren,

Thank you for your interest in Syncfusion products.

Could you please report this issue through Direct Trac Developer Support System (https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents because you can take the advantage of the expertise of a dedicated support engineer and a guaranteed response time and we hope you will take advantage of this system as well. If you have already reported, please ignore this.

Regards,
Praveen



DN Dmitry Nogin November 28, 2013 09:16 PM UTC

Hello,
Does anybody know if this issue has been resolved? We are experiencing it after upgrading to Windows Server 2012.

Thank you.


PH Praveenkumar H Syncfusion Team December 5, 2013 09:31 AM UTC

Hi Dmitry,

 

Thank you for using syncfusion product.

 

The above reported issue has been fixed in our latest essential studio version 11.3.0.30.

Please provide us your essential studio version detail and simplified sample which reproduces the issue,it will help us to investigate further in this issue.

 

Please let me know if you need further assistance.

 

With Regards,

Praveen

 



CN Cuong Nguyen June 30, 2015 04:14 AM UTC

Hi Syncfusion Team.

Currently, I also got the same problem when I call PdfGraphics.DrawImage, the system will throw the OverflowException. This problem only happen when I run in the production server, it not happen when I run in debug mode with Visual Studio 2013.

So, please help me verify this problem and show me how to fix them.

Thanks.



PH Praveenkumar H Syncfusion Team July 1, 2015 04:43 AM UTC

Hi Cuong,

Thank you for your interest in Syncfusion products.

Could you please report this issue through Direct Trac Developer Support System (https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents because you can take the advantage of the expertise of a dedicated support engineer and a guaranteed response time and we hope you will take advantage of this system as well. If you have already reported, please ignore this.

Regards,
Praveen


Loader.
Live Chat Icon For mobile
Up arrow icon