Display euro sign (€) in PDF document

Hi,

I'm trying to display a euro symbol within a PDF document.
However the symbol is displayed as ¬ instead of €.
The $ and ¥ are displayed properly.

Below you can find a small code snippet:

-----------------------------------------------
PdfDocument document = new PdfDocument();
document.PageSettings.Orientation = orientation;
document.Pages.Add();

PdfFont fontTitle = new PdfStandardFont(PdfFontFamily.Helvetica, 8);
PdfStringFormat totalFormat = new PdfStringFormat();
totalFormat.Alignment = PdfTextAlignment.Left;
totalFormat.MeasureTrailingSpaces = false;

RectangleF rectTotals = new RectangleF(0, 30, document.Pages[0].GetClientSize().Width, 20);
g.DrawString("€ $ ¥", fontTitle, PdfBrushes.Black, rectTotals, totalFormat);
-----------------------------------------------

How can i fix this?

Thanks in advance,
Jorik


9 Replies

GM Geetha M Syncfusion Team October 17, 2011 10:07 AM UTC

Hi Jorik,

Thank you for the details.

I was able to reproduce the problem. I have forwarded it to our development team for more analysis. Could you please create a new direct trac incident so that I can post you further details on this?

Regards,
Geetha



JS Jorik Schaillée October 17, 2011 12:06 PM UTC

Thanks for the reply Geetha.
I created a new direct trac incident with id 86191.

Regards,
Jorik



GM Geetha M Syncfusion Team October 21, 2011 06:17 AM UTC

Hi Jorik,

Thank you for the update.

Regards,
Geetha



FG Frederik Gysel February 5, 2017 06:55 PM UTC

Hi,

Has this issue been solved?


Thank you
Frederik


CM Chinnu Muniyappan Syncfusion Team February 6, 2017 12:23 PM UTC

Hi Frederik, 
 
Thank you for your update. 
 
Yes, we can draw the Unicode text by using PdfTrueTypeFont, please refer the below code snippet for more details. 
 
           //Create a new PDF document 
            PdfDocument doc = new PdfDocument(); 
 
            //Add a new PDF page 
            PdfPage page = doc.Pages.Add(); 
 
            //Create a new PDF true type font. 
            PdfTrueTypeFont font = new PdfTrueTypeFont(new Font("Arial", 12, FontStyle.Regular), true); 
 
            //Draw the Unicode text 
            page.Graphics.DrawString("€ $ ¥", font, PdfBrushes.Black, new PointF(10, 10)); 
 
            //Save the PDF document 
            doc.Save("output.pdf"); 
 
            //Close the PDF document 
            doc.Close(true); 
 
Please let us know if you have any concern. 
Regards, 
Chinnu 



FG Frederik Gysel February 6, 2017 03:46 PM UTC

Thank you for your feedback Chinnu.

What in case of HTML code (containing € or à) to PDF conversion?

Thank you
Frederik


PV Prakash Viswanathan Syncfusion Team February 7, 2017 10:49 AM UTC

Hi Frederik, 
 
If the HTML code contains € or à, then our WebKit HTML converter preserves how it is displayed on web browsers. On our further analysis, we can display euro symbol (€) in HTML using different ways (€ or € or €). If you directly use € symbol in HTML you have to define the charset as UTF-8 in meta tag. I have attached input HTML and output PDF documents for your reference.  
 
 
Note: Currently we do not have support for HTML to PDF using WebKit HTML converter in silver light  
 
You can get latest WebKit installer from below link, 
Latest WebKit HTML Converter: https://www.syncfusion.com/downloads/latest-version    
 
Please let us know if you need any further assistance on this. 
 
Regards, 
Prakash V. 



FG Frederik Gysel February 7, 2017 06:58 PM UTC

Hi Prakash,

This is very clear.

Thank you for your elaborated reply.

Regards
Frederik


PV Prakash Viswanathan Syncfusion Team February 8, 2017 05:35 AM UTC

Hi Frederik, 
 
Thanks for your update. 
Please let us know if you need further assistance on this. 
 
Regards, 
Prakash V. 


Loader.
Up arrow icon