On 29 Sep 2009, at 16:47, Marnen Laibow-Koser wrote:

>> And to put it quite simple: the old Word format is a closed format  
>> and
>> there is no rubygem available for reading or writing Word files on
>> Linux since no one has gone through the effort of reverse engineering
>> it (and there are more than enough alternative solutions available
>> such as RTF and HTML).
>
> I believe you may be incorrect on the reverse-engineering part.   
> Plenty
> of other software reads and writes old MS Word files -- which means  
> that
> *someone* figured out the spec...

It's done through OLE and you need a Windows server for it. Plenty of  
examples for that.

You could also try the OpenOffice conversion route, but the number of  
hoops and the amount of work you're getting yourself into is going to  
be so staggering I wouldn't want to be in your place.

Basically, you would have to go through these steps:
        • Create an ODT template manually with placeholders, like [%value-to- 
replace%]
        • When instantiating the template with real data in Ruby, unzip the  
template ODT (it's a zipped XML), and run against the XML the textual  
replace of the placeholders with the actual values.
        • Zip the ODT back
        • Run the conversion ODT -> DOC via OpenOffice command line interface.


Best regards

Peter De Berdt


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to