.NET Core 2 adding image to paragraph fails on macOS


#1

Hi,
The code that I use to add an image in a pdf document raises an exception when I run it under MacOS.
“Invalid image stream (The type initializer for ‘Gdip’ threw an exception.)”

I’ve created a sample project with VisualStudio for Mac that illustrates the problem.
Please clone this repo https://github.com/ntodorov/aspose_example
Rebuild and run.

What should I change?

=== Visual Studio Community 2017 for Mac ===

Version 7.5.3 (build 7)
Installation UUID: 0c6c30a2-1c1b-4e74-8fef-d07a14dfc864
Runtime:
Mono 5.10.1.47 (2017-12/8eb8f7d5e74) (64-bit)
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 4.4.1.178 (master / eeaeb7e6)

Package version: 510010047

=== NuGet ===

Version: 4.3.1.4445

=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
2.0.5
2.0.0
SDK: /usr/local/share/dotnet/sdk/2.1.4/Sdks
SDK Versions:
2.1.4
2.0.0
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.10.1/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.6.1
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Apple Developer Tools ===

Xcode 9.4.1 (14161)
Build 9F2000

=== Xamarin.Mac ===

Version: 4.2.1.29 (Visual Studio Community)

=== Xamarin.iOS ===

Xamarin.iOS not installed.
Can’t find mtouch or the Version file at /Library/Frameworks/Xamarin.iOS.framework/Versions/Current.

=== Xamarin.Android ===

Not Installed

=== Xamarin Inspector ===

Version: 1.4.0
Hash: b3f92f9
Branch: master
Build date: Fri, 19 Jan 2018 22:00:34 GMT
Client compatibility: 1

=== Build Information ===

Release ID: 705030007
Git revision: 13cecd02aceddf29a1ed57b86f81c02994df1483
Build date: 2018-06-14 15:48:08-04
Xamarin addins: 7065de97cf22c9038fdc39dd627f2c30790fd8af
Build lane: monodevelop-lion-d15-7

=== Operating System ===

Mac OS X 10.13.5
Darwin 17.6.0 Darwin Kernel Version 17.6.0
Tue May 8 15:22:16 PDT 2018
root:xnu-4570.61.1~1/RELEASE_X86_64 x86_64


#2

@niktv

Thanks for contacting support.

We are constantly working over improving the .NET Core support in our API. However, there are some operations which we recommend in order to avoid such issue that you are facing. Would you please try your scenario again after installing libgdiplus package and Microsoft Core Fonts in your device. In case you still face any issue, please let us know. We will further proceed to help you out.


#3

My understanding is that ligdgiplus is installed with the Mono project, I saw it on the installation list when i reinstalled Mono. If you give me steps to verify that I will do it and report back.
Microsoft Core fonts - for macOs i’ve googled that they are there, and potentially updated with the installation of MS Office for MacOs and I have that too. Again if you give me steps to verify installation I will do that and report it.


#4

@niktv

Thanks for your feedback.

We have logged an investigation ticket as PDFNET-45054 in our issue tracking system. We will further investigate the scenario and in case of any further progress and update, we will surely inform your within this forum thread. Please be patient and spare us little time.

We are sorry for the inconvenience.