I have this .jrxml
file :
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="multi1" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="c8a053f6-858e-427b-aec1-89231aadddd6">
<title>
<band height="79" splitType="Stretch">
<staticText>
<reportElement x="104" y="0" width="313" height="25" uuid="fa5e3e6e-26f7-4973-a2d5-3c3b7a5e8227"/>
<textElement textAlignment="Center">
<font size="16" fontName="Lohit Devanagari" isPdfEmbedded="true" pdfEncoding="Identity-H" />
</textElement>
<text><![CDATA[अतिदेय राशि के पुनर्भुगतान हेतु अनुस्मारक]]></text>
</staticText>
<staticText>
<reportElement x="132" y="25" width="252" height="25" uuid="fa5e3e6e-26f7-4973-a2d5-3c3b7a5e8227"/>
<textElement textAlignment="Center">
<font size="16"/>
</textElement>
<text><![CDATA[Reminder for repaying Overdue Amount]]></text>
</staticText>
</band>
</title>
</jasperReport>
When I convert this to PDF, I do not get the Hindi Text. My code for converting to pdf is as follows:
public class PdfFromXmlFile {
public static void main(String[] args) throws JRException, IOException {
// Compile jrxml file.
JasperReport jasperReport = JasperCompileManager
.compileReport("C:/report.jrxml");
// Parameters for report
Map<String, Object> parameters = new HashMap<String, Object>();
// DataSource
// This is simple example, no database.
// then using empty datasource.
JRDataSource dataSource = new JREmptyDataSource();
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport,
parameters, dataSource);
// Make sure the output directory exists.
File outDir = new File("C:/jasperoutput");
outDir.mkdirs();
// Export to PDF.
JasperExportManager.exportReportToPdfFile(jasperPrint,
"C:/jasperoutput/report.pdf");
System.out.println("Done!");
}
}
How do I fix this? I tried to create a jar with Lohit-Devanagari
ttf from JasperSoft Studio and imported it here but it didn't work.