How to break up HTML documents into pages for ebook?
Posted
by radnoise
on Stack Overflow
See other posts from Stack Overflow
or by radnoise
Published on 2010-05-04T15:46:03Z
Indexed on
2010/05/04
15:48 UTC
Read the original article
Hit count: 233
For an iPhone ebook application I need to break arbitrarily long HTML documents up into pages which fit exactly on one screen. If I simply use UIWebView for this, the bottom-most lines tend to get displayed only partly: the rest disappears off the edge of the view.
So I assume I would need to know how many complete lines (or characters) would be displayed by the UIWebView, given the source HTML, and then feed it exactly the right amount of data. This probably involves lots of calculation, and the user also needs to be able to change fonts and sizes.
I have no idea if this is even possible, although apps like Stanza take HTML (epub) files and paginate them nicely. It's a long time since I looked at JavaScript, would that be an option worth looking at?
Any suggestions very much appreciated!
© Stack Overflow or respective owner