Search code examples
libreoffice

PDF to DOC using cmd


How do I convert a pdf file to doc? I tried the following:

soffice.exe --convert-to doc C:\Users\Administrator\Desktop\pdfda.pdf

When I hit enter nothing happens, I have libreoffice installed and I'm using Windows 10.


Solution

  • For others landing here the support advice is use soffice NOT soffice.exe since that should on Windows invoke the console command line version soffice.com

    see https://ask.libreoffice.org/t/convert-docx-to-pdf-via-the-commandline-on-windows-10/64418/6

    Starting from v.6.3, you should not use soffice.exe when working in terminal. You better just omit the extension (like [invoke in folder >] soffice), or explicitly use soffice.com, to use a version specifically created for console, which would output the errors, if any, to the console, instead of silently discarding any output. Also note that you should make sure that LibreOffice is not running in the background when you are launching the command line, because otherwise your command would be redirected to the existing GUI process, and you may again not see the error messages.

    Alternatively, specify a separate user profile when calling command line to allow separate processes - see -env command line parameter

    Full documentation is at https://documentation.libreoffice.org/en/english-documentation/