title: Having trouble using Python and LibreOffice to convert pdf to docx and doc to docx
body: <p>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.</p>
  <p>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.</p>
  <p>I have LibreOffice v6.0.2 installed on windows.</p>
  <p>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:</p>
  <pre><code>    import subprocess
      lowriter='C://Program Files/LibreOffice/program/swriter.exe'
      subprocess.run('{} --invisible --convert-to docx --outdir &quot;{}&quot; &quot;{}&quot;'
                     .format(lowriter,'dir',
                                  
      'filepath.pdf',),shell=True)
  </code></pre>
  <p>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:</p>
  <pre><code>    CompletedProcess(args='C://Program Files/LibreOffice/program/swriter.exe 
      --invisible --convert-to docx --outdir &quot;{dir}&quot; 
      {filepath.pdf}&quot;', returncode=1)
  </code></pre>
  <p>The dir and filepath.pdf are place holders I have put.</p>
  <p>I have a similar problem with the doc to docx conversion.</p>