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.

@moosbart,

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)

Hi,

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.

@moosbart,

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.

Hi,

here my refresh example
DotNetCore_Linux_Sample2.zip (1.2 MB)

Thank you

@moosbart,

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

@moosbart,

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.

Hi,

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

@moosbart,

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

Hi,

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

@moosbart,

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

Hi,

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.

@moosbart,

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