Last post Jul 31, 2014 10:30 AM by markfitzme
Jul 17, 2014 06:07 PM|ardilo|LINK
I'm developing a multi-language web based application. User can select english, russian and Azeri languages.
What is the problem is I could not write RUSSIAN and AZERI / utf-8 characters on the PDF.
I checked the references and found that only CP1250 (Latin 2: Eastern Europe
), CP1254 (Turkish), CP1257 (Windows Baltic) as BASEFONT.
But as far as I know I need to use CP1251 (Cyrillic) for BASEFONT.
So, How can I solve this problem?
Thanks in advance for your support...
You will find some codebehind below:
If watermarkFont Is Nothing Then
watermarkFont = iTextSharp.text.pdf.BaseFont.CreateFont(iTextSharp.text.pdf.BaseFont.HELVETICA, iTextSharp.text.pdf.BaseFont.CP1250, iTextSharp.text.pdf.BaseFont.EMBEDDED)
underContent = stamper.GetOverContent(i)
.ShowTextAligned(iTextSharp.text.Element.ALIGN_CENTER, watermarkText, rect.Width / 2, rect.Height / 2, watermarkRotation)
Jul 20, 2014 12:55 PM|ardilo|LINK
Even though I use Cyberia.ttf font, it does not work.
You will find the example codebehind below.
Dim sylfaenpath As String = Server.MapPath("~/Uyeler/fonts/Cyberia.ttf")
watermarkFontisim = iTextSharp.text.pdf.BaseFont.CreateFont(sylfaenpath, iTextSharp.text.pdf.BaseFont.IDENTITY_H, BaseFont.EMBEDDED)
.ShowTextAligned(iTextSharp.text.Element.ALIGN_CENTER, "\u0418 епфmиьлот", rect.Width / 2, rect.Height / 2, watermarkRotation)
Jul 31, 2014 10:30 AM|markfitzme|LINK
We're probably not the best place to ask this since mostly our expertise with iTextSharp will be focused on using it from an ASP.Net Environment. Stack Overflow probably has better support on these issues.
I did find some developers who had similar issues to yours on Stack Overflow. Here are some of those discussions:
Also found this. It refers to the original iText information but it should still be understandable. http://itextsharp.10939.n7.nabble.com/Cyrillic-characters-are-blank-when-exported-in-pdf-td4166.html