Hi,
We're using version 15.1.70.4 of EO.Base, EO.Pdf, and EO.Pdf.Mvc for one of our client's projects. That client has a test server set up with two test instances of their site (written in ASP.NET MVC and run in IIS8), each site runs in a different App Pool. The DLLs are stored and referenced locally in the sites' directories, they're not installed to the GAC.
The first site that uses EO.Pdf to generate a PDF seems to block the second site from ever using it. When you try to generate a PDF in the second site you get the following error and stack trace
Quote:EO.Pdf.HtmlToPdfException: Conversion failed. Child process not ready. nWaitResult = 1 ---> System.Exception: Child process not ready. nWaitResult = 1
at EO.Internal.jl.a(String A_0, Boolean A_1)
at EO.Internal.jl.a(IntPtr A_0)
at EO.Internal.jl.a(String[] A_0, String A_1, String A_2, String A_3, String A_4)
at EO.Internal.g5.a(String A_0, String A_1)
at EO.Internal.ahz.g()
at EO.Internal.ahz..ctor()
at EO.Internal.ahz.a(ahz A_0, List`1 A_1, Boolean A_2)
at EO.Internal.ahz.a(aan A_0, Boolean A_1, a2y A_2)
at EO.Internal.ahz.a(aan A_0, a2y A_1)
--- End of inner exception stack trace ---
at EO.Internal.ahz.a(aan A_0, a2y A_1)
at EO.Pdf.HtmlToPdfSession..ctor(HtmlToPdfOptions A_0)
at EO.Pdf.HtmlToPdf.ConvertHtml(String html, PdfDocument doc, HtmlToPdfOptions options)
Stopping the site that's locked the EO.Pdf process unlocks it so the other site can access EO.Pdf but then that site just locks it as soon as it generates a PDF.
The code we're using to generate the PDF is:
Code: C#
// within PdfController
private string RenderViewToPdf(string viewName, object model)
{
var tempPath = this.BuildTempFilePath();
var routeData = new RouteData();
routeData.Values.Add("controller", "PdfController");
var view = ViewEngines.Engines.FindView(this.ControllerContext, viewName, string.Empty);
var textwriter = new StringWriter();
var context = new ViewContext(this.ControllerContext, view.View, new ViewDataDictionary(model), new TempDataDictionary(), textwriter);
view.View.Render(context, textwriter);
var data = textwriter.ToString();
var doc = new EO.Pdf.PdfDocument();
EO.Pdf.HtmlToPdf.ConvertHtml(data, doc);
doc.Save(tempPath);
return tempPath;
}
Is there something we're doing wrong?
We're using the PdfDocument class and HtmlToPdf.ConvertHtml, neither of which seems to do anything with IDisposable, so it doesn't look like there's an obvious way for us to dispose of any native resources.
As far as I know the version of EO.Pdf we're using is the latest one our client has a licence for, is there any way for us to fix this without upgrading to a later version? Will upgrading to a later version even fix the issue?
If anyone needs any more info please just let me know.
Thanks,
Dave