ItextSharp does not recognize the accents

0

I am making a report with the itextsharp library and with vb.net. Everything has gone well except that when it comes to printing a word with an accent it does not recognize it and it puts other symbols. Could someone tell me how to solve this little problem? Thank you very much

    
asked by antonio garcia ramos 14.12.2016 в 21:28
source

1 answer

1

To be able to view Unicode characters in iTextSharp correctly, a font that supports the code points that are being used must be added.

The main point is to specify IDENTITY-H , which provides Unicode support for a source that allows it.

For example, for the Arial font (found in the Windows font folder):

Dim arial As BaseFont = BaseFont.createFont("c:\windows\fonts\arial.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED)
fuente = New Font(arial, 12)

And then, it can be used in a paragraph:

document.Add(New Paragraph("¡Muchísimas felicidades y buen fin de año!", fuente))
    
answered by 23.12.2016 в 05:12