Comment #1 on issue 81 by angelo.z...@gmail.com: how can xdocreport supply
the Chinese character.
http://code.google.com/p/xdocreport/issues/detail?id=81
Hi,
Many thanks for your zip and explanation. Today I have not time to study it.
@Leszek : do you think it's possible for you to study Chinese character
with our ODT converter? I could modify our Docx converter like ODT
converterif you have time to fix this problem.
If it's possible for Leszek, I think Guo, you should attach an ODT and Docx
with Chinese character.
Many thanks
Regards Angelo
Actually I have no much time to investigate the issue.
Guo - first try to set font encoding. See wiki
http://code.google.com/p/xdocreport/wiki/ODFDOMConverterPDFViaIText
http://code.google.com/p/xdocreport/wiki/ODTReportingJavaMainConverter
how to do this. Maybe this will work??
Also I think that you don't need iTextAsian.jar. Xdocreport converter scans
directories like 'c:/windows/fonts' and should be able to find operating
system fonts.
Regards
Leszek
Hi,
Leszek, I have quicly tested the Chinese docx and it doesn't works. It
seems that with iText you should use embedded character
http://stackoverflow.com/questions/5785775/japanese-chinese-text-in-pdf-using-itext-java
But our converter doesn't support that (how to manage that?) But I think
there is too problem with docx converter to retreives thewell font. For the
moment no time to investigate to the docx converter.
I have added the chinese docx in the JUNit
http://code.google.com/p/xdocreport/source/browse/thirdparties-extension/org.apache.poi.xwpf.converter/src/test/java/org/apache/poi/xwpf/converter/itext/XWPFPOI2PDFViaiTextConverterTest.java
which uses the docx
http://xdocreport.googlecode.com/git/thirdparties-extension/org.apache.poi.xwpf.converter/src/test/resources/org/apache/poi/xwpf/converter/TestChineseCharacters.docx
Guo, if you wish help us to support Chinese character for docx/odt
converter, you are welcome!
Regards Angelo
It is possible to make font embedded by passing extra parameter to getFont
method
Now we use:
FontFactory.getFont( familyName, encoding, size, style, color );
but there is variant with embedded parameter:
FontFactory.getFont( familyName, encoding, embedded, size, style, color );
I think the bigger problem is how to search for a font
In example in an ODT document in style-text-properties we have:
style:font-name="Times New Roman" fo:font-size="12pt"
style:font-name-asian="Lucida Sans Unicode" style:font-size-asian="12pt"
style:language-asian="zxx" style:country-asian="none"
style:font-name-complex="Tahoma" style:font-size-complex="12pt"
so there is three font names. I don't know for now which to use and in what
circumstances. If I have ODT example and Chinese fonts I could do some
experiments.
Regards
Leszek
Hi Leszek,
Many thanks for your answer. I will try to see how to docx works with
chinese characters and it's the same problem than ODT.
Guo could you attach to this issue please an ODT with Chinese characters.
Many thanks.
Regards Angelo