|
Rank: Newbie Groups: Member
Joined: 9/20/2011 Posts: 6
|
The following error is now being thrown from the EO.Pdf HtmlToPdf.ConvertUrl method everytime. We are using this in a windows service which runs 24/7 and has been running for about 5 weeks. This error only appeared a few days ago and happens everytime we try a conversion. We are using EO.pdf.dll version 3.0.53.2
Parameter name: hdc ---> System.ArgumentNullException: Value cannot be null. Parameter name: hdc at System.Drawing.Graphics.FromHdc(IntPtr hdc) at EO.Pdf.Internal.el..ctor(BinaryReader A_0, Size A_1) at EO.Pdf.Internal.f4..ctor(BinaryReader A_0) at EO.Pdf.Internal.a6.a(Byte[] A_0, Single A_1, Single A_2, Double A_3, Double A_4) at EO.Pdf.Internal.j1.a(String A_0, Boolean A_1, String A_2) at EO.Pdf.Internal.j1.h() --- End of inner exception stack trace --- at EO.Pdf.HtmlToPdfException.b(Exception A_0) at EO.Pdf.Internal.j1.h() at EO.Pdf.HtmlToPdf.a(j1 A_0)
Thanks in advance for any help.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
The problem indicates that Windows API CreateCompatibleDC(NULL) is failing on your machine. This usually occurs when the process runs out of handle resource. So you may want to restart the service process to see if it fixes the problem.
Thanks
|
|
Rank: Newbie Groups: Member
Joined: 9/20/2011 Posts: 6
|
Hi,
Restarting the service does stop the issue temporarily. I wrote a test application that keeps converting html to pdf and the number of GDI objects in use just keeps increasing. When it hits 10,000 windows stops giving the process any more and an exception is thrown. Is there anyway of release the resources between conversions? Would like to do this cleanly, not by using an extra AppDomain or process.
Just restarting the service every few days is not an option for our customer as it needs to be running 24/7.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
We have reviewed the code and noticed that the code may leak handles in case an exception is thrown. We have changed our code to ensure the handles are always released with a try-finally block and posted a new build. Please see your private message for the download location and let us know if it fixes the problem for you.
There may be other places that we have not found yet. If any similar error occurs again, please post the detailed stack trace and we will look into it again.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 3/19/2012 Posts: 2
|
I hava the same problem. "Convertion failed. Value cannot be null. Parameter name: hdc" I use assembly version 3.0.84.2
Thanks
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Quote:I hava the same problem. "Convertion failed. Value cannot be null. Parameter name: hdc" I use assembly version 3.0.84.2
Thanks Hi, Please always try to update to the latest build from our download page first. Thanks
|
|