PDFsharp & MigraDoc Foundation

Using PDFSharp (PDF Core) with Unity on macOS
Page 1 of 1

Author:  gracecr [ Wed Mar 13, 2019 1:17 pm ]
Post subject:  Using PDFSharp (PDF Core) with Unity on macOS

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/Gpwbxs2V

Looking at the Initialize function here: https://github.com/empira/PDFsharp/blob ... PdfPage.cs
it 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?

I've had what I think to be a some progress. Using
Scripting Runtime Version: .NET 4.x Equivalent
Api Compatibility Level: .NET 4.x
, and Mono 5.11.0's System.Drawing implementation, I now get the following error: https://pastebin.com/2CBJWgQk

Looks like if I can get it to find libgdiplus.dylib, then it should work.

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.

For IOS, be sure to include a link.xml file that prevents stripping from the PdfSharpCore assembly. Images don't appear to be working.

Author:  ronjart [ Mon Dec 02, 2019 8:51 pm ]
Post subject:  Re: Using PDFSharp (PDF Core) with Unity on macOS

Hey there and thank you for the insights. I'd love any pointers you could give me in regards to the custom FontResolver and ImageSource to make pdfSharpCore play nice with unity on macOS.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group