Skip to content

Automatic Pagination

Thertzlor edited this page Apr 2, 2023 · 1 revision

If rather then applying a predefined page count you want the script to estimated a page count based on custom parameters you can use the --autopage flag. This option changes the function of the primary pages argument from defining the final number of pages to setting the size of a single page. As an example:

py .\page_approximator.py .\example_book.epub 1500 --autopage

This command will not create a book with 1500 pages but rather but rather define that a single page has 1500 characters and the final number of pages are calculated based on that.
Just as with the regular pagination function, the --pagingmode argument can be used to modify the behavior of the script but now in the context of how to interpret the single page definition:

py .\page_approximator.py .\example_book.epub 30 --autopage --pagingmode lines

...Defines that a single page consists of 30 lines of text.

py .\page_approximator.py .\example_book.epub 250 --autopage --pagingmode words

...Defines that a single page consists of 250 words.

The numeric --pagingmode argument for maximum line length also works in this mode.

Clone this wiki locally