PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Apr 19, 2024 11:20 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Sat Jul 09, 2016 12:18 pm 
Offline

Joined: Sat Jul 09, 2016 12:08 pm
Posts: 4
I have the following code:
Code:
            Paragraph para = row.Cells[0].AddParagraph();
            // the character ☎ is unicode \u260E
            para.AddFormattedText("\u260E", h2);


The character \u260E should appear as a phone ☎. Instead it is appearing as an empty box. When I use the following code:
Code:
            Paragraph para = row.Cells[0].AddParagraph();
            // the character ☎ is unicode \u260E
            para.AddText("\u260E");


It instead appears as a box with a question mark inside. Is there a way to render the character correctly?

Thanks for any help,
whossname


Top
 Profile  
Reply with quote  
PostPosted: Sat Jul 09, 2016 12:21 pm 
Offline

Joined: Sat Jul 09, 2016 12:08 pm
Posts: 4
Forgot to mention, I am rendering the document like this:

Code:
        private static MemoryStream WriteFile (Document doc)
        {
            // render
            PdfDocumentRenderer renderer = new PdfDocumentRenderer(true,
                    PdfSharp.Pdf.PdfFontEmbedding.Always);
            renderer.Document = doc;
            renderer.RenderDocument();

            // create stream
            MemoryStream stream = new MemoryStream();
            renderer.PdfDocument.Save(stream, false);
            return stream;
        }


Top
 Profile  
Reply with quote  
PostPosted: Sat Jul 09, 2016 1:05 pm 
Offline
PDFsharp Expert
User avatar

Joined: Wed Dec 09, 2009 8:59 am
Posts: 340
Hi!

Make sure you are using a font that contains that character.
It should work with "Segoe UI Symbol", but not with "Segoe UI".

_________________
Öhmesh Volta ("() => true")
PDFsharp Team Holiday Substitute


Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 11, 2016 6:56 am 
Offline

Joined: Sat Jul 09, 2016 12:08 pm
Posts: 4
Thank you so much, that worked immediately.


Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 11, 2016 6:57 am 
Offline

Joined: Sat Jul 09, 2016 12:08 pm
Posts: 4
Also thanks for the quick reply, I wasn't expecting a quick response so I left it for a few days. Only just noticed how quick you were.


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

All times are UTC


Who is online

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