使用docx4j生成pdf时,宋体(中文正文)类型无法转换成功。如何配置支持宋体(中文正文)类型字体?
转换结果为:
代码:
String tempPath = "G:\\TestDoc\\weituo2.docx";
WordprocessingMLPackage wordMLPackage = DocxUtils.getWordMLPackage(tempPath);
String outpath = "G:\\TestDoc\\业务委托单.pdf";
DocxUtils.toPDF(wordMLPackage,outpath);
public static void toPDF(WordprocessingMLPackage wordMLPackage,String outPath) throws Exception{
// Mapper fontMapper = new IdentityPlusMapper();
Mapper fontMapper = new IdentityPlusMapper();
wordMLPackage.setFontMap