Free Support Forum - aspose.com

Exception: PlatformNotSupportedException on loading presentation (C#)

I have a Aspose.Total license which has worked out well until I started using Slides.
When trying to initialize a .pptx file, Im getting an exception suggesting that the .net platform is not supported.

The source file object is verified good and can be processed by competitor APIs.
I have need to use Aspose.Slides with Azure Cloud Functions. (.net 2)
Can I get a confirmation that the exception is a bug or not?

USING:
C#
.NETStandard 2.0.3
Aspose.Slides.NET 19.12.0

CODE:
using Aspose.Slides;
// MemoryStream loaded with TestSlide.pptx
Presentation Presentation = new Presentation(MemoryStream); //Exception thrown

EXCEPTION:
Aspose.Slides.PptxReadException: System.Drawing is not supported on this platform. —> System.PlatformNotSupportedException: System.Drawing is not supported on this platform.
at System.Drawing.Image.FromStream(Stream stream)
at Aspose.Slides.ImageCollection.( ​ )
at .(​ )
at .(​ )
at .( , IPresentation )
at .(Presentation , Stream , InterruptionToken )
— End of inner exception stack trace —
at .(Presentation , Stream , InterruptionToken )
at Aspose.Slides.Presentation.(Stream , Boolean )
at Aspose.Slides.Presentation.(Stream , Boolean )
at Aspose.Slides.Presentation.(Stream )
at Aspose.Slides.Presentation…ctor(Stream stream)
at Project.Extract.Run(HttpRequest req, ILogger log) in C:\base\APIs\Extract.cs:line 145

TestSlide.pptx

@overunity,

I have observed the issue shared by you and request you to please share the source presentation reproducing the issue on your end so that we may use that on our end to help you further.

Hi, thank you for response!
This forum does not accept .pptx uploads and its also 12mb.
Instead, i have added a link at the bottom of the original post. Please see file “TestSlide.pptx”.

It has 5 slides in it. no confidential data. just a test file with common PPT objects.

@overunity,

Yes, you are right. You can please share the requested information by uploading on some file server, Google drive or Drop box. You can provide the download to us then.

Thank you.
Please see the bottom of the original post where the file is linked.

I will also provided it below.
TestSlide.pptx

@overunity,

I have seen the presentation open in a web viewer. However, I am unable to open download or test tat as I have only read only rights.

To download, use the FILE > DOWNLOAD AS
You may then scan and validate it as a safe file, and test it within your code to reproduce the error.

The file is locked so that it remains intact to anyone that reads this thread and uses the link.

Thank you!
-Support

@overunity,

I have tried accessing the sample file on my end using Aspose.Slides for .NET 19.12 and have not been able to observe any issue. In your code, I have observed that you are loading the presentation using MemoryStream. Can you please confirm if you are setting the stream position to 0 before loading using Presentation object.

image.png (12.4 KB)

can you also share an image with the SDK .net framework you are testing with?
this issue is specifically for .NETStandard 2

Also, i have verified that .pptx files will not load from local path or stream objects. And the stream position is at 0. It will not initialize the presentation object.

@overunity,

I have tested using latest version Aspose.Slides for .NET 20.1 in .NET Standard 2.0 based application as well and have not been able to observe the issue. If you still face issue using latest version then please provide the sample project reproducing issue on your end.