System.ArgumentException: A null reference or invalid value was found [GDI+ status: InvalidParameter

Hello, I encountered an error while generating excel thumbnails using aspose.cells
Error message: system ArgumentException: A null reference or invalid value was found [GDI+ status: InvalidParameter
my environment: Ubuntu system, published based on docker, Debian 11 base package,. NETCORE 3.1, aspose.cells 22.8.0
Code example:
企业微信截图_16620243344343.png (110.6 KB)

@rainwzy,

Thanks for the screenshot.

Aspose.Cells uses System.Drawing APIs when rendering spreadsheets to image files. Please make sure that libgdiplus and fonts are installed on linux machine. You may browse online for relevant documents/resources.
e.g.,

Yes, I installed libgdiplus. I have no problem using Debian 10, but there was an error when upgrading to Debian 11

@rainwzy,

We will look into it and get back to you soon. In the meantime, please see and follow the instructions on how to use Aspose.Cells in docker container.

@rainwzy
Thanks for your info. We have added an task CELLSNET-51943 for this issue.

Hi @rainwzy
If you are using Debian, please refer to Microsoft’s official documentation to install the dependencies:

And also for libgdiplus:
https://www.mono-project.com/download/stable/#download-lin-debian

You have released a new version 22.9, but still have not solved the problem of thumbnail failure. You have found this problem, why not solve it?

Hi @rainwzy
libgdiplus is not working well in linux. We have migrated the graphics library to SkiaSharp for linux.
We suggest using .NET6 and Aspose.Cells 22.10.1, See reference documentation:

An error is still reported on the Windows machine: parameter is not valid

@rainwzy,

Could you please share a standalone sample VS.NET project, zip the project and post us with resource files, we will check it soon.

Hi @rainwzy
You Mean, you can now configure the environment properly on Linux, but you’re having problems on windows, right?
If this is the case, on Windows we recommend that you stick to the previous configuration, which is to use “System.Drawing.Common” on windows.
All you need to do is configure your project “Target OS” to “Windows”. See our documentation for details:

企业微信截图_16620243344343.png (110.6 KB)
The code in the picture will report an error when debugging in Windows 11, VS2022 development tool, and. NET Core 3.1 environment
error message:parameter is not valid

@rainwzy

Please comment the line: OnePagePerSheet=true .
If the sheet contains lots of data, and OnePagePerSheet=true is set, the width and height of the output image will be too large, and the output image can’t be generated.

The issues you have found earlier (filed as CELLSNET-51943) have been fixed in this update. This message was posted using Bugs notification tool by johnson.shi