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.

Tue Mar 09, 2021 10:56 am

Hello.

We are evaluating Spire.pdf for some projects and we are testing it.

In Visual Studio the project create the PDF from HTML without problems.

But when we install the application in our test server there is an error 503 and stop the Application pool.



Code: Select all
Excepción no controlada. Proceso terminado.

Application ID: /LM/W3SVC/1/ROOT/test/

Process ID: 3688

Exception: System.IO.FileNotFoundException

Message: No se puede cargar el archivo o ensamblado 'Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ni una de sus dependencias. El sistema no puede encontrar el archivo especificado.

StackTrace:    en Spire.Pdf.HtmlConverter.HtmlConverter.ᜀ(String A_0, ImageType A_1, Int32 A_2)
   en Spire.Pdf.HtmlConverter.HtmlConverter.Convert(String url, ImageType type, Int32 width, Int32 height, AspectRatio aspectRatio)
   en Spire.Pdf.PdfSection.ᜀ(String A_0, Boolean A_1, Boolean A_2, Boolean A_3, PdfHtmlLayoutFormat A_4)
   en Spire.Pdf.PdfDocument.LoadFromHTML(String Url, Boolean enableJavaScript, Boolean enableHyperlinks, Boolean autoDetectPageBreak, PdfPageSettings setting, PdfHtmlLayoutFormat layoutFormat, Boolean isLoadComplete)
   en Spire.Pdf.PdfDocument.LoadFromHTML(String Url, Boolean enableJavaScript, Boolean enableHyperlinks, Boolean autoDetectPageBreak, PdfPageSettings setting, PdfHtmlLayoutFormat layoutFormat)
   en newDatechTD.General.PDFGenerator.<>c__DisplayClass0_0.<Generate>b__0()
   en System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   en System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   en System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   en System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   en System.Threading.ThreadHelper.ThreadStart()



Application pool -> Enable 32 bits applications - TRUE

Windows Server 2012 / Internet Information server 8

nfactorial
 
Posts: 5
Joined: Mon Mar 08, 2021 4:26 pm

Wed Mar 10, 2021 1:47 pm

Hello,

Thanks for your inquiry.
I did an initial test in a similar environment, but did not reproduce your issue. This is my test project, please run it on your side, and then tell us your test result.

Besides, our Spire.PDF provides a new plugin method to convert HTML to PDF, and its performance is better than the method you use. You can give it a try.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Tue Mar 16, 2021 7:38 pm

Hello.

Solved!

Here is the solution:

If you have Office installed in your development computer you have to search the file Microsoft.mshtml.dll

If you don't have Office installed in your computer... i don't know how to obtain this dll. (E-iceblue, can you help?)

Spire.PDF need this DLL to run and normally in test or production servers Office is not installed.

Once you have this dll yo have to copy in your server in bin directory.

Best regards from Barcelona!

nfactorial
 
Posts: 5
Joined: Mon Mar 08, 2021 4:26 pm

Wed Mar 17, 2021 9:44 am

Hello Barcelona,

Thanks for your feedback.

I created a project with Visual Studio 2019 on a server without Microsoft Office installed, but after building the project, I found that the Microsoft.mshtml.dll appeared in the bin folder. Then I tried to delete this dll and then rebuild the project, it appeared again. This file should be associated with Visual Studio but not Office. You can verify this by opening your project with Visual Studio 2019 and rebuilding it.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Return to Spire.PDF