1.项目部署到centos后,测试导出


在本地windwos上测试没有这个问题,原因是Linux系统字体库不全问题导致

2.解决方法是安装字体

  • 01
yum -y install fontconfig
  • 在fonts中创建目录chinese
  • 01
  • 02
  • 03
  • 04
  • 05
  • 06
  • 07
[root@hr-reporting-test fonts]# pwd /usr/share/fonts mkdir chinese [root@hr-reporting-test chinese]# pwd /usr/share/fonts/chinese
  • 从window的字体里找到中文字体复制进去:
  • 01
  • 02
  • 03
  • 04
  • 05
[root@hr-reporting-test chinese]# ll total 50648 -rwxr-xr-x 1 root root 16247072 Feb 22 19:25 MSYHBD.TTC -rwxr-xr-x 1 root root 12003540 Feb 22 19:25 MSYHL.TTC -rwxr-xr-x 1 root root 23607740 Feb 22 19:25 MSYH.TTC
  • 修改chinese目录的权限
  • 01
chmod -R 755 /usr/share/fonts/chinese
  • fc-list查看字体列表里有没有新加的字体

  • 测试导出带中文的水印