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)
|
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!
|
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?
|
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.
|
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?
|
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
|
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.
|
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.
|
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!
|
Rank: Member Groups: Member
Joined: 3/25/2014 Posts: 11
|
Makes sense now. Thanks!
|
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.
|