aspose转pdf乱码问题

Background

  • 使用aspose-words把word转pdf,或者使用aspose-cells把excel转pdf时,在本地windows上测试没有问题,部署到服务器Centos7上时字体乱码。
  • 本地windows上测试时是使用windows平台自带的字体,字体路径C:\Windows\Fonts
  • 服务器Centos7上缺少相应字体,字体路径/usr/share/fonts
  • 直接把windows上的字体上传到服务上字体的指定路径,刷新下字体缓存就行了。

刷新字体缓存

在服务器Centos7上执行如下命令。

# 刷新字体缓存
fc-cache

# 查看所有字体
fc-list

# 查看所有中文字体
fc-list :lang=zh

《aspose转pdf乱码问题》

    原文作者:WaiSaa
    原文地址: https://blog.csdn.net/qq_42761569/article/details/124154164
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞