问题
Following code is used to generate PDF file. We have some static content and some dynamic content in Hindi. Hindi content is not rendered on PDF at all. I have put jasperreports-fonts-5.5.1 jar as in classpath also. SansSerif font is being used in JRXML and deployed in tomcat.
Shows properly in English
Complete Hindi content is not visible
JasperReport js = JasperCompileManager.compileReport(<JRXML URL>);
byte[] bytes = JasperRunManager.runReportToPdf(js, parameterMap,
new JsonDataSource(location,"studentReport"));
String filePath = "/var/www/webdav/pdf/" + studentId + ".pdf";
FileOutputStream fos = new FileOutputStream(new File(filePath));
fos.write(bytes, 0, bytes.length);
fos.flush();
fos.close();
回答1:
You can use Lohit Hindi
font for the static or dynamic fields having 'Hindi' values. Give a try. It may work.
来源:https://stackoverflow.com/questions/27819886/jasper-report-pdf-in-hindi