PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Mar 28, 2024 2:53 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Mon Feb 25, 2013 1:31 pm 
Offline

Joined: Mon Feb 25, 2013 12:26 pm
Posts: 1
Hi!
I had to develop a software to create pdf runtime.
My problems are the loading of external fonts;

Code:
XPrivateFontCollection privateFontCollection = XPrivateFontCollection.Global;
        Uri fontUri = new Uri(MappedApplicationPath + "public\\fonts\\");

LoadPrivateFont(privateFontCollection, fontUri, "./FRE3OF9X.ttf");
// Set font embedding to Always
        XPdfFontOptions options = new XPdfFontOptions(PdfFontEncoding.Unicode, PdfFontEmbedding.Always);

 protected void LoadPrivateFont(XPrivateFontCollection privateFontCollection, Uri fontUri, string sFontFamilyname)
    {
        //Every font must be added to the global font collection.  There is probably some better way to do this but this was the only method that seemed to work when deploying to any server.
        //If the font has previously been added it will just error out and continue, this does not matter.
        //try
        //{
        privateFontCollection.AddFont(fontUri + sFontFamilyname);
        //privateFontCollection.Add(fontUri, sFontFamilyname);
        //}
        //catch
        //{
        //}
    }


But this does not work...
Help me.
Thanks


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

All times are UTC


Who is online

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