Convert MSword to XML/HTML on Linux

六月ゝ 毕业季﹏ 提交于 2020-01-15 08:06:08

问题


I need to convert MSWord file into XML or HTML, while preserving the structure of the file (mainly tables). I happened to find tika, which is quite powerful in extracting text from MSword files (and any files), as follows:

curl www.vit.org/downloads/doc/tariff.doc \ | java -jar tika-app-1.3.jar --text

and I can select from the options to save the output into html/XML, as follows:

curl www.vit.org/downloads/doc/tariff.doc \ | java -jar tika-app-1.3.jar --html

But the output is basically like a plain text written in HTML, so it is not possible to get the table structure and other document elements.

Is there any implementation of Tika, in Perl or Python, where it is possible to convert the document into XML/HTML while maintining the structure of its elements? Or is there any other tool on linux that can do this?


回答1:


Install OpenOffice SDK, it offers powerfull API for all kinds of documents (including conversions).

http://www.oooforum.org/forum/viewtopic.phtml?t=7242



来源:https://stackoverflow.com/questions/15914031/convert-msword-to-xml-html-on-linux

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!