Saving Slide to PNG Using Aspose.Slides for .NET on Linux Results in Exception

Good morning Aspose team,
Having the issue with last update of Aspose.Slides 23.6 when asking for Png for whole slide:

after doing this:

using var bitmap = slide.GetThumbnail(scaleFactor, scaleFactor);
var ms = new MemoryStream();
bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Png); // this throws exception now

Seeing this exception on Linux (Windows works fine):
System.Drawing.Common is not supported on this platform.

How can I avoid this.

Since earlier version of Aspose.Slides (23.3) we have enabled System.Drawing.EnableUnixSupport
and also installed SkiaSharp - but it seems not to help any more:

Thanks for answer.

Best regards

Thank you for describing the issue.

Please share the following additional files and information:

  • input presentation file
  • Linux version on which the error occurs
  • .NET target platform in your app
  • full stacktrace of the exception

Dear Aspose,
sending simple console application which throws mentioned exception:
System.PlatformNotSupportedException: 'System.Drawing.Common is not supported on this platform.'

I am running Linux distribution of Ubuntu 18.04

Here is how it behaves with latest update (23.6) (250.6 KB)

FYI for two different settings in csproj - first will work, second not:

<PackageReference Include="Aspose.Slides.NET" Version="23.5.0" /> // this works
<PackageReference Include="Aspose.Slides.NET" Version="23.6.0" /> // this fails

Code fails:

public void Convert()
    //Instantiate a Presentation class that represents the presentation file
    var file = Path.Combine("Files","Presentation.pptx");
    using Presentation pres = new Presentation(file);

    ISlide sld = pres.Slides[0];
    var shape = sld.Shapes[0];

    //Create a memory stream object
    MemoryStream svgStream = new MemoryStream();
    //Generate SVG image of slide and save in memory stream
    **shape.WriteAsSvg(svgStream);** // This throws exception

Thanks in advance

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): SLIDESNET-44085

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.

Thank you @andrey.potapov for keeping us posted.

Thank you for using Aspose.Slides.

A post was split to a new topic: Aspose.Slides for .NET 23.6 Requires Manually Importing DLL

The sample project you provided includes Aspose.Slides for .NET via NuGet. The Aspose.Slides NuGet package is not suitable because it provides cross-platform support for only the .NET Standard.

Please delete the Aspose.Slides NuGet package and follow the instructions below to configure your project using Aspose.Slides from the ZIP package:

Please also note that the following packages must be installed on your operating system.

  • libfontconfig1
  • libfreetype6

Please let us know if the issue is resolved on your end.