This content has been marked as final.
Show 3 replies
-
1. Re: problem with unicodes in itext
fzaker Sep 25, 2007 9:17 AM (in response to srmo642002)I have the same problem.
According to "itext in action", for using arabic language in pdf,Arabic glyphs are written as double byte chars.
Your encoding should be BaseFont.IDENTITY_H, and you should be using a unicode font.
How should we do these in seam pdf? -
2. Re: problem with unicodes in itext
rmemoria Oct 16, 2007 11:12 PM (in response to srmo642002)Hi,
I have this same problem, but with Romanian language, that already has chars like ? and ? that are not displayed in the PDF.
Any solution for that?
Regards,
Ricardo -
3. Re: problem with unicodes in itext
srmo642002 Nov 14, 2007 7:18 AM (in response to srmo642002)you must manipulate UIFont class locatet in org.jboss.seam.pdf.ui;
private BaseFont getFont(String familyName) { try { return BaseFont.createFont("c:/windows/fonts/" + familyName + ".ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED); } catch (Exception e) { e.printStackTrace(); try { return BaseFont.createFont("d:/windows/fonts/" + familyName + ".ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED); } catch (Exception e1) { e1.printStackTrace(); } } return null; } @Override public void createITextObject(FacesContext context) { familyName = (String) getAttributes().get("familyName"); if (familyName == null || familyName.equals("")) familyName = "nazanin"; //int family = (familyName==null) ? Font.UNDEFINED : Font.getFamilyIndex(familyName); size = (Integer) valueBinding(context, "size", size); font = new Font(getFont(familyName), size); font.getBaseFont().correctArabicAdvance(); style = (String) valueBinding(context, "style", style); if (style != null) { font.setStyle(style); } }