Manatee

Opening a .pages, .numbers or .key file on a Mac without iWork

A colleague sends a .pages document or a .key deck. You do not have the application, or you do and it refuses the file. The Finder shows a generic icon and double-clicking achieves nothing.

There are four routes, in increasing order of effort, and the last one works even when the file is damaged.

Route one: ask for a different format

Worth saying, because it is free and it is the only route that preserves everything. Pages, Numbers and Keynote all export to PDF, Word, Excel and PowerPoint from File, then Export To.

If the sender can spend thirty seconds on that, you get a file that opens properly with formatting intact. Every other route below loses something.

Route two: iCloud in a browser

Apple runs Pages, Numbers and Keynote as web applications at icloud.com, free with an Apple Account, and they work in any modern browser on any platform.

Sign in, go to the relevant application, and drag the file into the browser window to upload it. You can read it, edit it, and export it to PDF or an Office format from there.

This is the practical answer for most people. It requires an Apple Account and an upload, which matters if the document is confidential, but it handles the file faithfully because it is the same software that created it.

Route three: the file is a ZIP archive

Modern iWork files are ZIP archives. That is not a workaround; it is how the format is built, and you can confirm it:

file -b document.pages

The answer is Zip archive data. Look inside:

unzip -l presentation.key | head -20

A real Keynote file listed this way shows two kinds of entry:

Data/image5-18.jpeg        4,032,087
Data/image9-26.jpeg        3,629,670
Index/Document.iwa             6,765
Index/TemplateSlide.iwa        1,016

The Index entries are the document structure, stored in Apple’s own compressed format. They are not readable without the application, and there is little point pursuing them.

The Data entries are the interesting part: they are the original media, stored as ordinary files. Every photo, every embedded image, at full resolution, exactly as it was inserted.

Extract them:

mkdir extracted
unzip -o presentation.key -d extracted
open extracted/Data

For a deck of photographs, or a document built around images, this recovers the substance of it even though the layout and text are locked away. The sample file inspected above held 104 entries totalling 30 MB, nearly all of it recoverable imagery.

This route needs no account, no upload and no software. It gets you the pictures, not the words.

Route four: older files are folders

Files from older versions of iWork are packages: directories that the Finder displays as single documents. file -b reports a directory rather than a ZIP archive.

Right-click the file and choose Show Package Contents to open it as a folder. Inside there is usually a QuickLook directory containing Preview.pdf, which is a full rendering of the document generated when it was saved.

That PDF is the whole document, laid out correctly, readable by anything. For older files it is by far the best outcome available without the original application.

When the file will not open in iWork either

If Pages or Keynote itself refuses the file, it is damaged rather than merely inaccessible.

Test the archive:

unzip -t document.pages

No errors detected means the container is sound and the problem is in the document structure. Errors mean the archive is damaged, and how much you recover depends on where.

Even a damaged archive usually yields its Data folder, because unzip extracts what it can and reports what it cannot:

unzip -o document.pages -d extracted 2>&1 | tail -20

Manatee reads what survives in a damaged archive-based document and writes a clean copy of the recoverable parts, working from a duplicate so the original is untouched. It is honest about the outcome rather than producing a file that iWork will also refuse. For these formats the realistic recovery is the media and any readable structure, which is why route three above is worth trying regardless. Fixing a corrupted ZIP archive applies directly, since these files are ZIP archives underneath.

Which route to use

  • The sender is available: ask for a PDF. Best result, no effort.
  • You need to read and edit it: iCloud in a browser.
  • The document is confidential and you only need the images: extract the ZIP.
  • The file is old: Show Package Contents and take Preview.pdf.
  • The file is damaged: extract what the archive still yields.

Questions

Can I convert a .pages file from the command line? textutil handles RTF, DOC, DOCX and HTML, and does not read iWork formats. There is no supported command-line conversion; the format is proprietary and its structure files are not documented.

Why does renaming .pages to .zip work? Because it is already a ZIP. Renaming only changes which application claims it. You can also unzip it without renaming, which avoids confusing the Finder.

The document opens but the fonts are wrong. Fonts are referenced, not embedded. If the document uses a font you do not have, substitutions happen. Exporting to PDF on the sender’s machine avoids it entirely.

Is there a risk in unzipping a file someone sent me? Extracting an archive is safe in itself; the risk is in what you open afterwards. Images are low risk. Do not run anything executable that appears inside a document archive, since it has no business being there.