Hey folks,
I'm trying to use the latest PDFSharp (1.51.5162-beta) with Unity, though I'm having some issues with the macOS build. When I make a call to PDFSharp.AddPage() on macOS, I received the following stack trace:
https://pastebin.com/Gpwbxs2VLooking at the Initialize function here:
https://github.com/empira/PDFsharp/blob ... PdfPage.csit seems as if PageSize must be null, but that doesn't make any sense to me.
As a side note, I've heard that PDFSharp uses System.Drawing, and that there may be some issues with compatibility. As far as I'm aware, installing mono-libgdiplus should resolve any issues with System.Drawing compatibility. I've also heard that it's possible to use System.Drawing.Common for greater compatibility.
Has anyone been able to get PDFSharp to work on macOS? If so, would you mind describing your setup?
EDIT:I've had what
I think to be a some progress. Using
Code:
Scripting Runtime Version: .NET 4.x Equivalent
and
Code:
Api Compatibility Level: .NET 4.x
, and Mono 5.11.0's System.Drawing implementation, I now get the following error:
https://pastebin.com/2CBJWgQkLooks like if I can get it to find libgdiplus.dylib, then it should work.
EDIT2:Good news and bad news. Bad news is I wasn't able to get PDFSharp (PDF Core) working on OSX with Unity. I think that there must be some way to get Unity and libgdiplus to work together nicely, but I can't seem to find it. For System.Drawing.Common, I couldn't figure out which DLL's I need where.
Good news is I was about to get
PdfSharpCore working, though I did have to make my own FontResolver and ImageSource. If anyone is working on something similar, I'd be happy to help them out.
EDIT3:For IOS, be sure to include a link.xml file that prevents stripping from the PdfSharpCore assembly. Images don't appear to be working.