Count Pages - kiwidude68/calibre_plugins GitHub Wiki
Introduction
This plugin will determine a number of pages and/or words in a book and store the result in custom column(s). In addition to just general library browsing usage, Kindle users can generate APNX files using the value from a pages custom column. So when you send an ebook to your Kindle device from calibre, you will have page numbering available similar to that when loading Amazon books which offer this feature.
You have two methods of determining page count with this plugin.
The first approach is estimation based on the book content. It requires you either have an epub
format or a format that is convertible to epub
. For comics (cbr
or cbz
) it will count the images inside. The format used if your book has multiple is chosen based on your Preferred Input Format order, that you set in Preferences -> Behavior.
Note that if you use this option it can be an approximation only of a paperback edition due to differences in fonts, images, layouts etc. By default it uses an "accurate" algorithm similar to that created by user_none for generating APNX files for Kindle users. Alternatively in the configuration you can choose to use the page count used by the calibre e-book viewer, or you can use the Adobe algorithm used by their ADE software and some devices like a Nook. However if the format being counted is a PDF, then as of v1.4.2 there is now a special optimisation to read the actual page count rather than estimating it using any of the above algorithms.
The second page count option is to download the page count from a web page on the Goodreads.com website for your specific linked edition. This can be used for a book with any formats (or even none). How is a goodreads identifier linked? Either by using the Goodreads metadata download plugin, the Goodreads Sync plugin, or by manually typing a goodreads:xxx
id into your identifiers field for the edition of interest. If the edition you have linked to has no page count, you can switch editions using a feature added to the Goodreads Sync plugin.
Word count is optionally calculated independently of page count. As this is unavailable on a website, it is subject to the same limitations as estimating page count above, in that you must have either an epub
or a format convertible to epub
available for it to work.
You can optionally calculate a variety of readability statistics such as Flesch-Kincaid and Gunning Fog index.
Main Features
- Estimate a page count of books to a custom column using one of four algorithms.
- Alternatively download a page count from a website such as Goodreads.
- Compute a word count into a custom column
- Compute readability statistics for Flesch Reading level, Flesch-Kincaid Grade level and Gunning Fog index
- Configure different column(s)/algorithms per calibre library.
- Configure the default toolbar button clicks to use an estimated or downloaded page count.
- Configure whether to only overwrite counts if you don't already have one for that book.
- Optional keyboard shortcuts.
Configuration
Access the configuration dialog via either of:
- Preferences -> Plugins -> User interface action -> Count Pages -> Customize plugin
- Count Pages -> Customize plugin...
Page count options
Option | Description |
---|---|
Custom column | Choose which custom column will store your page count data if any. |
Algorithm | Paragraphs (APNX Accurate) - Estimates based on the # of paragraphs in the book.E-Book Viewer (calibre) - Estimates using same code as calibre ebook viewerAdobe Digital Editions - Estimates using same alorithm as Adobe softwareCustom (Chars per page) - Estimates based on user definable # characters per page |
Chars per page | Only applies if you have chosen the *Custom Chars per page) option above. |
Word count options
Option | Description |
---|---|
Custom column | Choose which custom column will store your word count data if any. |
Use ICU Algorithm | If unchecked, uses simple approach to counting words.If checked, uses more complex algorithm that should also work better with non-English languages. |
Readability options
Option | Description |
---|---|
Flesch Reading Ease | Choose which custom column will store your estimated Flesch reading score, if any. |
Flesch-Kincaid Grade | Choose which custom column will store your estimated Flesch-Kincaid grade, if any. |
Gunning Fog Index | Choose which custom column will store your estimated Gunning Fog index, if any. |
Download options
Option | Description |
---|---|
Download options grid | Choose which website source(s) to enable and offer on the plugin menu. |
Show download from all sources menu item | Enable if you want a menu item to hit all matching identifier websites enabled. |
Try to download from each source | If unchecked, downloading is stopped after first source has a page count.If checked, all sources are tried for a page count. |
Other options
Option | Description |
---|---|
Button default | Choose which menu action to perform when plugin button is clicked in toolbar. |
Always overwrite | Do not prompt for confirmation if a book already has an existing word/page count before updating it. |
Update statistics even if not changed | Force update custom column even if has the same value. |
Use Preferred Output Format if available | Use the calibre preference to determine which preferred book format to scan. |
Prompt to save counts | Whether to display a prompt to user after retrieving statistics in background. |
Custom Columns
- Preferences -> Interface -> Add your own columns
- Click on
+
button
Here are some examples for you depending on which features of this plugin you use:
Pages Custom Column
Field | Value | Comments |
---|---|---|
Lookup name: | pages | Suggested value only, you can customise |
Column heading: | Pages | Suggested value only, you can customise |
Column type: | Integers |
Mandatory |
Formatting: | {0:,d} |
Mandatory |
Words Custom Column
Field | Value | Comments |
---|---|---|
Lookup name: | words | Suggested value only, you can customise |
Column heading: | Words | Suggested value only, you can customise |
Column type: | Integers |
Mandatory |
Formatting: | {0:,d} |
Mandatory |
Gunning Fog Custom Column
Field | Value | Comments |
---|---|---|
Lookup name: | gfog | Suggested value only, you can customise |
Column heading: | Gunning Fog | Suggested value only, you can customise |
Column type: | Floating point numbers |
Mandatory |
Formatting: | {0:.1f} |
Mandatory |
Sending a custom count to a Kindle
You can enable sending your custom page count column to your Kindle.
- Go to Preferences -> Plugins -> Device Interface plugins -> Kindle 2/3/4/Touch Device Interface
- Click Customise plugin.
- Type the name of your custom column in the textbox.
Donations
If you enjoy my calibre plugins or extensions, please feel free to show your appreciation!