MohamedSaeed / xdocreport

Automatically exported from code.google.com/p/xdocreport
1 stars 0 forks source link

issue with 1.0.4 and japan caracters #393

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.

upgrade xdocreport from 1.0.2 to 1.0.4 in my working projet

pom :

        <dependency>
            <groupId>fr.opensagres.xdocreport</groupId>
            <artifactId>fr.opensagres.xdocreport.document.docx</artifactId>
            <version>1.0.4</version>
        </dependency>
        <dependency>
            <groupId>fr.opensagres.xdocreport</groupId>
            <artifactId>fr.opensagres.xdocreport.template.velocity</artifactId>
            <version>1.0.4</version>
        </dependency>
        <dependency>
            <groupId>fr.opensagres.xdocreport</groupId>
            <artifactId>fr.opensagres.xdocreport.converter.docx.xwpf</artifactId>
            <version>1.0.4</version>
        </dependency>
        <dependency>
            <groupId>fr.opensagres.xdocreport</groupId>
            <artifactId>fr.opensagres.xdocreport.document.tools</artifactId>
            <version>1.0.4</version>
        </dependency>
        <dependency>
            <groupId>org.apache.velocity</groupId>
            <artifactId>velocity</artifactId>
            <version>1.7</version>
        </dependency>

3.

What is the expected output? What do you see instead?

on my local serveur ( windows machine tomcat apache-tomcat-6.0.39 )it's work i 
get the generated document pdf as before. i have somes documents with japaneses 
char well displayed.

but on the intregation serveur ( Linux version 2.6.18-308.8.1.el5xen 
(mockbuild@builder10.centos.org) (gcc version 4.1.2 20080704 (Red Hat 
4.1.2-52)) and tomcat  Apache Tomcat Version 6.0.30 

for on document i get this execption :

fr.opensagres.xdocreport.converter.XDocConverterException: 
java.lang.StackOverflowError
        at fr.opensagres.xdocreport.document.AbstractXDocReport.convert(AbstractXDocReport.java:748)

        Caused by: java.lang.StackOverflowError
        at com.lowagie.text.pdf.CJKFont.loadProperties(Unknown Source)
        at com.lowagie.text.pdf.CJKFont.isCJKFont(Unknown Source)
        at com.lowagie.text.pdf.BaseFont.createFont(Unknown Source)
        at com.lowagie.text.pdf.BaseFont.createFont(Unknown Source)
        at com.lowagie.text.FontFactoryImp.getFont(Unknown Source)
        at com.lowagie.text.FontFactoryImp.getFont(Unknown Source)
        at com.lowagie.text.FontFactory.getFont(Unknown Source)
        at com.lowagie.text.FontFactory.getFont(Unknown Source)
        at fr.opensagres.xdocreport.itext.extension.font.AbstractFontRegistry.getFont(AbstractFontRegistry.java:53)
        at org.apache.poi.xwpf.converter.pdf.internal.PdfMapper.getFont(PdfMapper.java:556)
        at org.apache.poi.xwpf.converter.pdf.internal.PdfMapper.getFont(PdfMapper.java:569)

And for the document width japan caractere no error but not japan caracter...

first check of library fr.opensagres.* seem to be the sames on both env.
Any idea of that is the problem ????

thanks

Original issue reported on code.google.com by yohan.ce...@gmail.com on 24 Apr 2014 at 11:50

GoogleCodeExporter commented 9 years ago
Hi,

It's hard to help you. But if you wish that yoru converter works well, font 
must be installed on your linux server.

Regards Angelo

Original comment by angelo.z...@gmail.com on 24 Apr 2014 at 12:05

GoogleCodeExporter commented 9 years ago
Hi Angelo, i will try to install the fonts on the linux server but

it's strange that i get an error on the document without japan caracters.

in the version 1.0.2 this document was working on my linux server and now with 
prod not is the missing font handle differently from 1.0.2 and 1.04 ??? 

Original comment by yohan.ce...@gmail.com on 25 Apr 2014 at 6:59

GoogleCodeExporter commented 9 years ago
Yes we have changed a lot of thing about Font management since 1.0.3 if I 
remember. It's very hard to help you with your info.

Original comment by angelo.z...@gmail.com on 25 Apr 2014 at 7:25

GoogleCodeExporter commented 9 years ago
Hi angelo few more informations for you :

in fact i have checked again the issue and the error :

    Caused by: java.lang.StackOverflowError
        at com.lowagie.text.pdf.CJKFont.loadProperties(Unknown Source)
        at com.lowagie.text.pdf.CJKFont.isCJKFont(Unknown Source)
        at com.lowagie.text.pdf.BaseFont.createFont(Unknown Source)

it's appear on all environement ( linux and my windows ) in version 1.0.4 for a 
spefic .doc template converted in pdf.

I have to use the 1.0.4 version because my others documents templates use 
japanese caracters encoded with "arial unicode ms". this japan templates are 
well displayed only on 1.0.4 version. If i use 1.0.2 version i get blank 
caracters for japanese.

 is it possible to display japanese caracter with version 1.0.2 ???? if yes how ???

because 1.0.4  provide me this new issue Caused by: java.lang.StackOverflowError
        at com.lowagie.text.pdf.CJKFont.loadProperties(Unknown Source)
        at com.lowagie.text.pdf.CJKFont.isCJKFont(Unknown Source) 

on other normal template but i m obliged to use this version if i want to have 
japanese working right ???? 

Original comment by yohan.ce...@gmail.com on 25 Apr 2014 at 9:06

Attachments:

GoogleCodeExporter commented 9 years ago
> is it possible to display japanese caracter with version 1.0.2 
No, that's why we have done a lot of change about font management to support 
chineese character.

> because 1.0.4  provide me this new issue Caused by: 
java.lang.StackOverflowError
Ok, with your attached docx,  I had your problem with StackOverflow. I have 
fixed it for  1.0.5.See 
https://code.google.com/p/xdocreport/source/detail?r=5541fb3d33b24c1d4737a4cae64
de940c48f8e8e

Original comment by angelo.z...@gmail.com on 25 Apr 2014 at 9:57

GoogleCodeExporter commented 9 years ago
Hi Angelo,

I have downloaded the 1.0.5 snapshot in my pom using this :

<repository>
  <id>sonatype</id>
  <snapshots>
    <enabled>true</enabled>
  </snapshots>
  <url>http://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>

<dependency>
   <groupId>fr.opensagres.xdocreport</groupId>
   <artifactId>fr.opensagres.xdocreport.document.docx</artifactId>
   <version>1.0.5-SNAPSHOT</version>
</dependency>
<dependency>
    <groupId>fr.opensagres.xdocreport</groupId>
    <artifactId>fr.opensagres.xdocreport.template.velocity</artifactId>
    <version>1.0.5-SNAPSHOT</version>
</dependency>
<dependency>
    <groupId>fr.opensagres.xdocreport</groupId>
    <artifactId>fr.opensagres.xdocreport.converter.docx.xwpf</artifactId>
    <version>1.0.5-SNAPSHOT</version>
</dependency>
<dependency>
    <groupId>fr.opensagres.xdocreport</groupId>
    <artifactId>fr.opensagres.xdocreport.document.tools</artifactId>
    <version>1.0.5-SNAPSHOT</version>
</dependency>

The code is now working very well. No more issue with the isCJKFont who is 
called recursivly.

the Japanese caracters in my other template are also working !!

Thanks a lots for you fast support 1.0.5 is the good one ;-)

Original comment by yohan.ce...@gmail.com on 25 Apr 2014 at 6:14

GoogleCodeExporter commented 9 years ago
Ok cool, I close this issue.

Original comment by angelo.z...@gmail.com on 16 Jun 2014 at 12:54

GoogleCodeExporter commented 9 years ago
We use the Arial Unicode MS in the word template.

Remarqs on linux server you have to install the font for this example the MS 
arial unicode font to make it work.

check if you have the font on you serveur : use the unix commande : fc-list
if not present download the font ( i found it on the web named 8918632284.ttf 
but try sudo apt-get install ttf-mscorefonts-installer --> not tested) 
and copy it to /usr/share/fonts
run sudo fc-cache -fv that it

Original comment by ycelle...@gmail.com on 19 Jun 2014 at 10:24