问题描述
我在将 pdf 转换为 doc/docx 时遇到 ASPOSE.PDF 问题。
Document pdf2wordDocument = new Document();
虽然在我的项目运行后立即初始化 Document 对象有帮助(它减少了 15-25 秒的处理时间),但转换仍然很慢。
pdf2wordDocument = new Document(outputDocDir + fileNameWithExtension); // this takes 15-25 sec - FIXED with initialization of Document object at startup
String documentExtension = saveOptions.getFormat() == 0 ? "doc" : "docx";
String outputFile = outputDocDir + fileName + "." + documentExtension;
log.info("New file to be converted -> " + outputFile + " Converting...");
pdf2wordDocument.save(outputFile,saveOptions); // This takes 65-75 seconds
pdf2wordDocument.close();
我尝试在 MemmIN 和 MemmAX 中增加内存并同时取消限制 - 这对转换速度没有影响。
当我编译一个仅转换文件的独立应用程序时,两种延迟都不存在。但是,在项目中实现时,对于4页PDF(试用版库的限制)有超过一分钟的巨大延迟
有人知道如何加速 pdf2wordDocument.save() 吗?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)