Creating e-books with iWork Pages

The recently updated Pages application now has an ePub export — there's no simpler way to create your e-book.

PagesApple is often admired — and not just by fanbois — for the beauty of its products. But what is often overlooked is the cleverness with which it creates ecosystems in which everything works together. Your MacBook Pro works effortlessly with your iPhone, iPod and iPad. And Apple's services — such as Mobile Me — make it easy to share data across devices, put images on the web … and so it goes on.

This integration is a great selling point. It's the basis of the so-called 'halo effect' in which people who are not habitual Apple users become seduced by one device — the iPhone or iPad perhaps — and find themselves longing for other Apple products because they work together so well.

A small, largely unheralded update to iWork has given us another example.

The iWork suite is Apple's cut-price office package. It contains Pages word processor and page layout software, the Numbers spreadsheet and the Keynote presentation package. This isn't a guide to using Pages: if you want to know how to wring every last bit of capability out of this package, I suggest you pay regular visits to I Work in Pages where Alexander Anichkin demonstrates the full versatility of this software.

Export to ePub

Apple recently issued a minor update which mostly affected Pages. Version 9.0.4 of iWork included a number of bug fixes — plus (and you'd be forgiven for not having noticed this) the ability to export a document directly to the ePub e-book format. And it just so happens that ePub is the format Apple has adopted for iBooks — so if you want to get your publications into the iBookstore, they'll have to be in ePub format.

As ePub is fast becoming the de facto standard for e-books, and is the focus of the work we're doing at WebVivant Press (not least because we publish via the iBookstore among other channels) I decided to check out how good a job Pages does when creating ePub files.

Best practice

Apple has produced a short document, 'ePub best practices for Pages' (ZIP file) that contains a number of predefined paragraph styles, such as Title, Subtitle, Author, Chapter Title etc. There are about 15 that will be of interest to e-book producers. That's a little skimpy, but you can always define your own.

As we’ve discussed before, working with paragraph styles is the key to creating successful e-book files.

As suggested in the Apple guide, I deleted the text in its sample document and saved the file as a template. I then opened a new document using this template and pasted in the text from my novel, Lady Caine. I reformatted the text using just a few of these basic styles. The bulk of the book used just Chapter Title and Body styles. I named the file 'Lady Caine - basic styles', then exported it as an ePub document.

Here's how it looked in Adobe Digital Editions:

Digital Editions

The first thing to notice is that the e-book has a table of contents. That tells me that Pages has cleverly split the text into separate files, one per chapter. It does this based on the table of contents set-up in your Pages document. This is very smart and makes for more standards-compliant ePub files.

ePub filesThe ePub unzipped

I unzipped the .epub file and checked the file hierarchy (right), which confirmed my suspicions about the separate chapter files.

Here's the OPF file (named epb.opf in this case):

<?xml version="1.0" encoding="UTF-8"?>
<package unique-identifier="BookId" version="2.0" xmlns="http://www.idpf.org/2007/opf">
    <metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf">
        <dc:title>Lady Caine - basic styles</dc:title>
        <dc:creator opf:role="aut">Steve Mansfield-Devine</dc:creator>
        <dc:contributor opf:role="bkp">Pages v4.0.4</dc:contributor>
        <dc:date>2010-08-28</dc:date>
        <dc:subject>Fiction &amp; Literature</dc:subject>
        <dc:identifier id="BookId">07CBB607-5854-4D85-9905-9303471CA34E</dc:identifier>
        <dc:language>en</dc:language>
    </metadata>
    <manifest>
        <item id="cover" href="cover.xhtml" media-type="application/xhtml+xml"/>
        <item id="chapter-1" href="chapter-1.xhtml" media-type="application/xhtml+xml"/>
        <item id="chapter-2" href="chapter-2.xhtml" media-type="application/xhtml+xml"/>
        <item id="chapter-3" href="chapter-3.xhtml" media-type="application/xhtml+xml"/>
        <item id="chapter-4" href="chapter-4.xhtml" media-type="application/xhtml+xml"/>
        <item id="chapter-5" href="chapter-5.xhtml" media-type="application/xhtml+xml"/>
        <item id="chapter-6" href="chapter-6.xhtml" media-type="application/xhtml+xml"/>
        <item id="chapter-7" href="chapter-7.xhtml" media-type="application/xhtml+xml"/>
        <item id="chapter-8" href="chapter-8.xhtml" media-type="application/xhtml+xml"/>
        <item id="chapter-9" href="chapter-9.xhtml" media-type="application/xhtml+xml"/>
        <item id="chapter-10" href="chapter-10.xhtml" media-type="application/xhtml+xml"/>
        <item id="chapter-11" href="chapter-11.xhtml" media-type="application/xhtml+xml"/>
        <item id="chapter-12" href="chapter-12.xhtml" media-type="application/xhtml+xml"/>
        <item id="chapter-13" href="chapter-13.xhtml" media-type="application/xhtml+xml"/>
        <item id="stylesheet" href="css/book.css" media-type="text/css"/>
        <item id="ncx" href="epb.ncx" media-type="application/x-dtbncx+xml"/>
    </manifest>
    <spine toc="ncx">
        <itemref idref="cover" linear="yes"/>
        <itemref idref="chapter-1" linear="yes"/>
        <itemref idref="chapter-2" linear="yes"/>
        <itemref idref="chapter-3" linear="yes"/>
        <itemref idref="chapter-4" linear="yes"/>
        <itemref idref="chapter-5" linear="yes"/>
        <itemref idref="chapter-6" linear="yes"/>
        <itemref idref="chapter-7" linear="yes"/>
        <itemref idref="chapter-8" linear="yes"/>
        <itemref idref="chapter-9" linear="yes"/>
        <itemref idref="chapter-10" linear="yes"/>
        <itemref idref="chapter-11" linear="yes"/>
        <itemref idref="chapter-12" linear="yes"/>
        <itemref idref="chapter-13" linear="yes"/>
    </spine>
    <guide>
        <reference type="text" title="Title Page" href="cover.xhtml"/>
    </guide>
</package>

A few observations.

First, it has created an appropriate 'creator' entry, presumably because I used the Author paragraph style for my name.

Pages has also created a unique identifier, which is important, although I would want to hack this to use the ISBN instead. The date given is the date the file was created and I'd want to change this to the official publication date. And I'd want to add publisher details.

In fact, I'd probably want to make a number of changes to this file, just to ensure it matches our standard approach to ePub packages. For example, even though I entered a number of keywords into Pages' 'info' panel, the software didn't create any keyword entries in the metadata section.

So I'd end up unzipping the ePub file, making the changes and zipping it up again, as described in this earlier post. But that's only because I'm being picky.

The acid test

Now for the real test. I ran the ePub file through epubcheck 1.0.3. It passed with no errors reported.

I had less success adding a cover image to the start of the file. There is an option, when exporting, to use the first page as the cover image. Inserting a JPEG or PNG file on to the first page led to the creation of a relevant entry in the epb.opf file — but it was empty. Even exporting the sample file from Apple failed to produce a cover image when viewed in Adobe Digital Editions. I'll need to investigate this further, but it's not a big deal for us. We send cover images separately when supplying to the iBookstore and other e-book channels.

Quick and easy

To sum up, creating a standards-compliant ePub file from Pages is now very simple. While I might be picky about metadata, the ePub files output by Pages are well-formed and will be accepted without quibbling by the Apple iBookstore — which is rather the point.

Adding Pages to the publishing ecosystem created by the iBooks app, the iBookstore, the iPad and the iPhone means that Apple now has the entire process covered, from writing the book, through digital file creation, distribution and sales to reading on a mobile device. And the whole thing is relatively effortless.

 

Comments (8)

Tags: self-publishing ePub layout design books e-books Pages Apple iBooks iBookstore

Please note: comments on this site are moderated - partly to eliminate spamming and partly to avoid wasting space and bandwidth. Any comments deemed offensive, juvenile, stupid or pointless are deleted.

Write a comment

  • Required fields are marked with *.

If you have trouble reading the code, click on the code itself to generate a new random code.
Security Code:
 
reev
Posts: 4
Comment
ebook formatting
Reply #8 on : Mon October 17, 2011, 00:56:45
thanks so much for sharing this. it's so useful. couldn't find a step by step process making ebooks for pages. have question: how do you separate chapters? the page break function doesn't seem to work. hope to hear from you. thanks!
admin
Posts: 4
Comment
Re: Creating e-books with iWork Pages
Reply #7 on : Mon October 17, 2011, 01:21:50
Reev,

If you use Apple's template, as described, it will create the chapters based on the chapter heading style. Each time it encounters text in that paragraph style, it will start a new chapter.

I still prefer to use InDesign, as it gives me a little more control, and CS5 produces ePub files that are close to (though not quite) ready to go.
reev
Posts: 4
Comment
re: Creating e-books with iWork Pages
Reply #6 on : Sat October 22, 2011, 07:53:58
thanks for the quick reply. i finally got how the template works. you mentioned that you unzipped the ePub file. did you have to use another program. thanks again for all the help!
admin
Posts: 4
Comment
Re: Creating e-books with iWork Pages
Reply #5 on : Sat October 22, 2011, 11:34:16
Reev, I unzipped the file from the command line using the standard command:

unzip name_of_zipfile
reev
Posts: 4
Comment
re: Creating e-books with iWork Pages
Reply #4 on : Mon October 24, 2011, 20:58:06
Thank you! I have one last question if you don't mind. Have searched in many forums, but couldn't find the answer.

The ePub template that Apple provided doesn't say how to work with sub chapters. Let's say I have a chapter entitled "Swimming". The sub-chapters are "Basic Strokes" and "Advance Strokes". When it creates a TOC, the sub-chapters aren't listed.

And what if I want to start the sub-chapters in another page? Page or section breaks don't seem to work.

Hope to hear from you again! :)
admin
Posts: 4
Comment
Re: Creating e-books with iWork Pages
Reply #3 on : Tue October 25, 2011, 01:12:15
Can't help you with the sub-chapters, I'm afraid - haven't tried that in Pages. It sounds like you'd need to get into some serious hand-coding to fix Pages' ePub output.
reev
Posts: 4
Comment
re: Creating e-books with iWork Pages
Reply #2 on : Thu October 27, 2011, 03:36:30
Unfortunately (and fortunately), I have abandoned Pages in creating ePubs. It just lacks the coding detail necessary to come up with a decent, and professional looking eBook. I discovered Sigil and haven't looked back since. I will still use Pages for word-processing though. Thanks for all the help!
admin
Posts: 4
Comment
Re: Creating e-books with iWork Pages
Reply #1 on : Thu October 27, 2011, 04:14:40
Reev, If your aim is to produce high-quality, professional e-books, I think you've made the right decision. I think Pages will be useful for people who just want to get from writing to e-books with the minimum amount of effort and don't care about the fine details of file structure etc. I'm not being sniffy - I think Pages is a fine tool for that, just as you can use it in place of a DTP package if you don't need the advanced tools that, say, InDesign provides.