View Single Post
Old 07-22-2018, 03:45 AM   #1187
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by rpgmaker View Post
I found one book that this plugin is giving 4.9k pages when in reality the paperback has 608. The previous edition of that same ebook from the same publisher has 982 pages according to the Count Pages plugin. I PM'ed kiwi with the details.
Quote:
Originally Posted by rpgmaker View Post
Here is a scrambled copy of the book. I actually had split the html file before in order to see if that would make the issue go away (originally it was one huge html file for the entire book) but the pages were still counted the same way so the issue is still there. I think the problem is the way that the styles are applied in the book. Huge mess.
I have had a look at this, and it is working as designed. And the problem is the messy code in the book.

The APNX page calculation does the page count in two ways. Then it takes the maximum of the two.

The first way assumes a line is 70 characters long and a page has 31 lines. The plugin counts the paragraphs and text in each paragraph ignoring tags within the paragraph. This works out to 912 pages.

The other method, called "fast count", is to simply divide the total length of the HTML code by 2400. This works out to be 4937 pages. This is high because the paragraph tags have long styles and there are lots of spans with long styles wrapping only a few characters.

The plugin uses the maximum of these calculations. There is a comment in the code that the maximum is used in case it is a "really weird document" and that the first method underestimates the page count.

You mention that a previous version of the book gave a lower page count. That should be because the code in it was cleaner and the first method was probably the higher value.
davidfor is offline   Reply With Quote