I was redirected to this subforum from Aspose.PDF, where similar problem took place, but was solved by linking another library (Aspose.PDF.Document throws "The type initializer for 'Gdip' threw exception"). But now we need solution for Slides.
While trying to generate PDF with PPT we get the exception:
The type initializer for ‘Gdip’ threw exception
var loadOptions = new Aspose.Slides.LoadOptions();
loadOptions.LoadFormat = LoadFormat.Ppt;
var presentation = new Aspose.Slides.Presentation(filePath, loadOptions);
presentation.Save (newPath, Aspose.Slides.Export.SaveFormat.Pdf); // <-- error "Gdip" line
On windows that code works perfectly. Supposedly, error occurs because of “System.Drawing” usage, instead of Aspose.Drawing in Slides.
Need help and/or workaround.
Aspose.Slides 22.12.0
.NET 6.0
OS: Ubuntu 20.04