futurepress / epub.js

Enhanced eBooks in the browser.
http://futurepress.org
Other
6.46k stars 1.11k forks source link

Total number of pages #1297

Open mariusz4044 opened 2 years ago

mariusz4044 commented 2 years ago

Hi, it's 2022, has the problem with total number of pages been resolved? Is there a solution to get number of pages? I am doing an online library page I need to have the number of pages in a particular ebook.

Apart from get the number of pages in a chapter, is it possible to get all pages depending also on the screen/font size?

const {page,total} = this.rendition.currentLocation().end

Ps. Is there any epubjs alternative?

johnfactotum commented 2 years ago

Apart from get the number of pages in a chapter, is it possible to get all pages depending also on the screen/font size?

As you said, it's possible to get the number of pages in a rendered chapter. So basically you would have to render every single chapter and sum up the number of pages.

Ps. Is there any epubjs alternative?

You might want to check out Bibi. As far as I can tell, it seems to render all chapters in a book at once, so it has no trouble showing the total number of pages.