user168541
user168541

Reputation: 41

iPhone UIWebView epubs split page by page

It's really interesting how book reading applications like Stanza or Eucalyptus split epubs which is html by page so lines are clear and next page starts at the correct line. Does anyone has any idea how this could be accomplished?

Upvotes: 4

Views: 1488

Answers (1)

Engin Kurutepe
Engin Kurutepe

Reputation: 6747

The easiest way is to render a chapter inside an epub in a UIWebView and the use javascript to compute page boundaries. The interface between Cocoa and JS is kind of tricky but stringByEvaluatingJavaScriptFromString: can be used to run JS inside a UIWebView.

Once you have the page boundaries you can scroll the chapter using window.scrollTo(x,y); and adjust the size of your UIWebView according to your page boundaries to prevent any incomplete lines showing from the bottom.

Upvotes: 3

Related Questions