I have spent a good amount of time trying to determine what is going wrong exactly, with the code I am using to convert pdf to docx (and doc to docx) using LibreOffice.
I have used both the windows run interface to test-run some of the code I have found to be relevant, and have tried on python as well, neither of which works.
I have LibreOffice v6.0.2 installed on windows.
I have been using variations of this code to attempt to convert some pdf files to docx of which the specific pdf file is not really relevant:
import subprocess
lowriter='C://Program Files/LibreOffice/program/swriter.exe'
subprocess.run('{} --invisible --convert-to docx --outdir "{}" "{}"'
.format(lowriter,'dir',
'filepath.pdf',),shell=True)
I have tried code, again, in both the run interface on the windows os, and through python using the above code, with no luck. I have tried without the outdir as well, just in case I was writing that incorrectly, but always get a return code of 1:
CompletedProcess(args='C://Program Files/LibreOffice/program/swriter.exe
--invisible --convert-to docx --outdir "{dir}"
{filepath.pdf}"', returncode=1)
The dir and filepath.pdf are place holders I have put.
I have a similar problem with the doc to docx conversion.