0

I'm using LeadTools v20 HTML5 Document Viewer with Asp.Net Core backed Document Service Library which was available in their examples project in the installation directory. This works fine with PDF files or other file formats mentioned in their site. But I'm getting LeadTools.RasterException error with a message as invalid file format for .docx,.xlsx,.pptx but opens .doc,.xls,.ppt

Files having extension ending with x(mostly Microsoft office documents) are not getting loaded in development mode. But all these works when the application is published. Any suggestions on where I'm going wrong?

Here is the screen print of the exception and error.

enter image description here enter image description here

Please assist me if I'm wrong

fingers10
  • 6,675
  • 10
  • 49
  • 87

1 Answers1

0

Can you check the dependencies on both machines and compare the differences? If you're testing this on Windows, one way to do that is to use Process Explorer to see what DLLs are being loaded. You can download it here: https://learn.microsoft.com/en-us/sysinternals/downloads/process-explorer

To see the DLLs being loaded go to View > Show Lower Pane, then View > Lower Pane View > DLLs:

ss1

ss2

Select the ASP.NET Core Document Service while it's running and then attempt to load the document on the working machine and see what DLLs get loaded, then do the same on the non-working machine and see which DLLs are loaded. You should see a DLL missing.

My guess is that you are missing the DocumentFormat.OpenXml(v2.0) since that is required for all of the x microsoft formats (docx, xlsx, pptx). You can see which DLLs are required for which formats by the SDK at this link: https://www.leadtools.com/help/sdk/v20/dh/to/file-format-support.html

If you are still having issues after trying the above, they offer free technical support via email (anytime) and live chat (M-F business hours): https://www.leadtools.com/support/supportoptions?linkloc=navbar

hcham1
  • 1,799
  • 2
  • 16
  • 27
  • I'm hosting it in my IIS - the same machine I use for development. And it's works on hosted version but not on development. I'm using `LeadTools.Document` Nuget packages in the Document Service Library. Any thing related to DLL paths causing an issue here? – fingers10 Mar 07 '20 at 17:43
  • What version of the Leadtools.Document nuget package are you using? It seems that the DocumentFormat.OpenXml.dll is not being copied to your bin directory when using IIS Express – hcham1 Mar 08 '20 at 17:36
  • Im using `Leadtools.Document.Sdk` - `v20.0.0` and `Leadtools.Formats.Raster.Additional` - `v20.0.0` Any configuration needs to be done to copy `DocumentFormat.OpenXml.dll` to `bin` folder while running from `IISExpress`? I'm running visual studio in admin mode and still I'm facing the issue. – fingers10 Mar 09 '20 at 07:22