Welcome Guest Search | Active Topics | Sign In | Register

EO.pdf on Azure Website with Full Trust Options
greg
Posted: Monday, October 8, 2012 3:26:14 PM
Rank: Newbie
Groups: Member

Joined: 10/8/2012
Posts: 5
Code works fine on development

http://idealpi.azurewebsites.net/testpdf.aspx

//Set the response header
HttpResponse response = HttpContext.Current.Response;
response.Clear();
response.ClearHeaders();
response.ContentType = "application/pdf";

//Convert to the output stream
EO.Pdf.HtmlToPdf.ConvertUrl("www.google.com", response.OutputStream);

response.End();

when put on website with full trust in web.config
click button and spins for while and get error:

Unable to create worker thread.
Line 37: EO.Pdf.HtmlToPdf.ConvertUrl("www.google.com", response.OutputStream);
[Exception: Unable to create worker thread.]
EO.Pdf.Internal.lo..ctor() +399
EO.Pdf.Internal.lo.a(lo A_0, List`1 A_1, Boolean A_2) +802
EO.Pdf.Internal.lo.a(hi A_0, Boolean A_1) +196
EO.Pdf.Internal.lo.a(hi A_0) +611

[HtmlToPdfException: Convertion failed. Unable to create worker thread.]
EO.Pdf.Internal.lo.a(hi A_0) +746
EO.Pdf.HtmlToPdfSession..ctor(HtmlToPdfOptions A_0) +133
EO.Pdf.HtmlToPdf.ConvertUrl(String url, PdfDocument doc, HtmlToPdfOptions options) +58
EO.Pdf.HtmlToPdf.ConvertUrl(String url, Stream stream, HtmlToPdfOptions options) +50
EO.Pdf.HtmlToPdf.ConvertUrl(String url, Stream stream) +7
TestPdf.Button1_Click(Object sender, EventArgs e) in c:\DWASFiles\sites\idealpi\VirtualDirectory0\site\wwwroot\TestPdf.aspx.cs:37
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +118
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +112
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) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563



also tried writing simple output
HtmlToPdfResult result = HtmlToPdf.ConvertHtml("<b>test</b>", doc);
and same problem

any Suggestions?

eo_support
Posted: Monday, October 8, 2012 3:31:23 PM
Rank: Administration
Groups: Administration

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

Are you able to access Windows event viewer on that machine? EO.Pdf would write additional log information into event viewer when this occurs.

Thanks!
greg
Posted: Monday, October 8, 2012 3:43:24 PM
Rank: Newbie
Groups: Member

Joined: 10/8/2012
Posts: 5
At this point I do not have access to that. However I will check if Trace.Write is logged.
eo_support
Posted: Monday, October 8, 2012 3:46:17 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,221
No. I do not think any debug information goes there. We will try to run the test in Azure and see what we can find. We will reply again as soon as we have any update.

Thanks!
greg
Posted: Monday, October 8, 2012 4:14:18 PM
Rank: Newbie
Groups: Member

Joined: 10/8/2012
Posts: 5
I am using the Azure website or WAWS servers which is a different flavor of Azure.
they work more like godaddy or amazon than traditional azure deploy applications.

Greg
eo_support
Posted: Monday, October 8, 2012 4:24:05 PM
Rank: Administration
Groups: Administration

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

In that case you might want to consider another platform. For scalability and stability reasons, EO.Pdf performs the actual conversion in a separate worker process instead of inside your Web application process. That is probably what’s failing in your environment since in a Web only environment it usually won’t allow you to spawn your own worker process. If you don’t mind to provide a test environment to us we will be able to find out for sure.

Thanks!
greg
Posted: Monday, October 8, 2012 4:40:26 PM
Rank: Newbie
Groups: Member

Joined: 10/8/2012
Posts: 5
I agree that makes sense. I will check on a dedicated virtual server instead. Thx
eo_support
Posted: Monday, October 8, 2012 4:42:51 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,221
OK. Please feel free to let us know if you still have any issues with the virtual server.

Thanks!
greg
Posted: Tuesday, October 9, 2012 1:26:02 PM
Rank: Newbie
Groups: Member

Joined: 10/8/2012
Posts: 5
I received response back from MS. they said
Based on the reply of EO, it performs the conversion via another process. And it should using named pipe to communicate with the process converting the document. This is not allowed in WAWS. Your web application are not allowed to lunch any process. This is for security purpose, and is by desing.

I would suggest you consider other alternatives which convert the document inside IIS worker process.

So I will look at using a virtual server.
eo_support
Posted: Tuesday, October 9, 2012 2:50:46 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,221
Thanks for the update. That makes perfect sense.
Sumil Jalota
Posted: Tuesday, May 8, 2018 4:36:19 AM
Rank: Newbie
Groups: Member

Joined: 5/8/2018
Posts: 1
Is this still true - that the EO.PDF wont work on Azure Web App as it tries to launch another process of its own ? We've been having a similar problem.
eo_support
Posted: Tuesday, May 8, 2018 3:17:09 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,221
Sumil Jalota wrote:
Is this still true - that the EO.PDF wont work on Azure Web App as it tries to launch another process of its own ? We've been having a similar problem.


Yes. This is still the case --- EO.Pdf needs to run the native browser engine in a separate process (EO.Pdf is based on Chromium browser engine and the browser engine has a multi-process architecture, so it is not possible to run everything inside your application process). So if the host environment does not allow child process, then EO.Pdf won't work.


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.