Welcome Guest Search | Active Topics | Sign In | Register

Losing session when running HtmlToPdf.ConvertUrl() Options
Becky
Posted: Tuesday, April 29, 2014 5:41:18 PM
Rank: Advanced Member
Groups: Member

Joined: 5/24/2012
Posts: 45
Hi,
We had to move our website to a new server at the beginning of this year. We ironed out settings and everything was running fine since Jan 2014. We use eo.pdf to convert html into pdf docs in several places throughout our application.

Suddenly on Sunday of this week, the conversion stopped working. We did not upload anything new. We just started receiving the following error anytime our application tried to run HtmlToPdf.ConvertUrl(UrltoConvert,doc) line of code

Server Error in '/' Application.

This session is no longer valid. If you wish to reuse the session later, please consider calling GetCookies to retain the session cookies, then reuse these cookies through HtmlToPdfOptions.Cookies with another session. (4)

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: EO.Pdf.Internal.ky: This session is no longer valid. If you wish to reuse the session later, please consider calling GetCookies to retain the session cookies, then reuse these cookies through HtmlToPdfOptions.Cookies with another session. (4)

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[ky: This session is no longer valid. If you wish to reuse the session later, please consider calling GetCookies to retain the session cookies, then reuse these cookies through HtmlToPdfOptions.Cookies with another session. (4)]
EO.Pdf.Internal.ll.l() +92
EO.Pdf.Internal.ll.a(a A_0) +1507
EO.Pdf.Internal.ll.a(cp A_0) +32
EO.Pdf.HtmlToPdfSession.Dispose() +100
EO.Pdf.HtmlToPdf.ConvertUrl(String url, PdfDocument doc, HtmlToPdfOptions options) +232
EO.Pdf.HtmlToPdf.ConvertUrl(String url, PdfDocument doc) +7
_2009HRDirector.frmShowJob.btnPrint_Click(Object sender, EventArgs e) +1314
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +9615678
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +103
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34009

And sometimes we get this error:
All workers are busy. Please increase HtmlToPdf.MaxConcurrentTaskCount.

Please advise,
Thanks,
Becky
eo_support
Posted: Wednesday, April 30, 2014 12:01:50 AM
Rank: Administration
Groups: Administration

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

Can you check your event viewer and see if you can find anything there? Also does this happen with every page you are trying to convert?

Thanks!
Becky
Posted: Friday, May 2, 2014 1:28:55 PM
Rank: Advanced Member
Groups: Member

Joined: 5/24/2012
Posts: 45
Looking through other posts, we tried updating to the most recent build but then we receive this error:
The error I am seeing is:

License '4461152069' is not valid for this build.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Exception: License '4461152069' is not valid for this build.
Becky
Posted: Friday, May 2, 2014 1:30:21 PM
Rank: Advanced Member
Groups: Member

Joined: 5/24/2012
Posts: 45
one more note: this had been running fine till just now - with no apparent reason for the error to start occurring
Becky
Posted: Friday, May 2, 2014 1:36:34 PM
Rank: Advanced Member
Groups: Member

Joined: 5/24/2012
Posts: 45
we are running ver 4.0.18.2
Becky
Posted: Friday, May 2, 2014 3:05:54 PM
Rank: Advanced Member
Groups: Member

Joined: 5/24/2012
Posts: 45
The full capture is:

===============================================
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 5/2/2014 10:23:44 AM
Event time (UTC): 5/2/2014 6:23:44 PM
Event ID: c8e29e196c844903b6e8afcaa829eec1
Event sequence: 1223
Event occurrence: 3
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/1114/ROOT-36-130435262634445569
Trust level: Full
Application Virtual Path: /
Application Path: E:\HostingSpaces\broof\bentericksen-hrdirector.com\wwwroot\
Machine name: LILY

Process information:
Process ID: 476852
Process name: w3wp.exe
Account name: LILY\benteri_torcom_web

Exception information:
Exception type: ky
Exception message: This session is no longer valid. If you wish to reuse the session later, please consider calling GetCookies to retain the session cookies, then reuse these cookies through HtmlToPdfOptions.Cookies with another session. (4)
at EO.Pdf.Internal.ll.l()
at EO.Pdf.Internal.ll.a(a A_0)
at EO.Pdf.Internal.ll.a(cp A_0)
at EO.Pdf.HtmlToPdfSession.Dispose()
at EO.Pdf.HtmlToPdf.ConvertUrl(String url, PdfDocument doc, HtmlToPdfOptions options)
at EO.Pdf.HtmlToPdf.ConvertUrl(String url, PdfDocument doc)
at _2009HRDirector.frmShowForm.btnPrint_Click(Object sender, EventArgs e)
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)



Request information:
Request URL: http://bentericksen-hrdirector.com/PfrmShowForm.aspx?fm=101
Request path: /PfrmShowForm.aspx
User host address: 70.199.134.193
User:
Is authenticated: False
Authentication Type:
Thread account name: LILY\benteri_torcom_web

Thread information:
Thread ID: 68
Thread account name: LILY\benteri_torcom_web
Is impersonating: False
Stack trace: at EO.Pdf.Internal.ll.l()
at EO.Pdf.Internal.ll.a(a A_0)
at EO.Pdf.Internal.ll.a(cp A_0)
at EO.Pdf.HtmlToPdfSession.Dispose()
at EO.Pdf.HtmlToPdf.ConvertUrl(String url, PdfDocument doc, HtmlToPdfOptions options)
at EO.Pdf.HtmlToPdf.ConvertUrl(String url, PdfDocument doc)
at _2009HRDirector.frmShowForm.btnPrint_Click(Object sender, EventArgs e)
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


Custom event details:
====================================================

eo.pdf version: 4.0.18.2
eo_support
Posted: Friday, May 2, 2014 3:36:59 PM
Rank: Administration
Groups: Administration

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

Please try to remove your license code. You will get that error when you apply the wrong license, but if you do not apply the license at all, it will still run and create the PDF file for you, except that it will add the license banner. However that will tell you whether the new version will work for you or not.

Thanks!
Becky
Posted: Friday, May 2, 2014 5:55:19 PM
Rank: Advanced Member
Groups: Member

Joined: 5/24/2012
Posts: 45
Thanks for the reply - can't believe I didn't think of that...

Anyway - tried again with latest version 5.0.75.2

Still receiving 'This session is no longer valid. If you wish to reuse the session later, please consider calling GetCookies to retain the session cookies, then reuse these cookies through HtmlToPdfOptions.Cookies with another session. (5)' error

I was able to create on pdf doc one time and it showed the not registered msg at the bottom then the error started again
eo_support
Posted: Friday, May 2, 2014 6:23:40 PM
Rank: Administration
Groups: Administration

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

The problem can be caused by a server overload or an internal crash. If it only occurs occasionally at peak hours on random page then it's probably an server overload. In that case you may want to reduce HtmlToPdf.MaxConcurrentTaskCount. This will not fix the exception, but it will give you an exception much quicker with a different message, which you can handle and prompt user to try again later.

If the problem always occurs on a specific page regardless server load, then it's mostly like an internal crash. In that case we would need you to isolate the problem into a test project and then send the test project to us. Once we have that we will look into it to see if we can reproduce the problem here. Usually as soon as we can reproduce the problem here, we will be able to find out the root cause of the problem.

Thanks!
Becky
Posted: Friday, May 2, 2014 8:56:36 PM
Rank: Advanced Member
Groups: Member

Joined: 5/24/2012
Posts: 45
I removed some if statements and am now receiving this error:
Server Error in '/' Application.

Not enough storage is available to process this command

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ComponentModel.Win32Exception: Not enough storage is available to process this command

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[Win32Exception (0x80004005): Not enough storage is available to process this command]
System.Diagnostics.NtProcessManager.GetProcessIds() +6534060
System.Diagnostics.ProcessManager.GetProcessIds() +38
System.Diagnostics.ProcessManager.GetProcessIds(String machineName) +41
System.Diagnostics.Process.GetProcessById(Int32 processId, String machineName) +36
System.Diagnostics.Process.GetProcessById(Int32 processId) +12
EO.Pdf.Internal.ce.a(e2 A_0, String A_1, Boolean A_2) +613
EO.Pdf.Internal.lm..ctor() +361
EO.Pdf.Internal.lm.a(lm A_0, List`1 A_1, Boolean A_2) +793
EO.Pdf.Internal.lm.a(hf A_0, Boolean A_1) +189
EO.Pdf.Internal.lm.a(hf A_0) +618

[HtmlToPdfException: Convertion failed. Not enough storage is available to process this command]
EO.Pdf.Internal.lm.a(hf A_0) +753
EO.Pdf.HtmlToPdfSession..ctor(HtmlToPdfOptions A_0) +141
EO.Pdf.HtmlToPdf.ConvertUrl(String url, PdfDocument doc, HtmlToPdfOptions options) +53
EO.Pdf.HtmlToPdf.ConvertUrl(String url, PdfDocument doc) +7
_2009HRDirector.frmShowForm.btnPrint_Click(Object sender, EventArgs e) +1525
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +9615678
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +103
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34009

Thank you so much for your help!
Becky
Becky
Posted: Friday, May 2, 2014 10:56:12 PM
Rank: Advanced Member
Groups: Member

Joined: 5/24/2012
Posts: 45
I think I have the form and job description conversion working. I removed an if statement checking for the session variable and those two started working. We also create a larger employee handbook (20+ pages) with TOC, and page numbering. When I took the if statement out of that procedure, it started giving me the following error:
Exception of type 'System.OutOfMemoryException' was thrown.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.

Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.]
EO.Pdf.Drawing.PdfFloatArray.d() +132
EO.Pdf.PdfPage..ctor(ai A_0, c9 A_1) +333
EO.Pdf.PdfPage..ctor() +45
EO.Pdf.PdfPageCollection.Add() +26
EO.Pdf.Internal.gd.e() +24
EO.Pdf.Internal.bb.b() +115
EO.Pdf.Internal.bb.b() +62
EO.Pdf.Internal.bb.x() +209
EO.Pdf.Internal.b.a(i6 A_0) +580
EO.Pdf.Internal.a8.l() +17
EO.Pdf.Acm.AcmBlock.e(j A_0) +47
EO.Pdf.Internal.j.l() +100
EO.Pdf.Acm.AcmContent.p() +941
EO.Pdf.Acm.AcmRender.a(AcmBlock A_0) +57
EO.Pdf.Acm.AcmRender.Render(AcmContent[] contents) +128
_2009HRDirector.PfrmDisplayHandbook.ConvertHandbookToPDF() +4364
_2009HRDirector.PfrmDisplayHandbook.CreateHandbook() +16817
_2009HRDirector.PfrmDisplayHandbook.btnYes_Click(Object sender, EventArgs e) +236
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +9615678
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +103
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724

________________________________________
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34009

Then I removed the code that generates the page numbers and it started working. I am pretty much using the code from your example
For I As Integer = 0 To doc.Pages.Count - 1
Dim pageNumber As Acm.AcmText
Dim pageNumRender As Acm.AcmRender

'Create an AcmText representing the page number
pageNumber = New Acm.AcmText(doc.Pages(I).Index + 1)

'Create an AcmRender to render the page number.
'The arguments are:
' First argument: the target page
' Second argument: the "Y" position
' Third argument: The paper margins in left, top, right, bottom order
pageNumRender = New Acm.AcmRender(doc.Pages(I), 10.395, _
New Acm.AcmPageLayout( _
New Acm.AcmPadding(7.5, -0.075, 1, 0)))
'Render the page number
pageNumber.Style.FontName = "Arial"
pageNumber.Style.FontSize = 10.5F
pageNumRender.Render(pageNumber)

Next

Is there anything you can see that is terribly wrong with this code?

Thanks,
Becky
Becky
Posted: Saturday, May 3, 2014 1:07:57 PM
Rank: Advanced Member
Groups: Member

Joined: 5/24/2012
Posts: 45
So I'm not sure if the server guys did anything but it is now working in all instances where we create pdf documents and with the original eo.pdf version 4.0.18.2

Thanks for all your help,
Becky
eo_support
Posted: Saturday, May 3, 2014 8:27:50 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
Interesting. Thanks for the update! I am glad to hear that it's working for you again.


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.