Hi. I am trying to generate or export to PDF a jasper report but I can't displaynihongo or japanese characters. How do I fix this... :(
+1
A:
You have to embed UTF-8 fonts in the PDF.
- get the utf-8 fonts and place them on your classpath
- for older jasper-reports version use a custom
style
and apply it to all texts - before printing, call
style.setPdfFontName("/com/package/fonts/times.ttf")
;
For newer versions the PdfFontName
is deprecated instead of another way of doing this, but I can't find it now - look it up yourself.
Another workaround might be found here
Bozho
2009-12-11 06:59:53
+2
A:
Make a file "jasperreports.properties", put it in the class path and set the PDF encoding.
net.sf.jasperreports.default.pdf.encoding=Cp1250
Or make base style in a report, set what you need, and all other styles derive from this style, i.e. they have an attribute style="base".
xmedeko
2010-02-05 14:47:30
A:
You can also set "net.sf.jasperreports.default.pdf.encoding" in code like this:
JRProperties.setProperty("net.sf.jasperreports.default.pdf.encoding", "Cp1250");
zigomir
2010-09-17 10:07:22