The following code is used to create a PDF file. We have static content and some dynamic Hindi content. Hindi content does not appear in PDF at all. I added the jasperreports-fonts-5.5.1 jar, as in the classpath. The SansSerif font is used in JRXML and deployed to tomcat.
Well displayed in English

Hindi full content 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();
source
share