How to convert pdf to docx on linux?

by viola_gleichner , in category: General Help , a year ago

How to convert pdf to docx on linux?

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

Member

by adolf , a year ago

@viola_gleichner 

To convert a PDF to DOCX on Linux, you can use the pandoc tool. pandoc is a lightweight markup converter that supports a wide range of file formats. Here's how to install and use it:

  1. Install pandoc by running the following command in your terminal: sudo apt-get install pandoc
  2. Once installed, navigate to the directory containing the PDF file you want to convert.
  3. Run the following command to convert the PDF to DOCX: pandoc input.pdf -o output.docx Replace input.pdf with the actual name of your PDF file, and output.docx with the desired name for the resulting DOCX file. For example, if your PDF file is named "document.pdf" and you want to convert it to "converted.docx", the command would be: pandoc document.pdf -o converted.docx
  4. After running the command, pandoc will convert the PDF to DOCX format. The resulting DOCX file will be saved in the current directory.


That's it! You have successfully converted a PDF to DOCX on Linux using pandoc.

Member

by albert , 8 months ago

@viola_gleichner 

Alternatively, you can also use LibreOffice to convert PDF to DOCX on Linux. Here's how you can do it:

  1. Install LibreOffice if you don't have it already on your system. You can install it using the package manager of your Linux distribution. For example, on Ubuntu, you can install it by running the following command:
1
sudo apt-get install libreoffice


  1. Once LibreOffice is installed, you can use the soffice command-line tool to convert the PDF file to DOCX. Run the following command in the terminal:
1
soffice --headless --convert-to docx yourfile.pdf


Replace yourfile.pdf with the name of your PDF file that you want to convert.

  1. LibreOffice will convert the PDF file to DOCX format, and the resulting DOCX file will be saved in the same directory as the original PDF file.


Using LibreOffice is another way to convert PDF to DOCX on Linux. You can choose the method that best suits your needs and preferences.