readium-js-viewer
readium-js-viewer copied to clipboard
Page number progression indicator (reflow and fixed layout)
Related: https://github.com/readium/readium-js-viewer/issues/99
See also: https://github.com/readium/readium-js/issues/16
Was this feature added ?
@mahag Not yet. It is a remarkably complex feature. Are you interested in working on it?
At Bibliotheca, I took the approach generally recommended by Adobe -- For each section of the book, determine the number of bytes (this is generally available if the book is in an unexploded epub format). We then said that a "page" is approximately 2K bytes. We divided the number of bytes in a chapter by our page size, rounding up. This gives you a page count (almost completely arbitrary, of course; it works well for pages that are almost entirely text, but not so well for pages that are mostly images, as you can imagine).
So, before any content is loaded into the viewer, we know how many "pages" a particular section has. Once the section is loaded into the view, we know how many columns readium takes to display that section; a little math helps break (or group) individual columns up into pages.
So if you're looking at a text-heavy section on a large-screen browser, you may view several "pages" all at once (that is, you might have 6K bytes of text on the screen, so that would be 3 "pages". If you have a lot of images, you might get just a few hundred bytes of text on a screen; in that case a single "page" may span several screenfuls.
It's not perfect, but it's pretty close to whatever Adobe is using; and it doesn't require the entire book to be loaded into readium -- in fact, you can assign pages to sections without loading any content at all.