Saturday, October 01, 2005

Compatibility with Word documents

Recently, one of the AppleTrans fellows reported problem reading Microsoft Word documents with its proprietary attributes. As a matter of fact, AppleTrans depends on the AppKit framework for rendering RTF files. Unfortunately, the current RTF reader (along with the text layout system in the framework) does not support some of the features expressible in RTF, including header and footer.

There is a pair of methods in the NSAttributedString class that support reading/writing Microsoft Word documents (.doc files):

- (id)initWithDocFormat:(NSData *)data documentAttributes:(NSDictionary **)dict;
- (NSData *)docFormatFromRange:(NSRange)range documentAttributes:(NSDictionary *)dict;

According to the AppKit release note, however, "Cocoa's feature support for doc format reading and writing is very nearly equivalent to its support for RTF reading and writing." So, the above methods would only mean reading/writing the document directly from/to the Word file. Yet it might be a little time-saver though. Does anyone like to help writing a filter?

0 Comments:

Post a Comment

<< Home