使用ireport導出pdf,在Windows下,一切好好的,放到Liunx下後,導出pdf報
net.sf.jasperreports.engine.util.JRFontNotFoundException: Font '宋體' is not available to the JVM. See the Javadoc for more details.
解決方法:
1、把需要用到的字體(可以直接拷貝windows系統的C:\WINDOWS\Fonts 下的相關字體)拷貝當前項目的classpath下,一般為classes目錄下
2、在classpath裡添加 jasperreports.properties 屬性文件
文件內容為:
net.sf.jasperreports.awt.ignore.missing.font=true