我正在尝试找到一种使用 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)
Run Code Online (Sandbox Code Playgroud)
这给了我输出[1],但是,我在文件夹中找不到任何 .docx 文档。
我安装了 LibreOffice 5.3。
有什么线索吗?
先感谢您!