使用Aspose.Words将word转换为pdf时,在windows系统使用时正常的,但在linux系统中出现docx可以正常转换,doc转换失败(Unknown file format)。
public static void wordToPdf(String wordPath,String pdfPath) {
FileOutputStream os = null;
try {
getLicense();
File file = new File(pdfPath);
os = new FileOutputStream(file);
Document doc = new Document(wordPath);
doc.save(os, SaveFormat.PDF);
os.close();
} catch (Exception e) {
logger.error("word转pdf失败!");
}
}
已结题
Aspose.Words 转换word文档为PDF时异常
- 写回答
- 好问题 提建议
- 追加酬金
- 关注问题
- 分享
- 邀请回答