readium-js-viewer icon indicating copy to clipboard operation
readium-js-viewer copied to clipboard

Page number progression indicator (reflow and fixed layout)

Open danielweck opened this issue 11 years ago • 5 comments

danielweck avatar Jul 25 '14 09:07 danielweck

Related: https://github.com/readium/readium-js-viewer/issues/99

danielweck avatar Jul 25 '14 10:07 danielweck

See also: https://github.com/readium/readium-js/issues/16

danielweck avatar Jul 28 '14 21:07 danielweck

Was this feature added ?

mahag avatar May 17 '16 10:05 mahag

@mahag Not yet. It is a remarkably complex feature. Are you interested in working on it?

rkwright avatar May 17 '16 21:05 rkwright

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.

kimtuck avatar Oct 13 '16 20:10 kimtuck