解决jasperreport pdf导出错误Could not load the following font问题
来源:互联网 发布:微波炉品牌选择 知乎 编辑:程序博客网 时间:2024/06/03 23:40
在使用jasperreport做报表的时候,出现以下错误,折腾了很久,网上查了很多资料,终于解决
net.sf.jasperreports.engine.JRRuntimeException:Could not load the following font :
pdfFontName : STSong-LightpdfEncoding : UniGB-UCS2-H(Chinese Siplified)
isPdfEmbedded : true
导致这个问题的原因是 itext-asian.jar包经过更新,其包名已经更改为com.itextpdf.text.pdf.fonts。但是jasperreport包里查找字体文件仍是com.lowagie.text.pdf.fonts路径。
本人解决方法:
将itext-asian.jar包中所有文件拷贝出来,修改包名,并重新打包为custom-fonts.jar包。引入即可。
戏剧性的是解决完,发现一个和自己特别相似的解决方案,其中有更详细说明,补充其链接:http://blog.csdn.net/sanqima/article/details/50374151
另外设置默认字体,在jrxml中增加以下配置即可,不必每一个控件都设置
<style name="Base" isDefault="true" fontSize="10" pdfFontName="STSong-Light" pdfEncoding="UniGB-UCS2-H" isPdfEmbedded="true"> </style>
阅读全文
0 0
- 解决jasperreport pdf导出错误Could not load the following font问题
- Could not load the following font :pdfFontName : STSong-Light问题
- Linux "could not open default font 'fixed'."错误解决
- Linux "could not open default font 'fixed'."错误解决
- Linux "could not open default font 'fixed'."错误解决 .
- 解决Android Studio默认AppTheme主题找不到的问题 The following classes could not be found: - android.support.v
- 【常见错误】布局文件添加edittext报:The following classes could not be found错误
- 使用Indy解决Could not load SSL Library错误
- Qt5程序发布后运行,解决出现could not find or load the Qt Platform plugin windows错误
- 安卓错误提示:The following classes could not be found: - LinerLayout
- Android Studio常见错误之:Rendering Problems/The following classes could not be instantiated
- Android Studio 编译布局文件错误之:Rendering Problems The following classes could not be instantiated
- Android 布局文件添加edittext报:The following classes could not be found错误
- Android Studio常见错误之:Rendering Problems/The following classes could not be instantiated
- Android Studio常见错误之:Rendering Problems/The following classes could not be instantiated
- 解决The following classes could not be foundandroid.support.v7.internal.app.WindowDecorActionBar
- [Android小知识]Rendering Problems The following classes could not be instantiated解决一览
- [已解决]The following classes could not be found: android.support.v7.internal.app.WindowDecorActionBar
- Markdown语法
- VMware Workstation安装配置方法图文教程
- 数值计算和SVM讲解(上)
- java中线程的死锁
- 【机器学习 sklearn】逻辑斯蒂回归模型--Logistics regression
- 解决jasperreport pdf导出错误Could not load the following font问题
- 关于静态变量与非静态变量及函数的区别
- 淘淘商城内容管理内容列表显示
- Python并行处理
- ssh中list转化成json让微信小程序接收
- 打印100-999之间所有的水仙花数,水仙花数是一个三位数,各位数的立方和等于该数本身
- Android移动开发-手势事件处理MotionEvent的实现
- Linux系统中rcS文件深入分析
- ionic No provider for Http!