Worksheet to JPEG issue in Azure due to System.Drawing library using Aspose.Cells for .NET

Hi,

We are using Aspose.Cells for .Net 19.6. Our requirement is to export range of cells in a Worksheet to an image (so far we have tried JPEG). Our backend is implemented using Azure Functions (serverless compute service in Azure Cloud). For security reasons, the sandbox that Azure Functions use is prohibited from accessing certain parts from the Windows API, specifically the part which deals with rendering graphics. The unfortunate implication of this is that software running in Azure Functions has no access to the System.Drawing library, which in turn Aspose.cells uses to render snapshots of Excel sheets.

Can you please suggest how can we overcome or work around this limitation? Is there other output image format (e.g. TIFF, PNG?) that doesn’t require access to the System.Drawing library?

Thanks a lot in advance,
Volo

@Volo,
You may please test your application again after running the following commands which install libgdiplus:

apt-get update
apt-get install -y libgdiplus
cd /usr/lib && ln -s libgdiplus.so gdiplus.dll
apt-get install -y --no-install-recommends libc6-dev

These should resolve your issue for rendering to all types of images and PDF as well.

Hi Ahsaniqbalsidiqui,

Unfortunately, the suggestion has not helped. We now got to know that the root cause of the issue is that Aspose.Cells product uses System.Drawing classes. That it’s failing inside Microsoft Azure Functions (v2 using .NET Core) with the following error - “System.Drawing is not supported on this platform” - Azure Functions v2 works in sandbox, not in .NET Core CLR. Due to the sandbox limitations no code can be run which uses System.Drawing.

Other users experience the same issues with other Aspose products - see below. That is very hindering, as many organizations are in the process of migrating there applications to Cloud, in many cases new applications are build in Cloud only, following Cloud first approach. In this case, this capability can be a decisive factor to go in favor of other product - e.g. Syncfusion, which doesn’t utilize System.Drawing classes, and hence doesn’t have the same issue.

Does anyone know whether Aspoce.Cells will also be switched to a new graphics library with
PDFNET-45556? What is the ETA?

Looking forward to get a solution for that asap.

Thanks,
Volo

@Volo,
Thanks for details.
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

CELLSNET-46974 - Worksheet to JPEG issue in Azure Functions v2

Hi @ahsaniqbalsidiqui, do you have any update for me?

Thanks,
Volo

@Volo,

I am afraid, there is no update on your issue yet. I have logged your concerns against your issue into our database.

Hopefully, we will get back to you soon with updates.

@Volo,
We are still in the progress of evaluating possible solutions for such kind of issues. It is too complicated for us to solve it in near future.

@Volo,

Please try our latest version Aspose.Cells v21.6.0.

We have done a lot of tests for your issue on Azure and found that Azure already supports the System.Drawing.Common Graphics library, the difficulty described in this list should no longer exist. The Aspose.Cells library is currently available on Azure. As for the problem of switching the graphics library, it is too big and complicated task which will be addressed in details in future.