当前位置:网站首页>Jasperreports configures Chinese Fonts
Jasperreports configures Chinese Fonts
2022-07-22 00:21:00 【Wage earners~】
Project scenario :
Use JasperReports Conduct PDF export
Problem description
stay JasperReports Incompatible with higher version itext Thrown exception Some netizens said in their comments 6.19.0 Abnormal Chinese display
Cause analysis :
May be Maven When compiling, the font File corruption
了 , perhaps Configure Fonts
Wrong way , Or it is configured with the template The font is inconsistent
Solution :
- First the Maven Compile and compress binary function is off , May refer to
Maven Solution of file corruption caused by compressing resources
- Check the font configured in the template
such as : The font of the template I configure here isChinese Songti
- Configure fonts in the project
among :stsong.TTF( The font file )
、fonts.xml( Font file configuration )
、jasperreports_extension.properties(JasperReports Configuration file for )
fonts.xml
<?xml version="1.0" encoding="UTF-8"?>
<fontFamilies>
<fontFamily name = " Chinese Songti ">
<normal>stsong/stsong.TTF</normal>
<bold>stsong/stsong.TTF</bold>
<italic>stsong/stsong.TTF</italic>
<boldItalic>stsong/stsong.TTF</boldItalic>
<pdfEncoding>Identity-H</pdfEncoding>
<pdfEmbedded>true</pdfEmbedded>
<exportFonts>
<export key = "net.sf.jasperreports.html">' Chinese Songti ', Arial, Helvetica, sans-serif</export>
<export key = "net.sf.jasperreports.xhtml">' Chinese Songti ', Arial, Helvetica, sans-serif</export>
</exportFonts>
</fontFamily>
</fontFamilies>
jasperreports_extension.properties
# JasperReports Factory of font configuration
net.sf.jasperreports.extension.registry.factory.simple.font.families=net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory
# Specify the location of the font configuration
net.sf.jasperreports.extension.simple.font.families.lobstertwo=stsong/fonts.xml
* notes
: If the above is still not possible , Ben UP The Lord also has no way , After all, my project can display Chinese normally with this configuration !
边栏推荐
- Example of Cisco configuring VLAN
- DataX环境部署以及测试案例
- Mysql/sql server connects to the database through JDBC to add, delete, modify and query
- Idea添加依赖的步骤:
- DHCP服务与配置
- [secondary development of GeoServer] development of rest automatic deployment module based on GeoServer Manager
- 使用JasperReports时,报出 ReportExpressionEvaluationData 异常
- Atomic quotation to solve ABA problem
- Text file import database for getting started with kettle
- 一个基于ATMEGA128的直流电机抱死程序
猜你喜欢
2022-07-20 study notes of group 5 self-cultivation class (every day)
Detailed explanation of PE file structure
反向代理HAproxy
二叉树的先根,中根,后根遍历
Stack differences
Mysql/sql server connects to the database through JDBC to add, delete, modify and query
Five states of the process
Using disassembly debugging and complement to explain 0x80000000 / -1 shaping output exception inconsistency
Exness: the US index fell for three consecutive days, and the euro rebounded to digest the expectation of interest rate hike
The actual case of Cisco configuring single arm routing is very simple
随机推荐
放苹果
ASCII and hexadecimal conversion table
Stata used in jupyter
汉诺塔
什么是哈希冲突?哈希冲突怎么解决?
(C language) flexible array
Example of Cisco configuring VLAN
一个基于ATMEGA128的直流电机抱死程序
Using web workers
Leakage current, no grounding protection measures... 1296 imported electric kettle have major potential safety hazards
Four stages of writing C language
centos7部署mysql8
完美立方
First root, middle root, and last root traversal of binary tree
Enterprises and individuals choose cloud terminals or cloud servers for cloud desktops? You will know after reading this article
Shell scripts download data by date range and interval
LVS load balancing + high availability
235. Nearest common ancestor DFS method of binary search tree
Pour ajouter une dépendance à Idea:
Relevant contents of tube side