Welcome Guest Search | Active Topics | Sign In | Register

64-bit IIS for EO.PDF - licence failure Options
Civica Pty Ltd
Posted: Wednesday, July 9, 2014 10:10:46 PM
Rank: Member
Groups: Member

Joined: 7/9/2014
Posts: 20
Hi,

I'm using EO.PDF from within an ASP.Net MVC/WebAPI website. I'm building a PDF based on some static HTML & JPEGs saved to the file system which is made available via a URL.

If I build the site as AnyCPU or x64 and then run it in IIS or IIS Express I get the "yellow screen" with this exception (snipped out some bits for brevity)
Quote:

License data provided by AddLicense is invalid.
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 data provided by AddLicense is invalid.

<snip>
Line 63: using (var ms = new MemoryStream())
Line 64: {
Line 65: HtmlToPdf.ConvertUrl(uriBuilder.ToString(), ms, eoPdfOptions);
Line 66:

<snip>

[Exception: License data provided by AddLicense is invalid.]
EO.Pdf.Contents.PdfContentContainer.a(String A_0) +1694
EO.Pdf.Contents.PdfContentContainer.b() +667
EO.Pdf.Contents.PdfContentContainer..ctor(ai A_0, c9 A_1, String A_2) +81
EO.Pdf.PdfPage..ctor(ai A_0, c9 A_1) +58
EO.Pdf.PdfPageCollection.Add() +35
EO.Pdf.Internal.lu.a(Int32 A_0, HtmlToPdfResult A_1, Int32& A_2) +5561
EO.Pdf.Internal.lu.d() +434

[HtmlToPdfException: Convertion failed. License data provided by AddLicense is invalid.]
EO.Pdf.HtmlToPdfException.b(Exception A_0) +85
EO.Pdf.Internal.lu.d() +2028
EO.Pdf.HtmlToPdfSession.RenderAsPDF(PdfDocument doc) +78
EO.Pdf.HtmlToPdf.ConvertUrl(String url, PdfDocument doc, HtmlToPdfOptions options) +159
EO.Pdf.HtmlToPdf.ConvertUrl(String url, Stream stream, HtmlToPdfOptions options) +66
REDACTED.Web.Services.PdfConversion.PdfConverterViaEOPdf.ConvertInfoJetFormToPdf(String baseUrl, InfoJetForm jetForm, Func`2 jetFormForView, String basePdfFilename, Guid instanceId, Nullable`1 userId, Guid newPdfSetId, Boolean generatedByPatientSubmit) in
<snip>



However if change the build settings and then run the site under IIS with the 32-bit process flag set or run it in IIS Express x86 then all is fine.

The version of the EO.PDF assembly reported by Visual Studio's properties is 5.0.73.2 and it's dated 7th April 2014. I see there's a newer release that's about a week old but haven't tried it yet (the fix list in the announcement didn't mention anything about 64-bit licences).

Any ideas?

Currently I've switched our site to run as x86 which is fine for the moment but I'd like to be able to avoid that once things get busier.
eo_support
Posted: Wednesday, July 9, 2014 11:14:01 PM
Rank: Administration
Groups: Administration

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

We have not been able to reproduce this problem. Can you try in a standalone test app and see if the same problem occurs?

Thanks!
Civica Pty Ltd
Posted: Thursday, July 10, 2014 2:38:42 AM
Rank: Member
Groups: Member

Joined: 7/9/2014
Posts: 20
Thanks for the reply and for confirming that it's a configuration that ought to work.

I'll try a quick test app and get back to you.
Civica Pty Ltd
Posted: Thursday, July 10, 2014 2:53:28 AM
Rank: Member
Groups: Member

Joined: 7/9/2014
Posts: 20
I've download LinqPad AnyCPU build (so it runs as a 64-bit process) from http://www.linqpad.net/beta.aspx.

I then added a reference to EO.Pdf.dll (hit F4 to do so).

I then ran this code

EO.Pdf.Runtime.AddLicense(
SNIP!); //(cut & paste from the original licence message I received)
MemoryStream ms = new MemoryStream();

var result = EO.Pdf.HtmlToPdf.ConvertUrl(@"http://www.google.com", ms);

File.WriteAllBytes(@"c:\temp\x.pdf", ms.ToArray());


I get this exception (by the way, there's a typo in "conversion")
HtmlToPdfException:
Convertion failed. License data provided by AddLicense is invalid.

Stack trace
at EO.Pdf.HtmlToPdfException.b(Exception A_0)
at EO.Pdf.Internal.lu.d()
at EO.Pdf.HtmlToPdfSession.RenderAsPDF(PdfDocument doc)
at EO.Pdf.HtmlToPdf.ConvertUrl(String url, PdfDocument doc, HtmlToPdfOptions options)
at EO.Pdf.HtmlToPdf.ConvertUrl(String url, Stream stream, HtmlToPdfOptions options)
at EO.Pdf.HtmlToPdf.ConvertUrl(String url, Stream stream)

If I run the exact same code in x86 LinqPad then it works and I get my PDF.

I figured this was a good reproduction of the issue since it cuts out ALL of my code and is quick to prototype. I'm happy to save the LinqPad project file and send it to you (which would include my licence key) if that's of any help?

I've downloaded the July 2014 release but haven't yet installed it. I might give that a quick try next.
Civica Pty Ltd
Posted: Thursday, July 10, 2014 3:13:09 AM
Rank: Member
Groups: Member

Joined: 7/9/2014
Posts: 20
I've just uninstall, restarted and installed the new EO.Total. Same problem I'm afraid. EO.Pdf.dll file version is now 5.0.84.2 dated 10 July 2014.
Civica Pty Ltd
Posted: Thursday, July 10, 2014 5:05:55 AM
Rank: Member
Groups: Member

Joined: 7/9/2014
Posts: 20
Reading through the docs I also see there's a background service. I've just configured it and the results are the same. I can't really be sure if it's even hitting the service because, x86 or x64, there's nothing in the Windows application event log apart from the service logging that it was started successfully. Should there be anything else logged when converting?
eo_support
Posted: Thursday, July 10, 2014 9:47:19 AM
Rank: Administration
Groups: Administration

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

It shouldn't have anything to do with the background service and you do not need to use it. If you can send us the test project, we will be very happy to take a look. You can find more information about test project here:

http://www.essentialobjects.com/forum/test_project.aspx

Thanks!
Civica Pty Ltd
Posted: Thursday, July 10, 2014 8:56:43 PM
Rank: Member
Groups: Member

Joined: 7/9/2014
Posts: 20
Hi,

I was preparing a test project and then found it worked, and then didn't. Strange behaviour....

So I've dug a bit deeper and started taking a Procmon trace. I saw a reference to a clrjit.dll and that triggered my memory - I had installed the RyuJIT preview quite some time ago. http://blogs.msdn.com/b/dotnet/archive/2013/09/30/ryujit-the-next-generation-jit-compiler.aspx

Testing it out I had set an environment variable COMPLUS_AltJit=* globally (see the referenced blog post). No ill effects were observed in anything (for several months) until using EO.PDF.
Clearing out that environment variable made things come good :)

That's not to say it's your fault - it's a preview jitter after all. However it may well become the default jitter in a future .NET so if you have some nice way of reporting EO.PDF's incompatibility to Microsoft I'm sure they'd help come up with a fix. I also may not be running the latest CTP of that jitter...

I'll give deployment another go and see what happens. I had trouble on the production deployment too where I know I hadn't done anything crazy with preview jitters. I've copied my sample project up to the production server and it runs properly so I'll give deployment another go and see how things go.

I appreciate your help. Cheers :)
eo_support
Posted: Monday, July 14, 2014 3:53:43 PM
Rank: Administration
Groups: Administration

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

Thank you very much for the additional information. We have downloaded and installed RyuJIT CP4 but it seems to work fine. Our test app runs without any problem, we also see that protojit.dll has been loaded into the exe, which means it is indeed using RyuJIT. So this might be an issue in the preview jitters.

In any case, please feel free to let us know if you still see any problem.

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.