View Single Post
Old 07-23-2018, 12:19 AM   #1188
rpgmaker
Connoisseur
rpgmaker began at the beginning.
 
Posts: 86
Karma: 10
Join Date: Oct 2014
Device: Kindle Paperwhite 2
Quote:
Originally Posted by davidfor View Post
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.
I figured. Thanks for looking into it. It's the only book that has ever given me any issues with this plugin so I'm just gonna let it be.
rpgmaker is offline   Reply With Quote