We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Save a PDF under linux (Ubuntu)

Hi Guys,

I discovered a bug under Linux (Ubuntu).
I attached a code example on this topic.
DotNetCore_Linux_Sample.zip (555.7 KB)
If the code runs under Windows everything is fine.
If it runs under Linux the following problem occurs:
If I want to save a workbook in the format “xlsx”, “tiff”, “pdf”, “svg” or “html”, i get the error “The type initializer for XXX threw an exception.”.

grafik.png (24.5 KB)

Since Aspose DotNet Core rules, these formats should also run under Linux.
I use Version 18.8.0
Can you take a look at this hard problem?

Thanks for your support.


Thanks for your query.

You may please try the new version Aspose.Cells for .NET Core 18.8.1 and also please add reference to System.Drawing.Common and System.Text.Encoding.CodePages into your project. Share the feedback after testing with these updates.

Aspose.Cells18.8.1 For .NetStandard20.Zip (3.8 MB)


Thanks for the note, but unfortunately it does not work.
The result is the same even if I add the both references and the current Aspose reference to 18.8.1
See the screenshots.

grafik.png (24.2 KB)
grafik.png (17.1 KB)

Thank you for your support.


Thank you for the feedback. Please share the updated project where new version Aspose.Cells for .NET Core 18.8.1 is referred (and available in the project folder) and also the said references of System.Drawing.Common and System.Text.Encoding.CodePages are added to the project. We will check this project here and share the feedback.


here my refresh example
DotNetCore_Linux_Sample2.zip (1.2 MB)

Thank you


We were able to observe the issue but we need to look into it more. We have logged the issue in our database for investigation and for a fix. Once, we will have some news for you, we will update you in this topic.

This issue has been logged as

CELLSNETCORE-8 - Type Initializer for * threw an exception while laoding XLSX file and saving in different formats


For resolving this problem, check if you have installed “libgdiplus” on linux:
apt-get install libgdiplus
cd /usr/lib
ln -s libgdiplus.so gdiplus.dll

Also you may copy the font files you needed to linux system. You can call “FontConfigs.SetFontFolder” to set the font folder, or just put it to “/usr/share/fonts” folder.

Please give it a try and share the feedback.


Thanks for the information.
I test it and get back with the results as quickly as possible.


Please share your findings as per your convenience. Let us know if you still face the problem.


thanks for the note, but unfortunately, even after the installation of the packet “libgdiplus” i have the same result. I have the package installed and linked successfully.
grafik.png (7.3 KB)

Much worse, if I update the version 18.8.1 to 18.9.0 i have the following error message. :frowning:
grafik.png (28.7 KB)

Thank you for your support


.NetCore program needs to do some additional initialization, for example:
We have included “CellsHelper.InitForDotNetCore()” method in latest version, and we suggest you to call it first for all .NetCore initialization.


Thanks for the notes. I found a solution.
The solution is:

apt-get install libgdiplus
apt-get install libc6-dev
cd / usr / lib
ln -s libgdiplus.so gdiplus.dll

Now it would be nice if the format “Tiff” would work.
Do you have any idea why that could be?
Here is a screenshot of the error message.
grafik.png (83.9 KB)

Thank you for your support.


Thank you for sharing the solution. It is good to know that your issue is sorted out. We are checking occurrence of this exception on our end. We will update you about our findings soon.

A post was split to a new topic: Converting office files to PDF files