GroupDocs.Conversion error when converting Excel or Powerpoint on Linux

Hi,

We have been having issues attempting to convert documents using latest stable GroupDocs DLL version 23.8. We are running dotnet core version 6.0.

We are getting an exception when attempting to convert an Excel document to PDF or a Powerpoint document to PDF using GroupDocs. We are running the conversion process in Linux.

When we run the conversion process in Windows (the development environment is Windows, the runtime environment is Linux) we do not see the error and the document is successfully converted. Also, Word documents are converted successfully on Linux.

Here is the stack trace of the error for Excel files:

Result: Conversion error

Exception: GroupDocs.Conversion.Exceptions.GroupDocsConversionException: The type initializer for 'Gdip' threw an exception.

at d.()

at GroupDocs.Conversion.Converter.()

at GroupDocs.Conversion.Converter.Convert(Func`1 document, Action`2 documentCompleted, ConvertOptions convertOptions)

Here is the stack trace of the error for Powerpoint files:

Result: Failed to convert PowerPoint document to pdf.

Exception: GroupDocs.Conversion.Exceptions.GroupDocsConversionException: The type initializer for 'Gdip' threw an exception.

at d.()

at GroupDocs.Conversion.Converter.()

at GroupDocs.Conversion.Converter.Convert(Func`1 document, Action`2 documentCompleted, ConvertOptions convertOptions)

We have come across this page in your support - The type initializer for 'Gdip' threw an exception while PDF to tiff conversion on Ubuntu container .NET 5.0 - #7 by piotr.paszko. We think that we have a similar issue. However, we are running the document conversion in an Azure function on Linux. Do you have any advice on how to resolve this issue in a Azure function environment? The page linked above describes a possible solution for a Docker container running Linux.

Many thanks

@perivan
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): CONVERSIONNET-6301

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.

@perivan

The reason for this “Gdip” error is a missing “libgdiplus” package on the Linux machine. We would suggest to try to run the application in Linux docker container first (using these guidelines)

If you run the app in a native Linux environment, you have to install following:

RUN apt-get update && apt-get install -y ffmpeg libgdiplus

RUN sed -i'.bak' 's/$/ contrib/' /etc/apt/sources.list
RUN apt-get update; apt-get install -y ttf-mscorefonts-installer fontconfig
RUN fc-cache -f -v

The code may be different depending on the Linux distribution you are using, but the core is to have libgdiplus installed.
Please let us know if issue persists.