Convert PDF to DOC (Python / Bash)

I saw several pages that allow the user to download a PDF and return a DOC file, such as PdfToWord

Is it possible to convert a PDF file to a DOC/DOCX file using Python or any Unix command?

Thanks in advance

+4
python bash pdf doc docx
source share
2 answers

If you have LibreOffice installed

 lowriter --invisible --convert-to doc '/your/file.pdf' 

If you want to use Python for this:

 import os import subprocess for top, dirs, files in os.walk('/my/pdf/folder'): for filename in files: if filename.endswith('.pdf'): abspath = os.path.join(top, filename) subprocess.call('lowriter --invisible --convert-to doc "{}"' .format(abspath), shell=True) 
+4
source share

This is difficult because PDF files are presentation oriented and text documents are content oriented. I tested both options and can recommend the following projects.

However, you are definitely going to lose the presentation aspects of the conversion.

+4
source share

All Articles