我正在努力寻找 使用 Python 将 PDF 文件转换为 .docx 文件的 方法。
我看过与此相关的其他帖子,但在我的案例中,它们似乎都无法正常工作。
我是专门用
import os
import subprocess
for top, dirs, files in os.walk('/my/pdf/folder'):
for filename in files:
if filename.endswith('.pdf'):
abspath = os.path.join(top, filename)
subprocess.call('lowriter --invisible --convert-to doc "{}"'
.format(abspath), shell=True)
这给了我输出 [1],但是,我在我的文件夹中找不到任何 .docx 文档。
我安装了 LibreOffice 5.3。
有什么线索吗?
先感谢您!
原文由 Also 发布,翻译遵循 CC BY-SA 4.0 许可协议
我将它用于多个文件