Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Fri Feb 19, 2021 3:07 pm

Hello,

I am using SPIRE PDF version "3.7.6.11.40" to generate PDF from HTML it's working fine with my visual studio code and on IIS version (10.0.14393.0). which is hosted in Win server 2016.

But when I am hosting my application to win server 2019 where my iis version is (10.0.17763.1) then it throwing an error on line

Thread thread = new Thread(() =>
{ pdf.LoadFromHTML(htmlCode, true, setting, htmlLayoutFormat); });
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
thread.Join();

Can you please help how to fix.

Thanks

mdminhaj
 
Posts: 5
Joined: Tue Oct 15, 2019 12:18 pm

Fri Feb 19, 2021 7:02 pm

Updating the thread.

I updated the Spire PDF to the latest version "7.1.10.2040" but still getting the same error on same line in the iis version is (10.0.17763.1).
"Failed to load resource: net::ERR_HTTP2_PROTOCOL_ERROR"


I found the below error in the Windows Log.

Application: w3wp.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileNotFoundException
at Spire.Pdf.HtmlConverter.HtmlConverter.ᜀ(System.String, Spire.Pdf.HtmlConverter.ImageType, Int32)
at Spire.Pdf.HtmlConverter.HtmlConverter.Convert(System.String, Spire.Pdf.HtmlConverter.ImageType, Int32, Int32, Spire.Pdf.HtmlConverter.AspectRatio)
at Spire.Pdf.PdfSection.ᜀ(System.String, Boolean, Boolean, Boolean, Spire.Pdf.HtmlConverter.PdfHtmlLayoutFormat)
at Spire.Pdf.PdfDocument.LoadFromHTML(System.String, Boolean, Spire.Pdf.PdfPageSettings, Spire.Pdf.HtmlConverter.PdfHtmlLayoutFormat, Boolean)
at Utility.PDFGeneration+<>c__DisplayClass1_0.<generatePDFNew>b__0()
at System.Threading.ThreadHelper.ThreadStart_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.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()

mdminhaj
 
Posts: 5
Joined: Tue Oct 15, 2019 12:18 pm

Sat Feb 20, 2021 4:03 am

Hello,

Thanks for your inquiry!

Please make sure that the application pool created by the IIS Version(10.0.17763.1) has set the “Load User Profile” setting to true.

LoadTrue.png

If the issue still exists after settings, please compare the other settings of the application pools created by these two IIS versions. When there are some differences between two versions, please change the settings of IIS Version(10.0.17763.1) and test again.

If the issue still persists, please share us with your advanced settings of the application pool. Thanks in advance.

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Fri Mar 05, 2021 9:11 am

Hello,

Hope you are doing well!

How is the issue now? If it still exists, could you please provide your advanced settings of the application pool to us for further investigation?

Thanks in advance.

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Wed Mar 24, 2021 11:21 am

Hello

Thank you for your help.

We are able to solve the issue. It was not related to spire.pdf dll or any settings related to iis. It was an issue related to win-19 server in win 19 there is one file which has been removed from mircosoft. "C:\Program Files (x86)\Microsoft.NET\Primary Interop Assemblies\Microsoft.mshtml.dll". This file is not available in win 19 due to this it was throwing an error on server. So we have added refrence of this file in our application and uploaded this dll as well on the server and it worked well.

Thanks
MD

mdminhaj
 
Posts: 5
Joined: Tue Oct 15, 2019 12:18 pm

Thu Mar 25, 2021 2:05 am

Hello,

Thanks for your feedback, and glad to hear that your issue has been solved.

If you encounter any issues related to our product in the future, just feel free to contact us.

Have a nice day!

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Return to Spire.PDF