Ubuntu – Convert PDF to Word Using Libreoffice in terminal

command lineconvert-commandfile formatlibreofficepdf

I am using the following libreoffice command to convert my pdf files into word(doc)

lowriter --headless --infilter='writer_pdf_import' --convert-to doc:"MS Word 2007 XML" sample.pdf

After converting the output document is having each line bordered with a rectangular box. But if I use the same command with MS Word 97 it is working perfectly.

 lowriter --headless --infilter='writer_pdf_import' --convert-to doc:"MS Word 97" sample.pdf

I don't know what is the mistake in the first command. Please help me with this. And also suggest me if I need to add any other attributes that will improve the efficiency and quality of conversion.

Best Answer

I'm using LibreOffice for a long now but still can't understand it how does it work with different files.
I'm using the below command to convert PDF to WORD. You may try :

libreoffice --infilter="writer_pdf_import" --convert-to docx input.pdf

This is working perfectly.

Related Question