Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
423 views
in Technique[技术] by (71.8m points)

java - Ukraine (Cyrillic) characters not displaying in Jasper Report PDF

I am trying to display ukranian character in jasper report as a pdf file. but it is not diaplaying in pdf format.

when I export report to all other format like html, csv..ukranian char is displaying.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Set some text field properties at iReport. Use font DejaVu Sans. Set pdf encoding to Cp1251 and isPdfEmbedded to true.

Ex.: <font fontName="DejaVu Sans" isStrikeThrough="false" pdfEncoding="Cp1251" isPdfEmbedded="true" />

jasperreports fonts as maven dependency:

<dependency>
    <groupId>net.sf.jasperreports</groupId>
    <artifactId>jasperreports-fonts</artifactId>
</dependency>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...