我正在使用 i-report 5.5.0 生成 jasper 报告。我需要将印地语文本导出为 PDF 格式,但印地语部分正在转换为 ????????
。
我已经使用了字体扩展,但没有帮助:
font name: "lohit Devanagari"
PDF embedded: checked
PDF encoding:Identity-H
我也尝试过其他印地语字体,但到目前为止没有任何效果..
<textField>
<reportElement x="111" y="26" width="100" height="20" uuid="5a471a16-de7b-4f55-9c9f-b01d37938b9f"/>
<textElement>
<font fontName="Lohit Devanagari" pdfEncoding="Identity-H" isPdfEmbedded="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{DISTRICT_NAME}]]></textFieldExpression>
</textField>
最佳答案
这对我有用
IndicLigaturizer hindi = new DevanagariLigaturizer();
String result = hindi.process(string);
关于fonts - 导出为 pdf 时如何正确呈现印地语?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20213052/