IIRC LibreOffice has some command line tools to do all kinds of document conversion