Link to home
Start Free TrialLog in
Avatar of Aurii
Aurii

asked on

Use Regional language in pdf using itext

I am using itext in my java application. I want to use Marathi font (Marathi is a Indian Language) in my pdf. I add Marathi font in C:\Windows\font. Now How to use it in pdf Please help.
Avatar of Dejan Pažin
Dejan Pažin
Flag of Austria image

Avatar of Aurii
Aurii

ASKER

But how should I import font from C:\Windows\Font\

Using FontFactory.register() method. Like this:

FontFactory.register("C:\\Windows\\Font\\yourfont", "YourFontName");
FontFactory.getFont("YourFontName", BaseFont.CP1252, BaseFont.EMBEDDED);
Avatar of Aurii

ASKER

I used your code as,

FontFactory.register("C:\\WINDOWS\\Fonts\\K021", "K021");
cell = new PdfPCell(new Phrase(" M/S. Askaran Vijay Foods", FontFactory.getFont("K021", BaseFont.CP1252, BaseFont.EMBEDDED)));

But its not working. Its showing some different English font but 'K021' is a Marathi font


ASKER CERTIFIED SOLUTION
Avatar of Dejan Pažin
Dejan Pažin
Flag of Austria image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial