View Single Post
Old 09-15-2014, 09:48 PM   #1
auspex
Addict
auspex ought to be getting tired of karma fortunes by now.auspex ought to be getting tired of karma fortunes by now.auspex ought to be getting tired of karma fortunes by now.auspex ought to be getting tired of karma fortunes by now.auspex ought to be getting tired of karma fortunes by now.auspex ought to be getting tired of karma fortunes by now.auspex ought to be getting tired of karma fortunes by now.auspex ought to be getting tired of karma fortunes by now.auspex ought to be getting tired of karma fortunes by now.auspex ought to be getting tired of karma fortunes by now.auspex ought to be getting tired of karma fortunes by now.
 
auspex's Avatar
 
Posts: 201
Karma: 1071756
Join Date: Sep 2012
Location: Nova Scotia
Device: Kobo Aura, Nexus 5x
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.
auspex is offline   Reply With Quote