PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

GDI+ initialise with Core PDF 1.50 on MacOSX and Mono
https://forum.pdfsharp.net/viewtopic.php?f=2&t=3143
Page 1 of 1

Author:  silver [ Fri Jul 10, 2015 10:00 am ]
Post subject:  GDI+ initialise with Core PDF 1.50 on MacOSX and Mono

I'm trying to use PDFSharp and MigraDoc within a Mono project on OS X. Using the Core PDF version 1.50 beta available through NuGet (3638), I'm able to set a custom FontResolver (as per Alex's page at http://www.alex-maz.info/pdfsharp_150 ) and it totally works but..

There's an issue with Mono on OS X when using any methods which initialise GDI+ - it causes the font cache to be updated which can lead to a delay of seconds to minutes before execution resumes. This is something that has caused us issues in the past, on some Mac systems this wait is significant and we need a way to avoid this happening(!)

The GDI+ initialisation issue triggered using the Core PDF verions 1.50 (and using a custom FontResolver), which appears to suggest somewhere in PDFSharp or MigraDoc there is some use of GDI+ methods. I could be completely wrong, it might be to do with opening TTF fonts, so I tried replacing the TTF font with OTF ones but they didn't load.

If the source code for 1.50 is available it would really help resolve this issue, unless you have any ideas on how to stop *any* GDI+ initialisation happening?

Keep up the great work guys! :)

Many Thanks,
Dave

Author:  () => true [ Fri Jul 10, 2015 10:57 am ]
Post subject:  Re: GDI+ initialise with Core PDF 1.50 on MacOSX and Mono

We use PDFsharp 1.50 in our Silverlight applications and have no problems (I assume one cannot use GDI+ under Silverlight).

I cannot say when the source code for version 1.50 will be publicly available.

Does the problem already occur with a simple Hello World program?
If not, add more features (e.g. JPEG images, non-JPEG images, ...) until you know what invokes GDI+.

Author:  silver [ Fri Jul 10, 2015 11:31 am ]
Post subject:  Re: GDI+ initialise with Core PDF 1.50 on MacOSX and Mono

Thanks Öhmesh,

It is a puzzling one, there's some interaction with Mono or MacOSX I suspect and it seems to be something inside migradoc rather than pdfsharp, I've been able to create PDF document with some text in (loading the font correctly) without issues now.

The gdi+ / font cache initialisation slowdown happens as a result of a call to MigraDoc.PdfDocumentRenderer

Thanks,
Dave

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/