Jasper reports pdf中的孟加拉语字体在iReport中显示不正确

Jasper reports pdf中的孟加拉语字体在iReport中显示不正确,jasper-reports,export-to-pdf,Jasper Reports,Export To Pdf,我使用iReport 5.6.0生成报告。我在静态字段中使用了SolaimanLipi字体。i报告内部视图没有问题,但另存为pdf(在pdf阅读器或任何浏览器中打开)后,孟加拉语字体无法正确显示。 jrxml代码: <?xml version="1.0" encoding="UTF-8"?> <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://w

我使用iReport 5.6.0生成报告。我在静态字段中使用了SolaimanLipi字体。i报告内部视图没有问题,但另存为pdf(在pdf阅读器或任何浏览器中打开)后,孟加拉语字体无法正确显示。
jrxml代码:

 <?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="challanReport" language="groovy" pageWidth="842" pageHeight="595" orientation="Landscape" whenNoDataType="AllSectionsNoDetail" columnWidth="770" leftMargin="54" rightMargin="18" topMargin="20" bottomMargin="20" uuid="9126e000-dc70-4a76-9013-4a4fa290f0df">
<pageHeader>
    <band height="273" splitType="Stretch">
        <staticText>
            <reportElement x="13" y="10" width="403" height="20" uuid="1d2c7070-63f4-4a43-b3a2-63dc4c27c6f2"/>
            <textElement>
                <font fontName="SolaimanLipi" pdfEncoding="Identity-H"/>
            </textElement>
            <text><![CDATA[বাংলাদেশ ব্যাংক/সোনালী ব্যাংকের ....ঢাকা....জেলার....মহাখালী....শাখায় টাকা জমা দেওয়ার চালান ।]]></text>
        </staticText>
        <staticText>
            <reportElement x="429" y="10" width="69" height="20" uuid="21401d70-386e-4f01-bf34-586d58991b62"/>
            <box>
                <topPen lineWidth="0.25"/>
                <leftPen lineWidth="0.25"/>
                <bottomPen lineWidth="0.25"/>
                <rightPen lineWidth="0.25"/>
            </box>
            <textElement textAlignment="Center">
                <font fontName="SolaimanLipi" pdfFontName="Helvetica" pdfEncoding="Identity-H" isPdfEmbedded="true"/>
            </textElement>
            <text><![CDATA[১ম(মূল)কপি]]></text>
        </staticText>
        <staticText>
            <reportElement x="13" y="50" width="512" height="60" uuid="ee6769a0-b25e-4f60-b783-58b535f955d7"/>
            <box leftPadding="4">
                <topPen lineWidth="0.25"/>
                <leftPen lineWidth="0.25"/>
                <bottomPen lineWidth="0.25"/>
                <rightPen lineWidth="0.25"/>
            </box>
            <textElement>
                <font fontName="SolaimanLipi" pdfEncoding="Identity-H"/>
            </textElement>
            <text><![CDATA[বিভাগের নাম এবং চালানের পৃষ্ঠাংকনকারী  কর্মকর্তার নাম, পদবী ও দপ্তর l *]]></text>
        </staticText>
        <staticText>
            <reportElement x="13" y="30" width="512" height="20" uuid="1e86fa4b-88a3-4e05-b37a-3a4dbd0b2963"/>
            <box>
                <topPen lineWidth="0.25"/>
                <leftPen lineWidth="0.25"/>
                <bottomPen lineWidth="0.25"/>
                <rightPen lineWidth="0.25"/>
            </box>
            <textElement textAlignment="Center">
                <font fontName="SolaimanLipi" pdfEncoding="Identity-H" isPdfEmbedded="true"/>
            </textElement>
            <text><![CDATA[জমা প্রদানকারী কর্তৃক পূরণ করিতে হইবে |]]></text>
        </staticText>
    </band>
</pageHeader>

iReport内部视图:

i报告外部视图:
如何解决这个问题?

任何一种Unicode字体都可以使用jasper report在pdf中正确显示流程 步骤1

  • 下载您想要的Unicode字体xxx.ttf扩展名
  • 在jasper studio中安装此字体

  • 现在在报告中使用此自定义字体

步骤2

  • 从Jaspersoft studio导出自定义字体jar
  • 在java构建路径中添加此字体jar,或在maven存储库中安装此字体
如果在项目生成路径中手动添加字体,则忽略字体安装过程

字体安装命令

mvn install:install-file -Dfile=/your-jar-file-directory/fontName.jar -DgroupId=bangla -DartifactId=bangla -Dversion=1.0 -Dpackaging=jar
安装字体jar后,需要在pom文件中添加依赖项

示例依赖关系示例

       <dependency>
            <groupId>bangla</groupId>
            <artifactId>bangla</artifactId>
            <version>1.0</version>
        </dependency>

孟加拉语
孟加拉语
1

你在使用字体扩展吗?@AlexK否。我使用了Identity-H(带水平书写的Unicode)和嵌入的pdftrue@Rafiq,你找到解决办法了吗?我也面临同样的问题。。