"System.Drawing.Common is not supported on this platform" on Docker for `Aspose.PDF.Drawing` 23.8.0 NET7

Hi, locally on my windows DEV machine everything works fine but I run my tests on Docker it fails with:

System.PlatformNotSupportedException: System.Drawing.Common is not supported on this platform.
at System.Drawing.Drawing2D.Matrix..ctor(Single m11, Single m12, Single m21, Single m22, Single dx, Single dy)
at #=zAG1avpWgnY1trpGKMwe1894KKNgR7VVrQQ==.#=zf2PfKCQL6SttK$59Rfn9rd8=(SizeF #=zDMIZvYg=)
at #=zAG1avpWgnY1trpGKMwe1894KKNgR7VVrQQ==.#=z30y3Ols=(SizeF #=zDMIZvYg=)
at #=zEVawX2lvBxn9Cqu1bQSRpfwobGsg4ULFdQ==.Render(#=zWNQB_34YtWomX1lN5bvaS6p_wCaD #=zWqj40kI=, CancellationToken #=z5pPoJMY=)
at #=zw6mS9TylrTjVvCqcWuXthylXxcOs$q0iGw==.#=zpivQScTE2dot(#=zWoKZNfiO2ifjOJVw3aWcuNo= #=zmBDZFu$8Hc93EHvBHw==, #=z4rOn3QFqiZG4_o5i3HLJIIlXv2CM[] #=zSmBdbqciCNIe, #=zWNQB_34YtWomX1lN5bvaS6p_wCaD #=zWqj40kI=, CancellationToken #=zDoyuSSY=)
at #=z1S_IWYpEo5ig_NJ8q6IWbzMQJuSl.Render(#=zWNQB_34YtWomX1lN5bvaS6p_wCaD #=zWqj40kI=, CancellationToken #=zDoyuSSY=, #=z2vZIJBbfj6tqWrcY5S$XX98=[] #=z0Gp0_As=, #=zW0IsLoPSPa05q6ambINzUzs=[] #=z9_lkGsI=)
at #=z1S_IWYpEo5ig_NJ8q6IWbzMQJuSl.Render(#=zWNQB_34YtWomX1lN5bvaS6p_wCaD #=zWqj40kI=, TimeSpan #=z95GV29I=, #=zW0IsLoPSPa05q6ambINzUzs=[] #=z9_lkGsI=)
at #=zE7yrKMmw4Af8XOSg4b63FsKzaXHB.Render(#=zWNQB_34YtWomX1lN5bvaS6p_wCaD #=zWqj40kI=, #=zAwicjNU= #=zB30oW38=, TimeSpan #=z95GV29I=)
at #=zE7yrKMmw4Af8XOSg4b63FsKzaXHB.Render(#=zWNQB_34YtWomX1lN5bvaS6p_wCaD #=zWqj40kI=, #=zAwicjNU= #=zB30oW38=)
at #=zPglRVwz7qJn5fxClc1CHSwOqsOYV.#=zRQL4DbyORCjg(Stream #=z2rvhxxa8qHPb, Document #=zkvm_m$IhOS9H, HtmlLoadOptions #=zXaETJcZdCQrX, String #=zMbzUewaU4Asj)
at #=zPglRVwz7qJn5fxClc1CHSwOqsOYV.#=z35zBNEU=(Stream #=z2rvhxxa8qHPb, Document #=zkvm_m$IhOS9H, HtmlLoadOptions #=zXaETJcZdCQrX, String #=zMbzUewaU4Asj)
at #=zPglRVwz7qJn5fxClc1CHSwOqsOYV.#=z35zBNEU=(Stream #=z2rvhxxa8qHPb, Document #=zkvm_m$IhOS9H, HtmlLoadOptions #=zXaETJcZdCQrX)
at Aspose.Pdf.Document.#=ztooJgw0=(Stream #=zacc7kJ8=, LoadOptions #=zecOrkt8=)
at Aspose.Pdf.Document..ctor(Stream input, LoadOptions options)

Relevant fragment of the Dockerfile:

FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
[...]
RUN apt-get update && apt-get install -y libgdiplus
RUN sed -i'.bak' 's/$/ contrib/' /etc/apt/sources.list
RUN apt-get update; apt-get install -y ttf-mscorefonts-installer fontconfig

I have tried changing the library to Aspose.PDF, of course it did not help.

Any ideas how to proceed?

@fchilvarguer

Could you please share your sample code snippet and complete docker file for our reference? We need to investigate this issue in details. We will log an investigation ticket and share the ID with you.

Unfortunately I cannot share the original code it is prioprietary, same with the full Dockerfile.
I will try to prepare small program outside of the commercial project to highlight the problem.

However, I think that possibly I gave you enough information to be able to reproduce the problem on your own. Other Dockerfile instructions are not relevant to the problem at hand and the documents we create are relatively simple so I also can’t see how they could be the source of the problem.

In the meantime I had to go back to 22.12.0 to make it work temporarily.
For this version it works fine, but I still would like to use the latest version of course.

Do you have any even potential solutions I could try on my own? Maybe other linux packages that I am missing or something?

Like expected it was quite straitghforward to reproduce in minimal example.
You need to
a) download the code
b) Add Aspose.PDF.lic.xml file, obviously I didn’t add mine since this is public forum
c) docker-compose up --build api
d) In browser http://localhost:4208/swagger/index.html and execute file/pdf endpoint
e) System.Drawing.Common is not supported on this platform. appearsproblem_reproduction.zip (7.4 KB)

@fchilvarguer

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): PDFNET-55361

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.

What is the status of this ticket, please?
Is there any way I could help?

@fchilvarguer

The ticket has been logged recently and we are afraid that it has not been yet resolved. We will resolve it on a first come first serve basis and as soon as we have some updates in this regard, we will inform you. Please be patient and spare us some time.

We are sorry for the inconvenience.

@fchilvarguer

The issue can be reproduced on Aspose.PDF.Drawing 23.8, but can not on 23.9, you should please update to the latest version.

Thanks.
I confirm that the new version works fine again.
Cheers.

@fchilvarguer

Its good to hear that. Please feel free to create a new topic in case you face any issues.