2 Replies Latest reply on Oct 23, 2007 10:56 AM by Ricardo Memoria

    pdf - font encoding and documentation

    Piotr Czekaj Newbie

      I'm using Seam 1.1.6GA. In documentation - 15.9. Configuring iText - there is no information about need of DocumentStoreServlet in web.xml. Without it useExtensions option doesn't work. There should be some option to set encoding for text, without it i can't display polish national charachters (there are simply missing in pdf). I've made quick change to org.jboss.seam.pdf.ui.UIFont :

       public void createITextObject(FacesContext context) {
       familyName = (String) valueBinding(context, "familyName", familyName);
       int family = (familyName==null) ? Font.UNDEFINED : Font.getFamilyIndex(familyName);
      
       BaseFont baseFont = null;
       try {
       baseFont = BaseFont.createFont("Helvetica", BaseFont.CP1250,
       BaseFont.NOT_EMBEDDED);
       } catch (DocumentException e) {
       //TODO: what to do?
       } catch (IOException e) {
       //TODO: what to do?
       }
      
       size = (Integer) valueBinding(context, "size", size);
       //font = new Font(family, size);
       font = new Font(baseFont, size);
      
       style = (String) valueBinding(context, "style", style);
       if (style != null) {
       font.setStyle(style);
       }
       }
      

      with that change all polish national characters are visible. More elegant solution would be great...