You may want to consider using an external application to convert the files such as
http://api.openoffice.org/source/browse/api/odk/examples/java/DocumentConverter/
and then simply calling the external java program to do as you desire. I think that there are probably some better solutions but I do not recall them off hand!
Andrew PItonyak
andrew @ pitonyak . org