Have you considered using LibreOffice's command line --convert-to pdf
operation (as an external executable)? If you need to actually modify the files before conversion, use the Apache POI library first.
2 Likes