PDFsharp & MigraDoc Foundation
http://forum.pdfsharp.de/

Private font works locally, but not at web site
http://forum.pdfsharp.de/viewtopic.php?f=2&t=2364
Page 1 of 1

Author:  Magwill [ Tue Mar 12, 2013 8:55 pm ]
Post subject:  Private font works locally, but not at web site

I realize that there is no support for private fonts with GDI+ and PDFSharp after reading some threads here and also checking out the source code.

However when I checked out the .NET classes used in the code I saw that there was .NET support for loading fonts. I'm talking about this method: http://msdn.microsoft.com/en-us/library ... tfile.aspx

So basically I just made a call to that and downloaded a random font that I would be sure my friends did not own and I added the font using this method and set the embedding options to Always when creating the XFont. The font was loaded correctly and when I sent the PDF to my friends they could see the text in the font that they did not have installed.

Perfect I thought, and uploaded the code to my web hosting. Unfortunately, the PDF comes back with some default font set. Since I can't debug the site at the web hosting service I put some logging into it. It seems the font is loaded and the XFont is created with the correct name etc. The fonts are even embedded when I check the fonts of the generated PDF.

I've made sure I only add the font once. I'm running an ASP.NET MVC3 site and it's running .NET 4.0.

Anyone got any ideas of what it could be? I'm at a total loss.

Thanks

Author:  Thomas Hoevel [ Wed Mar 13, 2013 9:50 am ]
Post subject:  Re: Private font works locally, but not at web site

Is your program running "full trust" on the server? AFAIK this is still required to embed fonts.

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