If you want to use OpenOffice then you may use from the command line unoconv with latest LibreOffice. This works in general but be prepared to:
- have some more fancy formatting lost,
- repeat conversion due to some exception on LibreOffice side.
I would discourage using UNO API directly. This is possible (and you may have a pool of running OpenOffice servers that will perform the conversion) but definitely not easy.
Google Docs is for me of no use as the conversion file size limit is 2 MB.