xxxxxxxxxx
lowriter --convert-to pdf file.docx
# for advanced document, use wps for convert there.
xxxxxxxxxx
//************ Run the following commands to convert doc to pdf **********//
sudo apt-get update
sudo apt-get install libreoffice --no-install-recommends
sudo apt-get install default-jre
libreoffice --headless --convert-to pdf MyWordFile.docx --outdir ./ //run this command to convert doc to pdf