PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Apr 18, 2024 6:32 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: Mon Aug 31, 2015 8:19 pm 
Offline

Joined: Mon Aug 31, 2015 7:48 pm
Posts: 1
I am new to PDFSharp and MigraDoc and frustrated with getting my font to render the PDF correctly. It works perfectly as a console application using C# .Net 3.5 and 1.32 of MigraDoc. However, when running it in a .Net web application, it shows the correct font is embedded but it is not rendered using the correct font. I don't get any errors. I have read the FAQs around the web trust level and using a font resolver but I am unclear on how to make this work. Can anyone please help to clarify what i need to do to make this work?


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 01, 2015 8:01 am 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 914
Location: CCAA
There is no FontResolver with version 1.32.

Make sure the required fonts are installed on the web server and also make sure your application has sufficient privileges to access those fonts.
When PDFsharp tries to access a font that is not available, the system will return MS Sans Serif without an error message and PDFsharp does not even know it got the wrong font and the PDF file shows the wrong font name.

Alternative: use the WPF build of PDFsharp 1.32, add the fonts to your application and add them to the XPrivateFontCollection.
There is a working sample in the source code package.
See also:
http://pdfsharp.net/wiki/PrivateFonts-sample.ashx

Or use PDFsharp 1.50 beta (WPF) with a FontResolver.

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
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: No registered users and 63 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