I’m interested in automatically extracting the content of .pages documents, preferably via a programming language on a web server.

There are quite a few references around the web that say Pages documents are actually zipped archives containing various files (e.g. http://www.tuaw.com/2009/11/02/iwork-secret-life-as-zip-file-revealed-includes-pdf-preview/), but a Pages document sent to me by a friend doesn’t seem to be unzippable by Mac OS X’s Archive Utility, or The Unarchiver, no matter what I change the extension to.

Is there a way to get the content from recent Pages files?

  • 2
    Ah — according to the accepted answer on this question, possibly not. – Paul D. Waite Mar 8 '12 at 14:40
  • Great find on the linked question. Let's leave this open even if it's going to take a while to get an answer. Your server based twist on things is interesting and would be highly useful even if a mac based solution was documented on the other thread. – bmike Mar 8 '12 at 15:12

If you're trying to roll your own solution, the actual .pages file is a package. If you right click it, you can show package contents. Inside the resulting folder will be all the graphic files plus a file called index.xlm.gz. If you unzip the file, it is an xml file containing all the text in the pages document.

  • Sure, that’s what I thought, but it’s not true of the Pages document I’ve got. I’m not sure if I’ve just got a borked file — it was sent to me as an e-mail attachment, so maybe that screwed it up, package-wise? (I should just install Pages from the App Store and see if that opens it.) – Paul D. Waite Mar 8 '12 at 16:30
  • 1
    hmmm... interesting. The pages file I have is also received as an e-mail attachment, and it worked fine. I hate to ask the obvious, but is your computer a Mac? What mail program are you using? – Daniel Mar 8 '12 at 17:08
  • It is indeed, using OS X 10.7.2 and Mail. Funnily enough though, I just found another Pages file he e-mailed me, and I could unzip that just fine (on the command line, or in the Finder by changing the extension to .zip (or by using The Unarchiver on the .pages file)) — although I still don’t get the “Show Package Contents” menu item when right-clicking on this file. I’m going to have to do some more testing with my friend to see what’s up. – Paul D. Waite Mar 8 '12 at 17:39
  • In case any body comes across this, I found that renaming to .zip and unzipping got me an actual .pages file that I could Show Package Contents on. But then inside there's an Index.zip which is full of .iwa files! – Rikki Aug 1 '17 at 12:26

Apple provides a hosted solution called iWork.com and has snazzy videos showing how it works. I believe it is still in beta despite being available for tens of months, and was announced that "As of July 31, 2012, you will no longer be able to access your documents on the iWork.com site or view them on the web.".

It's not clear if this will roll into iCloud once the iOS versions and the OSX versions of the apps reach parity in file format. At the moment, the capabilities and file formats are not close enough to work together well. Also keep in mind that Mountain Lion is slated for release this summer and the current versions of Pages, Numbers and Keynote are all marketed as iWork '09 and perhaps could be revamped to provide this interface using iCloud.

Lion Server does this for you as part of the Wiki Functionality. Many documents - including Pages will be rendered into a mostly html5 / css3 web page so that viewers of the wiki and embedded/uploaded documents on mobile or other client platforms do not need a Pages viewer app and can just use a modern web browser.

I could expect you were looking for more of an open-source solution where you had inner workings of the tools better documented, but this is a widely available and quite low cost solution for some to the problem you ask.

  • Gotcha. I think I read somewhere that if you put a Pages document into iCloud, you get a similar web-based viewer. – Paul D. Waite Mar 8 '12 at 15:22
  • Duh! iWork.com is also a solution. I'll add that to the answer. – bmike Mar 8 '12 at 15:34
  • 1
    And today, Apple emails me to say that the iWork.com beta program ends on July 31, 2012. The email suggests I learn more about iCloud so I can only guess what that means for the future of web access to iCloud documents. – bmike Mar 9 '12 at 20:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .