How to parse word documents with ruby?

前端 未结 1 1018
眼角桃花
眼角桃花 2021-02-19 10:06

Does anyone know of a library that I can use on OS X/Linux to parse Word files and output the content as HTML?

I\'ve had a look at win32ole but as far as I can see it\'s

相关标签:
1条回答
  • 2021-02-19 10:34

    The Word document format (ignoring docx for the moment) is terrible and was constantly changing. IMHO that is why there are so few (read: zero) Ruby libraries out there to parse them.

    What I recommend doing is using JRuby and some of the established Java libraries for reading the doc format. Google should help you out there: http://schmidt.devlib.org/java/libraries-word.html.

    There is a Java project for reading MIcrosoft file formats, POI (http://poi.apache.org/) and they do have Ruby bindings (http://poi.apache.org/poi-ruby.html) but I'm not sure how up-to-date those are. On their site it says the Ruby bindings are for 1.8.2...

    0 讨论(0)
提交回复
热议问题