com.aspose.words.Document doc = new com.aspose.words.Document(sourceStream);
doc.acceptAllRevisions();
NodeCollection comments = doc.getChildNodes(NodeType.COMMENT, true);
comments.clear();
for(Run run : (Iterable<Run>) doc.getChildNodes(NodeType.RUN, true))
{
run.getFont().setName("FZZYSJW");
}
doc.save(convertStream, SaveFormat.PDF);
已经把字体放到了服务器的/usr/share/fonts目录下,同时也刷新了字体缓存fc-cache -fv,但是最终生成PDF时还是使用了系统默认字体,导致文档产生结果不如意,能否指导一下,如何指定字体通过word创建PDF。
操作系统:Linux version 4.14.81.bm.7-amd64 (root@n3-021-205) (gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1)) #1 SMP Debian 4.14.81.bm.9-amd64 (2019-04-25)