[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-812) encoding issues

Piotr Czekaj (JIRA) jira-events at lists.jboss.org
Thu Feb 15 06:10:30 EST 2007


    [ http://jira.jboss.com/jira/browse/JBSEAM-812?page=comments#action_12353181 ] 
            
Piotr Czekaj commented on JBSEAM-812:
-------------------------------------

In atachment there are two pdf's generated from following
testPdf.xhtml:

<?xml version="1.0" encoding="UTF-8"?>
<document xmlns:ui="http://java.sun.com/jsf/facelets" 
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns="http://jboss.com/products/seam/pdf">
 
  <paragraph>TEST_ĄŚŻŹĆÓŁĘążśźćęłó_TEST</paragraph>        
  <paragraph><font>TEST_ĄŚŻŹĆÓŁĘążśźćęłó_TEST</font></paragraph>  
 
</document>

testPdf_clean_1.1.6GA.pdf - is pdf created using Seam 1.1.6GA without
any changes in source code of pdf package. On output there's only
"TEST_Óó_TEST" (many letters are missing)

testPdf_changed_1.1.6GA.pdf - is pdf created using modiffied version
of pdf package. On output first line is as it was in original version
but second line is correct e.g."TEST_ASZZCÓŁEazszcełó_TEST". First and
second line uses the same font Helvetica but first uses ansi encoding
while second one cp1250 because I've changed createITextObject
function in org.jboss.seam.pdf.ui.UIFont (same code i've posted at
forum):

    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);
        }
    }

Without possibility to set font encoding Seam pdf library is rather
useless for me and potentially for other non English users.

> encoding issues
> ---------------
>
>                 Key: JBSEAM-812
>                 URL: http://jira.jboss.com/jira/browse/JBSEAM-812
>             Project: JBoss Seam
>          Issue Type: Feature Request
>          Components: PDF
>    Affects Versions: 1.1.6.GA
>            Reporter: Piotr Czekaj
>
> It would be great to have some option to set encoding for text, without it it's impossible to display for example polish national characters 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       




More information about the seam-issues mailing list