How to write UTF-8 (Persian) characters in pdf export of dynamic reports?

I am trying to export a report in pdf format using dynamic reports, but Persian characters are not displayed in the pdf file. but i don't have this problem in xls files or in jasper viewer. I tried this method, but it does not work. what should I do?

public void toPdf(String path){
    JasperPdfExporterBuilder pdfExporter = new ExporterBuilders()
    .pdfExporter(path);
    pdfExporter.setCharacterEncoding("UTF-8");
    try {

        jasperReportBuilder.toPdf(pdfExporter);
    } catch (Exception e1) {
        logger.error("failed to create PDF", e1);
    }
}

excel export: excel export

jasper viewer:

jasper viewer

Export to PDF: enter image description here

+4
source share
2 answers

, , - , . fonts.xml Identity-H ( !)

+4

jasper API , PDF, Linux, , , , UTF-8 ISO-8859-14, ISO -8859-15, ISO-8859-1 ..

ä ä jasper API (JasperConcatenatedReportBuilder) PDF.

0

All Articles