View Single Post
Old 05-13-2009, 08:17 PM   #32
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,455
Karma: 27757438
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by LoganK View Post
Paragraph numbers can avoid dreaded rendering, but it still requires scanning the contents of the file. Plus, there is the issue of what constitutes a paragraph? A <p> element? A top-level box?
That doesn't matter as long as the algorithm used is consistent.

Quote:

You would know better than me, but why aren't page numbers related to page rendering? To put it more concretely, how do you figure out what page number a given chapter starts on without rendering all of the previous chapters? What reason, other than calculating page numbers, would you have to pre-render the entire document?

I can open an ePub document much faster than a BBeB file presumably because it isn't processing the entire file up front? Or am I wrong about what's going on behind the scenes?
The reason you can open an epub file faster is because internally it is split into multiple html files and only one html file is prerendered at a time. It is perfectly possible to calculate page numbers without rendering the entire document, it's what calibre does, for example (though in that case they aren't strictly "page numbers")
kovidgoyal is offline   Reply With Quote