How does the calibre viewer calculate page number and total pages?
I'm working on a port of davidfor's Kobo Utilities to Sony, and trying to find a reasonable way to find my position in a book that I'm currently reading. Sony doesn't make it easy. If you downloaded a book from Sony's store, or since they sold out, from Kobo, they maintain a table that gives amongst other things "percent read", but if your book is sideloaded, Sony appears to calculate the number of pages and your current page number on the fly, and it's never saved in its database (and of course they don't tell US how they do it).
So, I'm trying to figure out how the calibre viewer calculates these numbers, and can't find the code anywhere.
|