Welcome Guest Search | Active Topics | Sign In | Register

EO.Pdf MaxLoadWaitTime and TriggerMode Options
Ryan
Posted: Tuesday, May 6, 2014 11:45:07 AM
Rank: Member
Groups: Member

Joined: 3/25/2014
Posts: 11
I'm using HtmlToPdf.ConvertUrl from our asp.net mvc controller, and specifying HtmlToPdf.Options.TriggerMode = HtmlToPdfTriggerMode.Dual

I assumed this meant the page load could take as long as it wanted, since we're triggering pdf generation by calling eopdf.convert() on the javascript side.

However, we are seeing the exception below. Do we need to set HtmlToPdf.Options.MaxLoadWaitTime even when using trigger mode dual?

Thanks


1) Exception Information
*********************************************
Exception Type: System.Exception
The operation has timed out.

StackTrace Information
*********************************************
at EO.Pdf.Internal.lt.a(a A_0)
at EO.Pdf.HtmlToPdfSession.a(a A_0)
at EO.Pdf.HtmlToPdfSession.a(j1 A_0, String A_1, String A_2, Int32 A_3, Int32 A_4, Boolean A_5)
at EO.Pdf.HtmlToPdf.ConvertUrl(String url, PdfDocument doc, HtmlToPdfOptions options)
at EO.Pdf.HtmlToPdf.ConvertUrl(String url, Stream stream, HtmlToPdfOptions options)
at Axiom.Web.Controllers.FormsController.GeneratePdf()
at Axiom.Web.Controllers.FormsController.ViewForm(String docref, String arg, String shortcut, String diag, String jsvalues, Nullable`1 onDemandFilegroupId, Nullable`1 isMhtRefresh)
at lambda_method(Closure , ControllerBase , Object[] )
at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters)
at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12()
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass15.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14()
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)System.Exception: The operation has timed out.
at EO.Pdf.Internal.lt.a(a A_0)
at EO.Pdf.HtmlToPdfSession.a(a A_0)
at EO.Pdf.HtmlToPdfSession.a(j1 A_0, String A_1, String A_2, Int32 A_3, Int32 A_4, Boolean A_5)
at EO.Pdf.HtmlToPdf.ConvertUrl(String url, PdfDocument doc, HtmlToPdfOptions options)
at EO.Pdf.HtmlToPdf.ConvertUrl(String url, Stream stream, HtmlToPdfOptions options)
at Axiom.Web.Controllers.FormsController.GeneratePdf()
at Axiom.Web.Controllers.FormsController.ViewForm(String docref, String arg, String shortcut, String diag, String jsvalues, Nullable`1 onDemandFilegroupId, Nullable`1 isMhtRefresh)
eo_support
Posted: Tuesday, May 6, 2014 11:50:28 AM
Rank: Administration
Groups: Administration

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

This usually means for some reason you did not call the manual trigger. In dual mode you must explicitly call eopdf.convert() from your JavaScript in order for the conversion to start.

Thanks!
Ryan
Posted: Tuesday, May 6, 2014 11:56:52 AM
Rank: Member
Groups: Member

Joined: 3/25/2014
Posts: 11
Ok. So there should be no timeout in Dual mode, unless our javascript isn't calling eopdf.convert() for some reason?
eo_support
Posted: Tuesday, May 6, 2014 12:07:47 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
You can still get the "regular" time out error if you are converting a huge page. However in dual mode if you do not call eopdf.convert() you will definitely get a time out error.
Ryan
Posted: Tuesday, May 6, 2014 12:29:41 PM
Rank: Member
Groups: Member

Joined: 3/25/2014
Posts: 11
So, if I want to let it take a long time, let's say up to a minute, I should set the MaxLoadWaitTime as well?
eo_support
Posted: Tuesday, May 6, 2014 1:15:44 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
Yes, you can do that. When you are in dual mode, the converter will NOT start until:

1. MaxLoadWaitTime passes;

-- AND --

2. eopdf.convert() is called.

Thanks
Ryan
Posted: Tuesday, May 6, 2014 1:18:55 PM
Rank: Member
Groups: Member

Joined: 3/25/2014
Posts: 11
Hmm. Did you mean MinLoadWaitTime?

I would think MaxLoadWaitTime is the outer limit, not a minimum.
Ryan
Posted: Tuesday, May 6, 2014 1:35:44 PM
Rank: Member
Groups: Member

Joined: 3/25/2014
Posts: 11
When I set MaxLoadWaitTime and Mode=dual, it does what I expect. It converts as soon as I call eopdf.convert(), even though the max is 2 minutes.
eo_support
Posted: Tuesday, May 6, 2014 2:43:39 PM
Rank: Administration
Groups: Administration

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

Yes. You are right. Our previous reply wasn't accurate. Here is the exact logic when Mode=Dual:

1. Wait for eopdf.convert() to be called. If you do not call eopdf.convert(), then it will be stuck on this step until time out;

2. Wait for:
2.a: The page finishes loading (all images, frames, etc);
-- or --
2.b: MaxLoadWaitTime passes;

So in case you give the go with eopdf.convert() and the page has already finished loading, then it will not wait until MaxLoadWaitTime pass;

Hope this make senses to you. Sorry about the confusion.

Thanks!
Ryan
Posted: Tuesday, May 6, 2014 3:28:40 PM
Rank: Member
Groups: Member

Joined: 3/25/2014
Posts: 11
Makes sense now. Thanks!
eo_support
Posted: Tuesday, May 6, 2014 5:57:18 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
You are welcome. Please feel free to let us know if you have any more questions.


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.