I use docker image in mac system
Dockerfile:
FROM centos
RUN yum install -y libreoffice-writer.x86_64
RUN yum groupinstall -y "Fonts" "Input Methods"
CMD ["/bin/bash"]
start docker:
docker run -it -v `pwd`:/root/ libreoffice_main /bin/bash
and run the command:
soffice --invisible --convert-to doc a.pdf
a.pdf:
after convert get a.doc: