PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Wed Jul 17, 2024 7:36 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
 Post subject: Embed Font (again)
PostPosted: Wed Mar 27, 2013 11:00 am 
Offline

Joined: Wed Mar 27, 2013 10:55 am
Posts: 1
Hey there,

as usual, there are a lot of posts on this in the web and in this forum, but none of this helped... I use Windows and Migradoc Version = "1.32.3885.0"
To generate a pdf i create a document.
Code:
var doc = new MigraDoc.DocumentObjectModel.Document();

then i define the style for the document with a font
Code:
var style = doc.Styles["Normal"];
style.Font.Name = "Adobe Fan Heiti Std B";

then i add my sections, paragraphs, etc. and print the pdf as follows
Code:
var printer = new PdfDocumentRenderer {Document = doc};
printer.RenderDocument();
printer.Save(filePath);

This works fine. However, from the designer i got another font, which was not installed on my pc. I installed the .otf files (it is HelveticaNeueLTStd-Cn.otf and two other versions of HelveticaNeueLT). I can use the new installed fonts in all programs (e.g. MSWord) but i cannot use them in my document. I get the Error
Cannot get a matching glyph typeface for font 'HelveticaNeueLT Std Cn'.
I can load the font directly from c# (not the installed one, but the source)
Code:
var tf = new GlyphTypeface(new Uri(@"C:\temp\HelveticaNeueLTStd-Cn.otf", UriKind.Absolute));

but i don't know how to embed it to my Migradoc Document...
So the question is: How to use an .otf font in a MigraDoc Document to generate a pdf (on a Windows maschine)?

Thanks.
PS: also posted on http://stackoverflow.com/questions/15657083/embedding-font-in-migradoc


Top
 Profile  
Reply with quote  
 Post subject: Re: Embed Font (again)
PostPosted: Wed Mar 27, 2013 12:26 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
Answered on http://stackoverflow.com/a/15657546/162529

_________________
Regards
Thomas Hoevel
PDFsharp Team


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: Bing [Bot] and 14 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