PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Aug 09, 2020 2:15 pm

All times are UTC

Forum rules

Please read this before posting on this forum: Forum Rules

Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Wed Mar 13, 2019 1:17 pm 

Joined: Tue Mar 12, 2019 8:18 pm
Posts: 1
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.

Reply with quote  
PostPosted: Mon Dec 02, 2019 8:51 pm 

Joined: Mon Dec 02, 2019 8:48 pm
Posts: 1
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.

Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC

Who is online

Users browsing this forum: Google [Bot] and 11 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group