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

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

 

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

 

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

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. 

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++) 

 

 

XML.org Focus Areas: BPEL | DITA | ebXML | IDtrust | OpenDocument | SAML | UBL | UDDI
OASIS sites: OASIS | Cover Pages | XML.org | AMQP | CGM Open | eGov | Emergency | IDtrust | LegalXML | Open CSA | OSLC | WS-I