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

Incorrect font in my PDF
https://forum.pdfsharp.net/viewtopic.php?f=2&t=1108
Page 1 of 1

Author:  complym [ Tue Mar 23, 2010 2:29 pm ]
Post subject:  Incorrect font in my PDF

Hi all.

I've got a bit of a strange problem. I've been searching for idea's for over a day now so was just wondering if you had any ideas on here. I'm using MigraDoc to create my PDF document using "Gill Sans MT" as my font. When I run the site locally on my machine and create the PDF it all works perfectly. However when I put it on my server and run it on there (Windows Server 2008) it's not using the right font. I've installed the whole font family to the server and also when I create my PDF document render object, I am setting it to embed fonts. Gill Sans MT is not a unicode font as far as I can find out which is why I've set the bool to false. Is this correct? Or am I misunderstanding the parameters?

Code:
MigraDoc.Rendering.PdfDocumentRenderer pdfRender = new MigraDoc.Rendering.PdfDocumentRenderer(false, PdfSharp.Pdf.PdfFontEmbedding.Always);


The PDF created on the server uses Arial and so as well as the font being wrong, the spacing is also wrong and has overlaps. Any ideas?

Thanks,
Sarah

Author:  Thomas Hoevel [ Tue Mar 23, 2010 5:07 pm ]
Post subject:  Re: Incorrect font in my PDF

Hi!

Is the application running on the server with full trust?

AFAIK you either need private fonts or full trust for server applications.

Author:  complym [ Wed Mar 24, 2010 2:52 pm ]
Post subject:  Re: Incorrect font in my PDF

Hi Thomas,

Thanks for your reply. I'll give your suggestions a try and let you know if I have any luck.

Thanks again,
Sarah

Author:  RichardD [ Tue May 25, 2010 4:16 pm ]
Post subject:  Re: Incorrect font in my PDF

I'm having a very similar issue with PDFSharp 1.31.1789.0 (GDI+ build):

My ASP.NET application is running with full trust;
On my workstation, running under IIS7.5, the correct font is embedded;
On the server, running as a console application, the correct font is embedded;
On the server, running under IIS6, the wrong font is embedded;

I've tried running the AppPool as Local System or Administrator, which makes no difference. I've tried restarting the AppPool, and even restarting IIS, but I'm still getting the wrong font embedded.

Once I get a chance, I'm going to try rebooting the server. MSDN seems to indicate that fonts installed via Remote Desktop are not available to other sessions until the server is rebooted:
http://msdn.microsoft.com/en-gb/library/dd144833.aspx

Author:  RichardD [ Tue May 25, 2010 5:30 pm ]
Post subject:  Re: Incorrect font in my PDF

I've just rebooted the server, and the fonts are now working. Don't know if this was the same problem as the original post, but hopefully it might help someone - even if it's just me next time I install new fonts on the server! :D

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