Aspose.Pdf.Document Background Property throws Exception under Linux

asposepdf.PNG (88,9 KB)

If I create an empty pdf document in .NET 8 under Linux (see picture of my simple app in .NET Fiddle online C# compiler) an exception is thrown when computing the Background Property of the Pdf Document. It appears, it uses System.Drawing.Common which is not supported on non-Windows platforms (.NET Fiddle also runs in Linux). I observed the same behaviour in my Docker Container on my dev machine with a simple console app. If I run the app under Windows it’s all ok, if I run it with docker I get the same error. I tried adding Aspose.Drawing, Aspose.Drawing.Common, Aspose.Imaging, Aspose.Drawing.Imaging packages and “using” statements, nothing helped.
In my Dockerfile I also install the necessary packages but it is still not working. This is my dockerfile

FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base

RUN apt-get update && apt-get install -y cifs-utils iputils-ping libsecret-1-0 libsecret-1-dev gnome-keyring libsecret-tools libfontconfig1 libcairo2-dev fonts-dejavu-core libgdiplus libc6-dev libx11-dev libx11-6 libx11-data libx11-xcb1 libxrender1 libxext6 fontconfig

@mirkolugano

Please create a new application and install only Aspose.Pdf.Drawing instead of Aspose.PDF for .NET and check if issue still persists. Please let us know about the results you got.

yes it has worked thank you.
More than that, I was having trouble also with accessing images within a PDF and performing optimizations like image compression on a pdf.
Simply removing the Aspose.NET nuget package did the trick and solved all the problems, since all were caused by System.Drawing.Common.
Thanx, best regards.

@mirkolugano

Its nice to know that your issue has been resolved. Please keep using our API and feel free to create a new topic in case you need any kind of assistance.