11-14-2022, 10:17 PM | #16 | ||
Wizard
Posts: 1,436
Karma: 16297052
Join Date: Sep 2022
Device: Kobo Libra 2
|
Quote:
Quote:
As far as word counting goes, I would think that you'd count any group of characters preceeded and followed by a space or newline as a word, so that differences in punctuation would not influence the count. For instance, my text editor's word counter says the preceeding sentence has 37 words, even though it contains commas and a contraction, which matches how I would count the words myself. |
||
11-14-2022, 10:18 PM | #17 |
Grand Sorcerer
Posts: 11,543
Karma: 230505502
Join Date: Jan 2014
Location: Estonia
Device: Kobo Sage & Libra 2
|
Yes, it works now with epub. Kepubs, of course, still use 1 screen=1 page.
|
11-14-2022, 10:42 PM | #18 |
Wizard
Posts: 1,436
Karma: 16297052
Join Date: Sep 2022
Device: Kobo Libra 2
|
Isn't there a patch to force KEPUB to use the regular EPUB page numbers? Maybe that would work (if you're willing to flash new firmware to test)?
|
11-14-2022, 10:46 PM | #19 | |
Grand Sorcerer
Posts: 11,543
Karma: 230505502
Join Date: Jan 2014
Location: Estonia
Device: Kobo Sage & Libra 2
|
Quote:
Well, there's an option to display Adobe numbers on the side margin and perhaps that would work for kepubs as well. But it's a lousy option, as it would cover text if you had narrow margins. I have it disabled at the moment on my Kobos, but I'll probably try it some day. Still, I don't think I'll want to use it on a regular basis. Edit: I found another discussion where it's confirmed that those side numbers only work with epubs (where they're redundant anyway). So no joy there. Last edited by Sirtel; 11-14-2022 at 10:58 PM. |
|
11-15-2022, 01:11 AM | #20 |
Wizard
Posts: 1,436
Karma: 16297052
Join Date: Sep 2022
Device: Kobo Libra 2
|
Yes, that option is only for EPUB, and whether it works depends upon the CSS of each book. Some books properly show the page number in the margins, whereas others show the page number on top of the text, making some words at the end of a line unreadable. It's too bad the WebKit renderer won't let you use other page numbering schemes anymore.
|
11-18-2022, 03:46 PM | #21 | ||
Member
Posts: 13
Karma: 1138306
Join Date: Mar 2018
Device: none
|
Quote:
Print Page Approximator v1.1.5 should implement pretty much everything you've described. There's now a new flag, "--autopage" which tells the script to automatically calculate the pages using the numeric second argument as a definition of a single page. For example: Code:
.\page_approximator.exe .\example_book.epub 30 --autopage --pagingmode lines As usual more details are in the readme on GitHub. Quote:
Personally I still think that defining pages by word count is a bit questionable because one word could have 2 letters or maybe it could have 16 letters and both would be the same with this method. But well, offering the option doesn't hurt I guess. |
||
11-18-2022, 11:37 PM | #22 | |
Wizard
Posts: 1,436
Karma: 16297052
Join Date: Sep 2022
Device: Kobo Libra 2
|
Thanks for your hard work. It's good to have one tool for all your potential EPUB pagination needs.
I can't run the precompiled binary on Windows 7 due to missing DLLs, so I guess I'll have to try it out on one of my Linux machines. Quote:
Similarly, the idea of judging paper book length by page count has always been rather silly, as the page size, font size, margin size, and line spacing differ wildly between books. Page count was just the only easily obtained metric with paper books, so it was better than nothing. |
|
12-16-2022, 08:06 AM | #23 |
Member
Posts: 13
Karma: 1138306
Join Date: Mar 2018
Device: none
|
Version 1.1.7 is out!
So during the last month I've continued tweaking the tool, adding some more niche features. I think all functionality should be covered now, which makes this a good time to post the update here.
Version 1.1.6 was the big Roman Numeral update that adds lots of functionality for handling front matter sections. You can either tell the book outright how many front matter pages there are as with the normal page count, or you can combine it with the page=>ToC map and really go nuts micromanaging. Version 1.1.7 added mostly bug fixes and some more options for handling documents that are either not included in the ebook's "spine" definition or were designated as not "linear", as those were special cases that I was not aware of when I started this project but now they can be handled in a variety of ways. Since I am now able to edit the opening post, and can just update its Attachments I also no longer need to duplicate them across many posts, so check out the new versions there. ...Still thinking about reworking it into a calibre plugin in the future. |
04-02-2023, 04:30 PM | #24 |
Member
Posts: 13
Karma: 1138306
Join Date: Mar 2018
Device: none
|
v1.1.8 with new features
Recently I noticed that one of my ebooks contained 'span' tags with the epub:type pagebreak attribute that were theoretically valid page markers, but my reader didn't recognize them because they were not properly listed in the nav file.
There were also some other curious books which had other kinds of non-standard page markers that naturally also didn't work "properly" but since they were there I thought it would be a nice feature to detect such page markers in a book and use them for pagination instead calculating pages manually. So I went and updated my Print Page Approximator script with that feature and the result is version 1.1.8. Besides passing a page number as the first argument after the filename you can now pass a css-like selector to find page marker tags to be used as the basis for the page list. for the most basic constellation in which the tags are already valid, fixing the page list is as easy as this: Code:
.\page_approximator.exe .\example_book.epub "[epub:type=pagebreak]" Needless to say this is more of a power user feature for people who already like to mess around with the innards of their books in editors like Calibre and such, but still... less manual work. As usual, the attachments are updated in the opening post. |
Tags |
epub, page breaks, page numbering, python, tool |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
embed epub3 in a web page | increase | ePub | 2 | 06-30-2020 12:41 PM |
Stop audio on another page for Epub3 | Barra | ePub | 7 | 09-12-2019 11:12 AM |
Print page range in viewer outputs single empty page | larzeb | Library Management | 2 | 04-30-2013 06:24 AM |
Start page on fixed layout epub3 | brunobruno | ePub | 12 | 03-30-2013 02:50 AM |
EPUB3 - Float audio pane with page turns | _savage | ePub | 22 | 01-30-2013 02:38 AM |