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.
Please assist me if I'm wrong
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:
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