On 6 Mar 2010, at 1:59 AM, Ruedi Heimlicher wrote:
 
> I am reading text  from Word docs without problems using the NSTextView 
> method readRTFDFromFile. 
> Trying to read text  from Pages documents with file extension .pages fail an 
> returns empty strings. The same document
> saved in Word format works fine.
> I was trying the NSString method stringWithContentsOfFile with various 
> encodings but I get only garbage.
> What is going wrong? I think it must be a simple way in Apple's Xcode to read 
> Docs written with Apples Pages application.

With a bit of detective work, you can probably use AppleScript to persuade 
Pages to save a copy of the document in RTF format which you can then read into 
your NSTextView.  Asking Pages to put a copy of the document on the pasteboard 
might also work.  Of course, Pages would need to be installed on the target 
machine for this approach to work, and I doubt if all the document formatting 
(and, in particular, embedded images) would be preserved in the RTF version.

Paul Sanders.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to