|
Rank: Newbie Groups: Member
Joined: 5/29/2012 Posts: 4
|
We are currently trialling your product and have found it performs well. However, we have one issue at the moment that is preventing us from moving further with this product.
We are developing a .NET MVC app that has a download feature on some of the pages within the application. However, the application is controlled via a login process and an authentication cookie and session management (via a cookie) is in use.
When generating PDF downloads of pages that contain images they are not being displayed as the PDF object does not have the session and authentication ID's. We have attempted to pass these using additional headers but have found that additional headers does not work when using ConvertHtml and when using ConvertUrl the operation times out.
We would prefer to use the ConvertHtml approach as this requires far less work from our side to implement.
Is there an approach (technique) we are missing or are we doing the right thing and there is something that can be changed within the software to assist with this problem?
Thanks in anticipation of your help. Jason.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
This is a known issue and we are working on it. Supposesly you can use HtmlToPdf.Options.AdditionalHeaders to pass authentication cookies but currently that part is not working correctly. We will have a new build for you in a day or two that should address this issue. Sorry about the inconvenience. We will post again when the new build is ready.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 5/29/2012 Posts: 4
|
Thank you so much for your prompt reply. Look forward to your new build and have my checkbook ready!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Glad to hear that! We will let you know as soon as the new build is ready.
Thanks!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
This is just to let you know that we are still working on this issue. The new build would significantly enhance authentication support but there are a few things that need to be ironed out before we can release it to you. We will let you know as soon as it is ready for you.
Thanks!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi, This is just to let you know that the new release is currently available on the download page and it would allow you to work with cookies explicitly. See here for more details: http://www.essentialobjects.com/doc/4/htmltopdf/authenticate.aspxA new HtmlToPdfSession object has also been added that would allow you to explicitly "login" any website: http://www.essentialobjects.com/doc/4/htmltopdf/session.aspxWe apologize for the delay. Please feel free to let us know if you have any more questions. Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 5/29/2012 Posts: 4
|
Thank you for your updated solution to this problem. We tried using the new functions you provided and they worked. However, it was not as straightforward as you may think. The generation of the file took well over 60 seconds and it turns out that .NET restricts concurrent requests from the same session (for obvious reasons when you think about it). Due to the fact that the generation of the PDF is already within a request then the PDF object is not able to access until the main request times out. I have placed some articles below which may be of interest: http://www.stefanprodan.eu/2012/02/parallel-processing-of-concurrent-ajax-requests-in-asp-net-mvc/http://weblogs.asp.net/imranbaloch/archive/2010/07/10/concurrent-requests-in-asp-net-mvc.aspxAs we are using MVC3 we had to find a way to force .NET to process multiple requests concurrently and we went down many blind alleys that did not work. Finally we found the following approach worked: http://sapoval.org/per-action-custom-sessionstateattributeOnce again - thanks for your prompt response to this issue.. Jason.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
Thank you very much for sharing! As you already noticed, session concurrency is controlled by ASP.NET and is completely out of our hands. The main reason that ASP.NET does that is to allow programmers to use session variables freely without having to worry about multi-thread synchronization issues. So ASP.NET decides to allow concurrency among different sessions, but disallow concurrency from the same sessions by default. The links you posted are very useful for other customers who may face the same problem.
Thanks!
|
|