Download LibreOffice
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
wget -t 0 -c http://download.documentfoundation.org/libreoffice/stable/5.4.0/deb/x86/LibreOffice_5.4.0_Linux_x86_deb.tar.gz
sudo apt-get install -y libxinerama1 libdbus-glib-1.2 libcairo2 libsm6
tar xzvf LibreOffice_5.4.0_Linux_x86_deb.tar.gz
cd Libre*/DEBS
sudo dpkg -i *.deb
libreoffice5.4 --headless -convert-to pdf my_document.docx -outdir .
Done.