Jasper report PDF in hindi

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 13:47:40

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!