There is a problem for converting DOCX to PDF using Libreoffice.(in RTL documents) but converting same document saved in ODT format will works fine.
Anyone knows how to convert an existing DOCX file to ODT using Ubuntu bash?
Then you can use this command directly from command line
libreoffice --headless --convert-to odt *.docx