PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Apr 25, 2024 11:07 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Mon Sep 28, 2015 2:28 pm 
Offline

Joined: Mon Sep 28, 2015 2:26 pm
Posts: 2
I am using the MigraDoc ( WPF build ) dll's for generating a pdf and i have added the code given below that does the work of adding a new private font :

XPrivateFontCollection pfc = XPrivateFontCollection.Global;
Uri myuri = new Uri(Server.MapPath("/Assets/Rupee_Foradian.ttf"));
pfc.Add(myuri, "./#Rupee Foradian");

The pdf generates successfully with the font loading properly and displaying as expected, but when i try for the second time to create the pdf i get an ArgumentException: An entry with the specified family name already exists

Can anyone please help me out on this issue ?


Top
 Profile  
Reply with quote  
PostPosted: Mon Sep 28, 2015 2:33 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
Answered here:
http://stackoverflow.com/a/32825580/162529

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Mon Sep 28, 2015 2:38 pm 
Offline

Joined: Mon Sep 28, 2015 2:26 pm
Posts: 2
Thomas Hoevel wrote:


Hey thanks for the answer, but can you please also show me how to go about adding it only once and not every time when the document is being generated ?


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 299 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