Invalid image stream (The type initializer for 'Gdip' threw an exception.) - Aspose.PDF

I am getting an error when processing a PDF:

Invalid image stream (The type initializer for ‘Gdip’ threw an exception.)
Value cannot be null. (Parameter ‘fileContents’)

The code does work on Windows.

We are deploying this .net 6 app onto a Linux machine which runs .net apps through Docker.

What can we do to make this work on the docker based machine?

I tried to install libgdiplus and ttf-mscorefonts.

What can be done to make this work. The latest version of Aspose.PDF is being used. .Net Core 6. PDF has header and footer image.

To confirm the PDF output does work on the Windows machine.


We already logged an issue to test Aspose.PDF functionality under .NET 6.0 in non-Windows environments as PDFNET-50918. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

A post was split to a new topic: Aspose.PDF is not working with .NET 6.0 version

What is the status of this problem? When is the decision expected?

I have the same problem when adding an HtmlFragment with a image to a PDF


The ticket was resolved. Aspose.PDF.Drawing Nuget package was released. DLL in this package doesn’t have System.Drawing.Common dependency. Please use it instead of Aspose.PDF for .NET and let us know in case you face any issues.