Proper way to convert PDF to word from bash command-line

libreofficepdfpdftktext processing

I need to convert 1K pdf files to doc on a debian server. I can convert a PDF to word using libreoffice commandline:

libreoffice --headless --invisible --convert-to doc Sample-doc-file-100kb.pdf

Or using soffice:

soffice --nocrashreport --nologo --nolockcheck --nofirststartwizard --invisible --headless --convert-to doc Sample-doc-file-100kb.pdf

The main problem with the above two commands, is that the doc file doesn't include images in the pages, it only contains the formatted text. Is there a better way to convert pdf to doc, including also the images present in the pdf? I am not interested in web services like zamzam, I need to do that from command-line on the server. Thank you.

Best Answer

I managed to do it by using this:

libreoffice --infilter=="writer_pdf_import" --headless \
--convert-to doc:"writer_pdf_Export" Brief.pdf  

It gives me the same output as @igiannak's answer.

Related Question