epub.js icon indicating copy to clipboard operation
epub.js copied to clipboard

how to get the progress a reader made on a book using eupbjs

Open mohamadabdelhady opened this issue 4 years ago • 1 comments

I am building a website for reading book online and I want a way to get the progress mad by a user on a book so I can save it.

mohamadabdelhady avatar Dec 31 '21 13:12 mohamadabdelhady

Use book.locations.percentageFromCfi(currCfi) where currCfi is the current location CFI. You can get the current CFI with the relocated event. the relocated event sends an object with information about the current page.

rendition.on("relocated", function(location) { console.log(location.start.cfi) });

OriKuttner avatar Dec 31 '21 14:12 OriKuttner