1

How to use chinese characters in JasperReports using Java. Presently I am using below code.
This works fine for HTML, DOC but it is not working for PDF.

<textField>
   <reportElement x="49" y="0" width="277" height="52" uuid="a17f1430-f415-4eba-9769-b02ca05731a8"/>
            <textElement>
                <font fontName="STSong-Light" pdfFontName="STSong-Light" pdfEncoding="UniGB-UCS2-H" isPdfEmbedded="true"/>
            </textElement>
            <textFieldExpression><![CDATA["入 学 許 可 証"]]></textFieldExpression>
        </textField>

I have also tried using iReport Designer 5.5.0 but still result is same.

Alex K
  • 22,315
  • 19
  • 108
  • 236
Ravi Shekhar
  • 2,633
  • 4
  • 19
  • 19
  • What's going wrong? Is the text showing? I'm guessing this is going to be an encoding issue. What's the encoding of your XML document? (eg ``). What editor are you using to edit the file? (the editor may have it's own encoding) – lance-java Feb 19 '14 at 08:46
  • Probably a font missing from the pdf generation software – Scary Wombat Feb 19 '14 at 08:55
  • @RaviShekhar Did you use the [Font Extensions](http://jasperreports.sourceforge.net/sample.reference/fonts/index.html#fontextensions)? – Alex K Feb 19 '14 at 09:25
  • The pdf is getting generated but there is no data inside it. – Ravi Shekhar Feb 19 '14 at 09:48
  • @LanceJava Yes i am using – Ravi Shekhar Feb 19 '14 at 09:49
  • @AlexK I haven't tried font extensions yet. If you have any guide related to chinese chars using Font Extensions then pls share. – Ravi Shekhar Feb 19 '14 at 09:50
  • @RaviShekhar You can look at this posts: [Use custom fonts when creating pdf using iReport](http://stackoverflow.com/q/8985497/876298) & [iReport external font](http://stackoverflow.com/q/9256114/876298) – Alex K Feb 19 '14 at 09:59

0 Answers0