wertyk wertyk - 2 years ago 166
Vb.net Question

What Encoding to set for iTextSharp Romanian language

I try to create a PDF file with iTextSharp version (I added from NuGet). All works fine but not and Romanian diacritics (ȘșȚțăĂÂâ). I read a lot of articles with solutions about that but nothing work. Now I founded a solution that from all diacritics appear only "ăĂÂâ" others not appear.
That is my code:

Dim bf As BaseFont = BaseFont.CreateFont(BaseFont.TIMES_ROMAN, BaseFont.CP1250, False)
Dim normalFont As New iTextSharp.text.Font(bf, 9, Font.NORMAL)
Dim par As New Paragraph("ȘșȚțăĂÂâ", normalFont)

Can anybody write me what encoding I must write to have all Romanian diacritics.

Answer Source

The built-in fonts like BaseFont.TIMES_ROMANdon't have the Romanian diacritics. You'll need an external font like times.ttf:

Dim bf As BaseFont = BaseFont.CreateFont("c:\windows\fonts\times.ttf, BaseFont.UNICODE_H, True)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download