Testing on an asp.net application in Mono/OSX/Sierra with Aspose Slides version 17.7.
If I create a blank PPTX (single slide, containing a single shape only) in powerpoint on OSX, then try the following:
Presentation sourcePPT = new Presentation(filePath);
for (var i = 0; i < sourcePPT.Slides.Count; i++)
{
Image image = sourcePPT.Slides[i].GetThumbnail(1f, 1f);
image.Save($"Media/Thumbs/{i}.png", ImageFormat.Png);
}
I receive the error: “Cannot find any fonts installed on the system.”
I then tried explicitly defining the font location:
FontsLoader.LoadExternalFonts(new string[] { "/Library/Fonts" });
Presentation sourcePPT = new Presentation(fileInfo.FullName);
for (var i = 0; i < sourcePPT.Slides.Count; i++)
{
Image image = sourcePPT.Slides[i].GetThumbnail(1f, 1f);// SaveAsImage();
image.Save($"Media/Thumbs/{i}.png", ImageFormat.Png);
}
And receive the error: “An item with the same key has already been added.”:
in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/throwhelper.cs:72 at System.Collections.Generic.Dictionary
2[TKey,TValue].Insert (TKey key, TValue value, System.Boolean add) [0x0007c] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/collections/generic/dictionary.cs:336 at System.Collections.Generic.Dictionary2[TKey,TValue].Add (TKey key, TValue value) [0x00000] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/collections/generic/dictionary.cs:192 at Aspose.Slides.FontsLoader.
I presume I receive this second error because it is already aware of the fonts in the /Library/Fonts path. But then I don’t understand why I’m receiving the first error.
I also tried copying all fonts in /Library/Fonts to a new directory, and setting that directory in LoadExternalFonts but that produced the same error.
The fonts under /Library/System are whatever the default are on a new OSX Sierra machine (it’s a clean install from a few days ago)
Can you help?