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

13,986

Solution 1

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.

Solution 2

You could try abiword software. e.g:

abiword --to=doc example.pdf
Share:
13,986

Related videos on Youtube

user2972081
Author by

user2972081

Updated on September 18, 2022

Comments

  • user2972081
    user2972081 over 1 year

    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.

    • igiannak
      igiannak almost 8 years
      an idea maybe dose it work to convert it to html and then to doc?
  • user2972081
    user2972081 almost 8 years
    Already tried, it only converts the text without the images