Welcome Guest Search | Active Topics | Sign In | Register

Failed to load PDF document Options
Jerry
Posted: Thursday, August 9, 2018 2:29:54 PM
Rank: Newbie
Groups: Member

Joined: 4/29/2016
Posts: 5
Hello,

We have EO.Total.2015 applied to our web application (using MVCToPDF.RenderAsPDF). It worked fine until I installed two application instance using two separate application pool in same IIS server. When I generate PDF from first application at first time, it works. Then I try to generate PDF from second application, I get error message in chrome says "Failed to load PDF document". If I close IIS worker process for first application, then I can generate PDF from second application. It looks like the EO.Pdf.Mvc can only work for one application pool per web server. Is that true? or Is there any way I can fix the problem?

Further investigation: Looks like PDF generation works find in two application using dedicate pool but reside on different site on same IIS server.

Here is the exception I captured from event viewer:
Source: .NET Runtime

Application: w3wp.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.NullReferenceException
at System.Web.ThreadContext.AssociateWithCurrentThread(Boolean)
at System.Web.HttpApplication.OnThreadEnterPrivate(Boolean)
at System.Web.LegacyAspNetSynchronizationContext.CallCallbackPossiblyUnderLock(System.Threading.SendOrPostCallback, System.Object)
at System.Web.LegacyAspNetSynchronizationContext.CallCallback(System.Threading.SendOrPostCallback, System.Object)
at System.Web.LegacyAspNetSynchronizationContext.Post(System.Threading.SendOrPostCallback, System.Object)
at EO.Internal.gp+a.a(System.String)
at EO.Internal.gp+a.b(System.Object)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()


Sincerely,

Jerry
eo_support
Posted: Thursday, August 9, 2018 5:44:35 PM
Rank: Administration
Groups: Administration

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

We have not heard of such issue before so the issue could be related to either our product or your specific environment. You can try the following and see if it works:

1. Make sure you run latest IIS and .NET Framework 4.6 or higher. The fact that you are using LegacyAspNetSynchronizationContext seems to indicate that you are using an older version which may have contributed to the problem;

2. Try the latest build from our download page;

In any case, the root of the issue appears to be that LegacyAspNetSynchronizationContext is not functioning properly on your system (it should not throw NullReferenceException) so you may want to research online about this class to see if you can avoid it. We do not use this class directly ---- we use SynchronizationContext.Current to get a SynchronizationContext object and use it. Exactly what type of SynchronizationContext object is returned is not up to us, it's up to your runtime environment, so you may want to look for ways to instruct your runtime not to use that class.

If you still have problems, then you will need to purchase a new license in order for us to investigate further. We provide free tech support for one year after the purchase. Your order was placed in 2014 so your support has already expired in 2015. As such we are in fact not obligated to provide any support to you at all. When you purchase a new license, it will update your version to current and provide another year of support to you as well.

Thanks!
Jerry
Posted: Monday, August 13, 2018 4:20:05 PM
Rank: Newbie
Groups: Member

Joined: 4/29/2016
Posts: 5
Hello,

Thanks for your help. Here is my further information and test result.

1. my local environment: Windows 7, NET framework 4.6.1, IIS 7.5
2. update web application to support 4.6.1, PDF not working
3. download eo.pdf 2018 sample and replace dll library with newest one in web application, so far PDF working among different web application
4. looking different between version 2015 and 2018, there is no new worker process generated in version 2015, while in version 2018, during PDF conversion, a new worker process is generated, which is the application pool that is associated with web application site in IIS, and all web application within same site use this new worker process to generate PDF. The web application in other site will use its own site pool during PDF generation.

Before we plan to purchase new version of PDF converter, I would like to know why they follow different behavior between version 2015 and 2018 regarding application pool. is that changes in version 2018 supposed to fix NullReferenceException issue among multi worker process, or something I can update my source code to follow same behavior in version 2018?

Regards,

Jerry
eo_support
Posted: Monday, August 13, 2018 4:58:05 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,071
Hi Jerry,

We won't be able to tell you exactly what was causing the NullReferenceException error for you without having to investigate and reproduce exactly the same issue using the same version you use --- which is something we won't be able to do at this point due to a number of reasons: 1. you have an old version, 2. your support has already expired and 3. the current issue no longer demonstrates the problem. Consequentially, there is no way for us to tell you what you can do in your source code in order to avoid it since quite frankly we can not tell what caused it without investigating it first.

One of the primary goal of our one year free upgrade policy is to ensure our product do work for our customer ---- if they run into any issue within one year and report to us, we will work on it and address it promptly if possible (issues that are not "fixable" do exist but are relatively rare and usually due to limitation of other parties that we have no control over with, such as a limitation in the browser engine, in that case we will try to work with our customer to find a workaround). However we won't be able to go back for a couple of years and resolves/back port something that is already resolved in the current version. You will need to update to the current version for such scenarios.

Thanks!


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.