user24241471
user24241471

Reputation: 13

Create thumbnails from ppt slide cross platform in C#

I want to create thumbnails from ppt slide my code is working on windows but not working on non-Windows OS.

Please help me with pure cross platform code.

System.Drawing is not supported for non-Windows OS.

My code is:

for (int j = 0; j < pr.Slides.Count; j++)
{
    ISlide sld pr.Slides[j];

    using (Bitmap bmp sld.GetThumbnail (1f, 1f))
    {
         using (MemoryStream ms = new MemoryStream())
         {
             bmp.Save(ms, System.Drawing.Imaging.ImageFormat.png);
             byte[] imageBytes = ms.ToArray();
             string base64String = Convert.ToBase64String(imageBytes);
             slides.Add(new slideModel { SlideNumber = j, SlideImage = base64String });
         }
    }
}

Please help me with SkiaSharp or any recommended opensource cross platform library.

Upvotes: 0

Views: 26

Answers (1)

Andrey P.
Andrey P.

Reputation: 34

You should use Aspose.Slides.NET6.CrossPlatform. Please note that Aspose.Slides.NET6.CrossPlatform requires GLIBC 2.23 and higher for Linux systems. For macOS, the fontconfig package has to be installed. I am working as a support developer at Aspose.

Upvotes: 0

Related Questions