@bfollowell - the Count Pages plugin thread that dwanthny referred you to is probably one of the better places in terms of most recent conversations on exactly this topic. As that plugin does call the exact same code that you are talking about when counting pages in MOBI files (unless you choose a different algorithm). I had to apply a similar methodology for ePub files and spent a LOT of time fiddling and tweaking and comparing with paperback counts. As I posted on that thread (and am sure user_none will confirm) you really are going to struggle to find any way of getting the two reconciled in terms of page counts without actually reading the count off the website. Even then, different editions of the book have different page counts (large print vs hardback vs paperback) so there is no "one true answer" even if you could figure out a better algorithm.
All that happens when you start tweaking is that you get numbers that are closer for some books, but then are further away for others. There is a fundamental disconnect between an html version of a book and a printed page that means you have no chance (without further markers within the book) of trying to get them close every time, even if you can agree on which count you are trying to get close to!
|