Welcome Guest Search | Active Topics | Sign In | Register

Performance of HtmlToPdf.ConvertHtml Options
christian
Posted: Monday, January 16, 2012 5:37:48 AM
Rank: Newbie
Groups: Member

Joined: 1/15/2012
Posts: 2
Hi EO support,
I have a web service that generates a PDF and sends it by email.
The first call after an inactivity period takes 4-8 seconds to complete. Subsequent calls complete in less than one second. The same code executed in a console application always takes about 4 seconds.
This long and random execution time generates timeouts on the client side and this is not acceptable.
Investigations have shown that the problem comes from HtmlToPdf.ConvertHtml.
Before increasing the timeout value on the client I would like to understand the reason of this random execution time.

Size of the HTML file: 13KB + 1 GIF of 2 KB
Size of the resulting PDF: 163 KB (1 page)
EO.Pdf: eval of the .NET 2011.2 release

To a similar question posted on 9/19/2011 your response was:
"The main reason why the converter takes time is because it will wait for all resources referenced by your HTML to load..."
But in my case it is a simple HTML file that only includes a single small gif located on the same machine (no web server involved).

Do you have any explanations or suggestions on how to improve the situation ?

thanks, Christian
eo_support
Posted: Monday, January 16, 2012 9:06:46 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

This is normal. The reason that it takes longer for the first conversion is because the internal conversion engine is only initialized when you first call it. As soon as you call it once and the engine is fully initialized, you will see the conversion runs much faster. The engine also automatically shutdown under a certain scenarios. For example, it would automatically shut down after being idle for a while to save resource. That's why you see it takes longer after an inactivity period.

If you wish to keep the engine "alive", you can set up a timer with an interval of a few minutes and then perform some very simple conversion such as ConvertHtml("<div></div>"). The converter is fully multi-thread safe so you can do this in a separate thread.

Thanks!
glinkot
Posted: Tuesday, January 17, 2012 10:11:58 PM
Rank: Member
Groups: Member

Joined: 1/11/2012
Posts: 27
Hi,

Would there be any possibility to make this 'auto shutdown' configurable? I have similar scenarios in mind in an intranet application, where a user could click to get a PDF version of a report. However it probably will only happen a few times a day at first so I'm happy for the engine to stay alive using it's resources! It wouldn't be good for it to restart each time, and setting a scheduled job up to call it seems a bit workaroundy :)

Thanks
eo_support
Posted: Wednesday, January 18, 2012 9:18:53 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
glinkot wrote:
Hi,

Would there be any possibility to make this 'auto shutdown' configurable? I have similar scenarios in mind in an intranet application, where a user could click to get a PDF version of a report. However it probably will only happen a few times a day at first so I'm happy for the engine to stay alive using it's resources! It wouldn't be good for it to restart each time, and setting a scheduled job up to call it seems a bit workaroundy :)

Thanks


That's an interesting point. We will certainly think about it and see if we can put it in.

Thanks
Laznik
Posted: Monday, June 11, 2012 5:26:53 AM
Rank: Newbie
Groups: Member

Joined: 3/19/2012
Posts: 2
Hi,

I have the same problem. Is there any progress with 'auto shutdown' configuration?

Thanks
eo_support
Posted: Monday, June 11, 2012 8:57:26 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

This was not implemented in the current version. We are still not sure on whether adding this configuration option as it could open the door for a row of other configuration options: time threshold, task threshold, memory threshold, etc. As a result, none of these options was added.

Thanks!
digio applications
Posted: Monday, June 25, 2012 6:36:16 AM
Rank: Member
Groups: Member

Joined: 6/19/2012
Posts: 11
A simple timeout configuration would be nice for a future version. At the moment I think a process is kept for 20 minutes before it is killed. We have a configuration that we run a conversion once per 24 hours, so if we could set the timeout to a shorter time (to free up resources quicker) would be a nice option.
Ibiuna
Posted: Thursday, June 28, 2012 7:21:50 PM
Rank: Advanced Member
Groups: Member

Joined: 8/31/2011
Posts: 34
@digio applications
Or later. Resources are not the problem for me, but performance is. So, in my case, I would set up the time to live of the object to as long as possible.

@eo_support
Can you please let us know when you decide if this will be implemented ?

Thanks
Phil
Posted: Thursday, June 28, 2012 8:40:21 PM
Rank: Newbie
Groups: Member

Joined: 6/12/2012
Posts: 2
@eo_support

I too would like the option for the engine not to be shutdown once initialized.


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.