PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Jul 18, 2024 12:24 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Incorrect font in my PDF
PostPosted: Tue Mar 23, 2010 2:29 pm 
Offline

Joined: Wed Feb 10, 2010 3:49 pm
Posts: 10
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


Top
 Profile  
Reply with quote  
PostPosted: Tue Mar 23, 2010 5:07 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
Hi!

Is the application running on the server with full trust?

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

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Wed Mar 24, 2010 2:52 pm 
Offline

Joined: Wed Feb 10, 2010 3:49 pm
Posts: 10
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


Top
 Profile  
Reply with quote  
PostPosted: Tue May 25, 2010 4:16 pm 
Offline

Joined: Thu Oct 16, 2008 1:54 pm
Posts: 14
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


Top
 Profile  
Reply with quote  
PostPosted: Tue May 25, 2010 5:30 pm 
Offline

Joined: Thu Oct 16, 2008 1:54 pm
Posts: 14
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


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

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 35 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