• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: reading text rom Pages doc
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: reading text rom Pages doc


  • Subject: Re: reading text rom Pages doc
  • From: Andrew Merenbach <email@hidden>
  • Date: Sat, 6 Mar 2010 15:19:21 -0800

On Mar 6, 2010, at 3:14 PM, Fritz Anderson wrote:

> 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.
>
> Pages documents use a proprietary format that Apple has not published, and may change. They aren't text at all, so it will do no good to try different character encodings. The "file" command identifies one Pages document I have as a ZIP archive.
>
> Microsoft has published the format of some Word file types, and Cocoa takes advantage of that knowledge to read those kinds of files.
>
> 	— F
>

To build upon this, trying to read in a Pages '08 document (not the latest, of course) is going to be impossible with -stringWithContentsOfFile: regardless, since Pages '08 documents are saved as document bundles (packages), rather than files.  Pages '08 is old by now, but compatibility may (or may not) be an issue for your program, depending upon the specifications that you are trying to meet.

Best,
	Andrew_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: reading text rom Pages doc
      • From: "Paul Sanders" <email@hidden>
References: 
 >reading text rom Pages doc (From: Ruedi Heimlicher <email@hidden>)
 >Re: reading text rom Pages doc (From: Fritz Anderson <email@hidden>)

  • Prev by Date: Re: reading text rom Pages doc
  • Next by Date: Re: reading text rom Pages doc
  • Previous by thread: Re: reading text rom Pages doc
  • Next by thread: Re: reading text rom Pages doc
  • Index(es):
    • Date
    • Thread