views:

188

answers:

2

I'd like to import and export from a Cocoa application from/to OpenOffice format. Spreadsheets, in particular, but also potentially text.

I've looked, but I can't seem to find the right combination of search words.

+2  A: 

TextEdit will open ODF files. The source for TextEdit is on your machine in the examples section of the developer folder. /Developer/Examples/AppKit/TextEdit/

So have a look in there and see if you can find where they do the import.

Zaph0d42
+3  A: 

Text is rather easy as OpenDocument text documents are directly supported by the Cocoa Text System since OS X 10.5. Thus, if you use that, you'll get ODT import and export for free.

Unfortunately, there is no native support for spreadsheets that I'm aware of. The format isn't too hard to grok though and especially export functionality should be something you should be able to get going without too much trouble. Have a look at the spec and at David Eisenberg's OpenDocument Essentials. A basic importer shouldn't be too hard either but it depends on your specific requirements. Avoid offering round-trip functionality with other ODF applications and stick to ODF import/export unless it is critical for your users to collaborate on ODF documents with users of other ODF applications. Good luck.

VoidPointer