views:

1429

answers:

3

Hi all, :)

I'm developing a simple epub reader on iPhone but been wondering how to go about loading it. I know reading files such as a PDF is somewhat straightforward because it's one file in itself and can be loaded using UIWebView or CoreGraphics. It's unlike ePub which requires a bit more work to get(parsing xml's ...etc) the contents since it's essentially a ZIP file.

Now the way I thought of doing it is by doing the following. But I'm not sure if it's the right way:

  1. Download the book.epub file to UserDomain as in this example
  2. Unzip book.epub file to create a book dir where all the contents will be
  3. From the created book dir, access the files and do the necessary(retrieve, parse.. etc).
  4. When the epub is unloaded or application's been closed, delete unzipped version -- the book dir
  5. Do the cycle from unzipping when opening the book.epub again.

Unless I can access ePub file contents directly, I guess there's no need to unzip them... which is unlikely because it's a ZIP.

Thanks in advance for any help. :)

Kind regards, oonoo

A: 

That all looks fine to me. Another option would be to extract the contents of the zip to NSData objects in memory, but that may not work on extremely large files.

rpetrich
A: 

Good Day friends...

I am sorry to bother you but I'm really in search for the answer, too. Please get in touch with me if you have an answer/guide. I'm about to prepare iPhone application utilizing full epub features, not just to read them.

e.g. Adobe Reader - having all facilities attached to PDFs

Thanking You, Paresh Thakor

MobiHunterz
A: 

Hi Paresh,

Have you done that? How are you increasing the font and aligning the text?

ashish