The OpenDocument XML.org web site is not longer accepting new posts. Information on this page is preserved for legacy purposes only. For current information on ODF, please see the OASIS OpenDocument Technical Committee.
Creating ODF file through C++/C
Forum topic: Submitted by cooldude on Wed, 2009-07-15 19:17. Last updated on Wed, 2009-07-15 19:18.
Hi guys
I need to convert word file to odf format i could able to read word file .
i wanted to create ODf format for word file in c++ that will run in both linu/windows.
Thanks
ODF conversion
You could use the OpenOffice.org components, using the API to read and convert documents without starting up the OOo in GUI mode.
http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/OpenOffice.org_Developers_Guide
KOffice 2 will also run on Windows as well, so that's another office suite that can be scripted.
On a related note, the Qt 4.5 toolkit has a document writer for ODF: http://doc.trolltech.com/qq/qq27-odfwriter.html
Something to get you started
I can't comment to the ODF side of the process, but, if you are working from a Word *.DOCX file (Open XML) then there are a bunch of articles on working with this format from a number of languages at http://www.openxmldeveloper.org
Another option (but Windows only) would be to use Word automation to automate the opening of the document in Microsoft word and then saving it as an Open Document Format document.
A few caveats. 1. This approach is not suitable for use on a server- word automation doesn't scale that well. 2. It's Windows only. 3. Open Document Format is not able to express all of the characteristics of an Open XML document.
That said, the second approach from above would certainly be the easiest to achieve.
Thanks
Chris
odf
Thanks for valuable information.
as far second option is concerned that cannot be used since i need to run in both enviroment (linux/windows) .and product must support ms office 97 to 2007.
Thanks.
Additional projects
Other projects that might be helpful
http://www.artofsolving.com/opensource/jodconverter
http://oodaemon.sourceforge.net/
(while they are written in java or python, they might give you an idea on how to do it in c/c++)