I studied this question deeply and I found that for the correct results you do not need to avoid using MS Word. Even funded projects, such as LibreOffice, with proper Word conversion, are quite complex and change from version to version. Only MS Word tracks this.
For this reason, I implemented documents4j that delegates conversions to MS Word using the Java API. In addition, it allows you to move conversions to another machine that you can contact using the REST API. You will find detailed information on the GitHub page .
source share