Would you kindly share a bit more details like sample input document, code snippet, and docker file? We will log an investigation ticket and rectify this issue.
I have build a little example complete with Dockerfile and docker compose. Just extract it and execute
“docker-compose up” which will build the VS solution and executes the container.
It will run on Windows without problems, but will give the exception “The type initializer for ‘Gdip’ threw an exception.” on Linux, which is a new exception to me.
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): HTMLNET-4250
You can obtain Paid Support services if you need support on a priority basis, along with the direct access to our Paid Support management team.
Please have a look at my solution: I do not want to open the HTML, I want to convert it to PDF with
Aspose.Html.Converters.Converter.ConvertMHTML(htmlStream, pdfSaveOptions, tempFileNamePdf);
which has no option for a font folder.
Also an exception is occuring within the Converter.ConvertMHTML() call which has nothing to do with fonts.
The exception is:
aspose_mhtml | Unhandled exception. System.TypeInitializationException: The type initializer for ‘Gdip’ threw an exception.
aspose_mhtml | —> System.DllNotFoundException: Unable to load shared library ‘libdl’ or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibdl: cannot open shared object file: No such file or directory
It is nice to know that things have been sorted out now.
As shared earlier, the current version does not support Net 7 on Linux. But we are preparing to add Net 7 support on Linux and a new Drawing system in Q2 2023.
Sure, we will update the documentation accordingly soon.
We just tried in .NET 7 and noticed that the earlier suggested solution also works in .NET 7 environment from your example. Can you please check again and confirm?
Yes it will work in my supplied example if I downgrade System.Drawing.Common to Version 6.0.0.
But for my complete solution I have also to downgrade many more .NET Libraries from 7.0.0 to 6.0.0 because of dependencies and I’m not aware how compatible this is or if this is causing other failures.