Welcome Guest Search | Active Topics | Sign In | Register

Parameter name: hdc ---> System.ArgumentNullException: Value cannot be null. Options
David1981
Posted: Monday, November 28, 2011 9:21:30 AM
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.


eo_support
Posted: Monday, November 28, 2011 12:02:53 PM
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
David1981
Posted: Wednesday, November 30, 2011 4:38:37 AM
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.
eo_support
Posted: Wednesday, November 30, 2011 3:36:44 PM
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!
Laznik
Posted: Monday, March 19, 2012 8:18:43 AM
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
eo_support
Posted: Monday, March 19, 2012 11:29:53 AM
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


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.