gerhardsletten / react-reader

An ePub-reader for React, powered by Epub.js
https://react-reader.metabits.no
Apache License 2.0
721 stars 132 forks source link

How to know the reading percentage of the book? #158

Closed leowucn closed 1 year ago

leowucn commented 1 year ago

I can get an epubcfi of current location, but how to know the reading percentage of the whole book? Is there any way to compute it ? Thanks.

gerhardsletten commented 1 year ago

@leowucn See first bullet in https://github.com/gerhardsletten/react-reader#limitations

EpubJS will need to render the current chapter before it will now how many pages it will have in the current viewport. Because of this it will not be able to tell you at which page in the whole epub-book you are at, nor will you be able to get the total pages for the whole book