readium / architecture

📚 Documents the architecture of the Readium projects
https://readium.org/architecture/
BSD 3-Clause "New" or "Revised" License
176 stars 33 forks source link

What is the pagination strategy in Readium-2? #10

Closed rkwright closed 7 years ago

rkwright commented 8 years ago

This is a Discussion

zhouhao27 commented 1 year ago

From Jean-Marie:

Here is the code snippet that does the trick:

<body style="overflow:-webkit-paged-x; overflow:paged-x;"> 

It flies!!! Tested on huge pages on Android devices. Instant display, blazing-fast horizontal scroll.

It was implemented in 2012, I didn't know that. https://trac.webkit.org/changeset/126343

It works. But I have another question. How to get total number of pages?

HadrienGardeur commented 1 year ago

We don't use "pages" in Readium because this concept only works for pre-paginated media such as EPUB FXL or PDF.

We use positions instead, which are computed when you first load an EPUB. You can request the total number of positions as a replacement for total number of pages.