Jump to content

How iBooks Stores User Bookmarks

0
  Sanders Kleinfeld's Photo
Posted Aug 16 2010 08:21 AM

Last week, @OReillyMedia received a tweet from an ebook bundle customer that piqued my interest:

Quote

If I get an updated ePub book from @OReillyMedia, how do I get iTunes to update it without creating a second copy or losing bookmarks?


As someone who adds bookmarks sparingly (if at all) when reading ebooks, I had previously never given much thought to what happens to bookmark data when you update an EPUB file in iBooks. But now I was curious: Do the bookmarks disappear along with the old EPUB file? Are they banished to the deep recesses of your iPad's subconscious?

To get some answers, I did a bit of manual editing of an EPUB I had on my laptop, and experimented with loading different versions of the file to my iPad to see whether iBooks (version 1.1.2) preserved my bookmarks across updates. Here's what I found out:1

  • The iBooks reader uses an EPUB's OPF file to uniquely identify it and to associate it with the bookmark data added by the user. If two EPUBs have different .opf files, iBooks considers them to be two different books.2

  • If you replace an EPUB file in iBooks with a new EPUB file that is completely identical (contain all the same digital assets) with the exception of some small metadata differences in its .opf file, iBooks will still consider the new EPUB to be a different book, and will not preserve any of the bookmarks that you added to the old EPUB.

  • Interestingly, the converse is not necessarily true. I tried editing some of the HTML files in an EPUB, while leaving the .opf file exactly the same. When I replaced the EPUB in iBooks with the new EPUB, iBooks considered them to be the same book, and carried over my bookmarks to the new EPUB.


Here at O'Reilly, pretty much every time we generate a new EPUB of an book3 and release it for customers, the .opf3 file is going to be different in some way, due to changes made in the source XML files. So, any time a customer updates one of our EPUBs in iBooks, he is most likely going to lose his bookmarks.

This is unfortunate, but if you think about it, preserving bookmarks across file revisions poses quite a challenge for even the most sophisticated ereader software. What if O'Reilly released an EPUB update that removed a technically inaccurate section from a book, and someone had that section bookmarked in her older version of the EPUB? How would iBooks preserve a bookmark to a section that no longer existed?

Hopefully, the next generation of ereader software (iBooks included) will be more adept at recognizing updated versions of content and preserving bookmarks. Until then, bookmark and update with care!

1 Disclaimer: The information herein is based solely on my own experimentation. I could not find any documentation online from Apple or elsewhere on how iBooks manages bookmark data.

2 The OPF file is where an EPUB's metadata is stored. This metadata includes the book title, author, publication date, and a set of unique IDs used to reference every digital asset archived in the EPUB file (HTML files, images, CSS stylesheets, etc.) and indicate how the HTML files should be sequenced.

3 We generate the majority of our EPUB files using The DocBook Project's XSL stylesheets.

Tags:
0 Subscribe


1 Reply

0
  amyseqmedia's Photo
Posted Oct 28 2010 09:57 AM

Wow, I just got stung by an EPUB update and lost all of my bookmarks and notes.

It's too bad that bookmarks and notes don't have a kind of multi-level location format: a bookmark could contain the character locations, the paragraph, and the chapter. That way if the character locations change at least you can try to match the bookmark to the paragraph. Or if the paragraph changes, then at least the chapter. This might be a generalized location system.

Think of it almost like addressing an envelope where if the person's name changes at least you have the house number, or if the street name changes you have the city.

The ultimate point of this is that data that I spent time to enter might have been important and losing it is very frustrating.