Manipulating OOo Documents with Ruby
April 14th, 2007
Linux Journal article, published March, 2004
OpenOffice.org (OOo), a featureful suite of office tools that includes applications for word processing, spreadsheet creation and presentation authoring, has seen an increase in enhancements and overall quality. OOo lives up to its name by making both source code and file formats completely open. This is a big plus for anyone wishing to manipulate documents without needing to have the creator application present. In general, two ways exist to access or manipulate document content. One is to automate the source application, letting a program substitute for a person entering commands. The other is to go directly to the document. An advantage of the first approach is you get to exploit the power of an existing application, saving yourself a good deal of time figuring out file formats and processing commands. OOo can execute internal macros and expose a scripting interface through UNO. The downside is you need to have the actual application handy, and even then it may not be able to do what you want. This article describes the second approach: accessing and manipulating documents by going directly to the source.
Read the article: http://www.linuxjournal.com/article/7236
2 Responses to “Manipulating OOo Documents with Ruby”
Sorry, comments are closed for this article.
May 6th, 2007 at 04:44 AM
Hi James, I am somehow confused about this post, it seems that the article and the project is quite outdated. Some of the links are broken and your OOo4R project is not to planned to go for OOo v2.
Do I miss something?
Cheers Robert
May 24th, 2007 at 09:26 PM
Robert: Yes it is fairly old; as it says at the top, “Linux Journal article, published March, 2004”
At the time I had some vague ideas on what I might do with OOo, but in actual practice I did not find a real need to match my initial ambition. Plus I was stalled for a bit with zip library issues on Win32.
In the end, I lost interest. I had somewhat hoped that putting the code up on rubyforge.org would have attracted some interest and some help, but that never happened until long after I moved my attention to other projects and OOo2 came out.
That said, the fundamental approach is applicable to any zipped XML document, and if there isn’t code with stealing than it ay serve as an example of what to do. Or maybe what not to do.