Jasper PDF Report in Hindi

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

Shows properly in English

Hindi full content not visible

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
source share
1 answer

You can use the font Lohit Hindifor static or dynamic fields that have Hindi values. Give it a try. It might work.

0
source

All Articles