In SSH, it works and the best direct solution to implement this in your app :
Soffice --convert-to pdf filename.doc --headless
In forums, they say you should apparently use a script dolibarr at the application level to automate things :
/scripts/odt2pdf/odt2pdf.sh
Others talk of JODconverter, no need of at first view :
https://sourceforge.net/projects/jodconverter/files/JODConverter/2.2.2/
https://code.google.com/archive/p/jodconverter/downloads
Tuesday, April 11, 2017