使用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时异常
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
3条回答 默认 最新
- 李堇 2022-04-19 18:32关注
原因已找到,因为使用的电脑都带有加密功能,导致未加密的文件另存为doc格式文件时自动加密,从而导致外网测试失败
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
悬赏问题
- ¥50 safari浏览器fetch提交数据后数据丢失问题
- ¥15 matlab不知道怎么改,求解答!!
- ¥15 永磁直线电机的电流环pi调不出来
- ¥15 用stata实现聚类的代码
- ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
- ¥20 docker里部署springboot项目,访问不到扬声器
- ¥15 netty整合springboot之后自动重连失效
- ¥15 悬赏!微信开发者工具报错,求帮改
- ¥20 wireshark抓不到vlan
- ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真