Skip to content

Instantly share code, notes, and snippets.

@firmanelhakim
Created August 14, 2017 22:51
Show Gist options
  • Save firmanelhakim/3a81e0c5fc36d1ce8a4d9295de469c25 to your computer and use it in GitHub Desktop.
Save firmanelhakim/3a81e0c5fc36d1ce8a4d9295de469c25 to your computer and use it in GitHub Desktop.
How to Convert from DOCX to PDF using LibreOffice

Download LibreOffice

x86_64

wget -t 0 -c http://download.documentfoundation.org/libreoffice/stable/5.4.0/deb/x86_64/LibreOffice_5.4.0_Linux_x86-64_deb.tar.gz

x86

wget -t 0 -c http://download.documentfoundation.org/libreoffice/stable/5.4.0/deb/x86/LibreOffice_5.4.0_Linux_x86_deb.tar.gz

Install Required Packages

sudo apt-get install -y libxinerama1 libdbus-glib-1.2 libcairo2 libsm6

Extract and Install LibreOffice Packages

tar xzvf LibreOffice_5.4.0_Linux_x86_deb.tar.gz

cd Libre*/DEBS

sudo dpkg -i *.deb

Convert DOCX to PDF

libreoffice5.4 --headless -convert-to pdf my_document.docx -outdir .

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment