jmanm / PDFsharp-netstandard2.0

PDFSharp for .NET Standard 2.0
MIT License
17 stars 4 forks source link

'System.Drawing is not supported on this platform' when instantiating XFont in Xamarin.Forms UWP #11

Open mohitatray opened 4 years ago

mohitatray commented 4 years ago

I am using this library in Xamarin.Forms common project. I have added a UWP project in my solution. When I run my UWP app and try to instantiate XFont, I get the following exception --

Exception thrown: 'System.PlatformNotSupportedException' in System.Drawing.Common.dll
An exception of type 'System.PlatformNotSupportedException' occurred in System.Drawing.Common.dll but was not handled in user code
System.Drawing is not supported on this platform.

The exception occurs at this line -- var xFont = new XFont("Helvetica", 12, XFontStyle.Regular); I have added this nuget package in both the common project and the UWP project.

Expected behaviour: No exception should occur. Actual behaviour: Exception occurs.