Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 03-12-2013, 04:20 PM   #496
fairchild
Junior Member
fairchild began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Mar 2013
Device: Kindle 3
Hey kiwidude. awesome plugin. I have a question.
I've been searching the whole board for an anwer, to no avail.
This plugin generates page number automatically based on charachter counts, right?

What if i edited and tuned my ebook to epub spec to include page number markers in toc.ncx (pageList and everything, as in https://wiki.mobileread.com/wiki/NCX, also as implemented in this example: toc.ncx and content.xhtml)

I need to generate a valid APNX file for my kindle, but based on the page anchors in the epub, not automatically from char count (as calibere does now). I really need this because I need to be able to reference the ebook as if it were a print edition.

I haven't found any way to do this. Do you think it would be hard to implement?

Last edited by fairchild; 03-12-2013 at 04:41 PM.
fairchild is offline   Reply With Quote
Old 03-14-2013, 01:42 AM   #497
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,635
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
@fairchild - welcome to MobileRead.

Your query isn't really related to this plugin at all, because the actual generation of the apnx file (which is what you want to change) is not the job of this plugin. All this plugin does is fill in a custom column with a total page count, which the calibre built in APNX generation code can optionally use to then create the APNX file evenly dividing the book by that total number.

What you are requesting is completely different - instead you want the html parsed to identify the page number at that point and for that to be used in the apnx file, if I understand it all correctly.

This is outside the scope of this plugin. Your only options would be to (a) make your own hacked version of the standalone APNX plugin (which user_none no longer maintains in its current state), or to change the calibre source code to use the alternate approach.

I have no interest personally in taking on either of those things since the current way of "estimating" a page count and generating an APNX based on that is perfectly adequate for my personal needs, so good luck with it if you decide to pursue it in one way or another...
kiwidude is offline   Reply With Quote
Advert
Old 03-14-2013, 09:57 AM   #498
fairchild
Junior Member
fairchild began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Mar 2013
Device: Kindle 3
aaah, I see ... i messed up threads
Thank you for replying. I appreciate that you took the time to type an answer and being frank about not caring about this particular issue .

I'll see if I'll manage to hack something together. user_none documented APNXs very well after all. If I fail at python I'll just resort to having the page number display in the body of text. it'll be ugly but at least it will work in any ereader ever.
Sadly page numbering is a must for scholar/research books and articles. PDFs are the most easy solution but they don't fit well in a 6" kindle screen.

fairchild is offline   Reply With Quote
Old 03-15-2013, 02:38 AM   #499
bauerhjb
Connoisseur
bauerhjb began at the beginning.
 
bauerhjb's Avatar
 
Posts: 52
Karma: 19
Join Date: Apr 2010
Location: northern Idaho, USA
Device: laptop, netbook, LG & Nextus tablets - Window 10, 8.1, 7,
Just a question about the plug in. I've had reason to check page and word counts for my pdfs and have noticed that the counts appear to be really off lately. I did some back checking and the plug in did a great job on pdfs up until about the middle of 2012. I was wondering if Adobe might have changed things? By way off counts an example would be words estimated at 7543 but actually count in a word document would show 79500. I checked over 100 books from earlier and another 100 or so of recent adds. Not all of them would be this far off, but there doesn't seem to be a pattern to the errors. I read my books on my computer not on an ereader. Just didn't know if anyone else had noticed this. Word counts for azw3, epub, mobi all are much closer to reality. Just wondering...thanks
bauerhjb is offline   Reply With Quote
Old 03-15-2013, 11:05 AM   #500
Eschaton
Junior Member
Eschaton began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Mar 2013
Location: Portland, Oregon
Device: ipad
@baierhjb

Not really an answer for you but what I do as a workaround for PDF's is to make a temporary conversion to epub, run CountPages on that, then delete the EPUB afterwards leaving the original PDF and a more accurate word count. This seems to work relatively well for those PDF's that don't respond well to the plugin.

Last edited by Eschaton; 03-15-2013 at 11:07 AM.
Eschaton is offline   Reply With Quote
Advert
Old 03-15-2013, 09:27 PM   #501
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,635
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
You can see from the version history in the first post that at the end of May last year the plugin was changed to use some new PDF libraries that calibre uses. Amongst these changes is that it no longer attempts to estimate the page count for a PDF as a result of converting it to text, instead it uses the actual PDF metadata. So you should get the exact same number of pages appearing for a PDF as if you open it up in Adobe Reader or Foxit for instance.

The numbers you get from the plugin now should be the accurate ones representing PDF pages, not a page count based on how much text was on a "page" like it used to do previously.
kiwidude is offline   Reply With Quote
Old 03-16-2013, 04:40 AM   #502
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,227
Karma: 11768331
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
@kiwidude, are you going to do you plugin available from the command line now that calibre offers this feature? I would love it.
Terisa de morgan is offline   Reply With Quote
Old 03-18-2013, 05:10 PM   #503
Katsunami
Grand Sorcerer
Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.
 
Katsunami's Avatar
 
Posts: 6,111
Karma: 34000001
Join Date: Mar 2008
Device: KPW1, KA1
I've never had problems with page counts: I just configured Calibre to send page count data to my Kindle.

Enter Stephen King's IT. (Original epub version.) It looks 100% perfect in Sigil, and except for one tiny thing, it fully validates. Still, page counting is wrong: on the Kindle, the entire book only has 2 pages. All my other books, converted to AZW3, same as this one, work just fine. While looking into this, I discovered this plugin.

I love it's "custom number of characters" feature. I've picked a few paperbacks, and counted how many characters are on one page. It hovers around 2600 with most of them (64-67 characters a line, 40 lines per page). As there is a bit of loss with chapter headings, white lines and half blank pagese, I've guessed 2500 characters and did a calculation. The result is very close; 2-5% more pages than the paperbacks. (I have several books as paperback and as epub).

Close enough for me: now I can actually count on the page numbers to be quite representing of an actual paperback, take or leave 25 pages or so on an actual book that's 500 pages long.

Beautiful plugin. Thanks for creating it.
Katsunami is offline   Reply With Quote
Old 03-29-2013, 11:03 AM   #504
Ansem_93
Zealot
Ansem_93 could sell banana peel slippers to a Deveel.Ansem_93 could sell banana peel slippers to a Deveel.Ansem_93 could sell banana peel slippers to a Deveel.Ansem_93 could sell banana peel slippers to a Deveel.Ansem_93 could sell banana peel slippers to a Deveel.Ansem_93 could sell banana peel slippers to a Deveel.Ansem_93 could sell banana peel slippers to a Deveel.Ansem_93 could sell banana peel slippers to a Deveel.Ansem_93 could sell banana peel slippers to a Deveel.Ansem_93 could sell banana peel slippers to a Deveel.Ansem_93 could sell banana peel slippers to a Deveel.
 
Posts: 110
Karma: 3090
Join Date: Mar 2013
Location: Italy
Device: Kindle Paperwhite 3
hi, i tried your plugin,but i have some trouble:
1)I can't change the number in the custom metadata "pages"
2)I can't download the number of pages. I have this error:
Quote:
"Title" (No goodreads id)
3) the number of pages is always wrong with any type of algorithm: with paragraph i have on my K4NT i have 289, with your plug-ing 332 with "the hunger games",and 291 vs 335 for "catching fire".

How can I resolvethis 3 problems?

Last edited by Ansem_93; 03-29-2013 at 11:05 AM.
Ansem_93 is offline   Reply With Quote
Old 03-29-2013, 11:13 AM   #505
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,761
Karma: 54401244
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by Ansem_93 View Post
hi, i tried your plugin,but i have some trouble:
1)I can't change the number in the custom metadata "pages"
2)I can't download the number of pages. I have this error:

3) the number of pages is always wrong with any type of algorithm: with paragraph i have on my K4NT i have 289, with your plug-ing 332 with "the hunger games",and 291 vs 335 for "catching fire".

How can I resolvethis 3 problems?
Buy the paper edition

Your Kindle has 'Pages'? No it has a Screen, just like the one my wife has.
What is shown on the screen, depends on a lot of factors. Font size and face. Line spacing.

Count pages is an (usually close) approximation of what will be at a normal (default) setting.
Embedded, Kindle page numbers (when included) are hard coded into the books files for reference purposes.

Now, Words, Chapter counts: are static, no matter which view you use.
theducks is offline   Reply With Quote
Old 04-05-2013, 02:34 PM   #506
shamanNS
Guru
shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.
 
Posts: 885
Karma: 10113994
Join Date: Feb 2010
Location: Serbia
Device: Kindle PW5 [bricked], Kindle PW1
@kiwidude: Would you be willing to update @user_none's APNX generator plugin and add option to use page number value from custom column (Pages)? Just as Calibre can use that value instead it's built-in algorithm, when sending mobi/KF8 books via "Send to Device" function.

Or merge the two plugins / add APNX generating function to this plugin (Count Pages)?

It would be very useful for people who read on Kindle device and Kindle for Android (for which "Save to disk" must be used for sending books, and standalone APNX generator plugin after that). Currently page count for the same book differs significantly between the two, and it kind of defeats the purpose of having page numbers
shamanNS is online now   Reply With Quote
Old 04-05-2013, 11:08 PM   #507
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,635
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
@shamanNS - there was someone about 6 or 8 months ago who said they were going to take over that plugin from user_none, they posted in the development forum from memory. However it seems nothing has eventuates from that. If I get time later this week will take a look into it.

@ansem - the error on your second list of points is because you are trying to download a page count for a book from Goodreads that you have never linked to its Goodreads equivalent book in order for it to know which one to get the page count from. Read the first post if this thread carefully, it explains how you can get such a link, either by using the Goodreads metadata download plugin, or the Goodreads Sync plugin.

As for page counts being varying degrees of right or wrong, this subject has been discussed a million times on this thread. Just read a few pages of it and you will find such discussions.
kiwidude is offline   Reply With Quote
Old 04-15-2013, 03:21 PM   #508
ousia
Enthusiast
ousia writes the songs that make the whole world sing.ousia writes the songs that make the whole world sing.ousia writes the songs that make the whole world sing.ousia writes the songs that make the whole world sing.ousia writes the songs that make the whole world sing.ousia writes the songs that make the whole world sing.ousia writes the songs that make the whole world sing.ousia writes the songs that make the whole world sing.ousia writes the songs that make the whole world sing.ousia writes the songs that make the whole world sing.ousia writes the songs that make the whole world sing.
 
Posts: 28
Karma: 40680
Join Date: Aug 2012
Device: Sony PRS-T1
Hi kiwidude,

thanks for your plugin. I thought it would allow the user to choose the page numbering method in ebook-veiwer, but it seems its capabilities are different.

I have asked for this feature as a calibre enhancement, but the main developer isn't personally interested in implementing it.

I'm afraid I cannot code. Would you be interested in expanding the ebook-viewer from calibre, so the user is able to choose the page counting method?

Many thanks for your work.
ousia is offline   Reply With Quote
Old 04-16-2013, 07:10 PM   #509
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,635
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
ousia, sorry I also have no interest in implementing this in calibre, I don't use the ebook viewer, like many I read ebooks on an actual ereader, not my computers. It has nothing to do with this plugin and would require patches to the main calibre application instead - not massively difficult to make but as Kovid has indicated not a priority for many people.
kiwidude is offline   Reply With Quote
Old 05-01-2013, 08:13 AM   #510
miquele
Connoisseur
miquele ought to be getting tired of karma fortunes by now.miquele ought to be getting tired of karma fortunes by now.miquele ought to be getting tired of karma fortunes by now.miquele ought to be getting tired of karma fortunes by now.miquele ought to be getting tired of karma fortunes by now.miquele ought to be getting tired of karma fortunes by now.miquele ought to be getting tired of karma fortunes by now.miquele ought to be getting tired of karma fortunes by now.miquele ought to be getting tired of karma fortunes by now.miquele ought to be getting tired of karma fortunes by now.miquele ought to be getting tired of karma fortunes by now.
 
miquele's Avatar
 
Posts: 75
Karma: 498122
Join Date: May 2010
Location: Europe
Device: Bookeen Cybook Gen3, Kindle 3, Kindle PW, Kindle Voyage
Hi kiwidude,

with the latest update to calibre 0.9.28 on Windows XP and the respective upgrade of the plug-in it doesn't work anymore. Any pointers?

Thanks a lot and as always, happy reading!
____

Error Msg:
Count Page/Word Statistics
Python function terminated unexpectedly
do_count_statistics() takes at least 6 arguments (6 given) (Error Code: 1)
Traceback (most recent call last):
File "site.py", line 132, in main
File "site.py", line 109, in run_entry_point
File "site-packages\calibre\utils\ipc\worker.py", line 189, in main
File "site-packages\calibre\utils\ipc\worker.py", line 136, in arbitrary_n
TypeError: do_count_statistics() takes at least 6 arguments (6 given)
miquele is offline   Reply With Quote
Reply

Tags
count, count pages, page count, pages, plugin

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] Quality Check kiwidude Plugins 1182 04-08-2024 10:04 AM
[GUI Plugin] Open With kiwidude Plugins 403 04-01-2024 08:39 AM
[GUI Plugin] Quick Preferences kiwidude Plugins 62 03-16-2024 11:47 PM
[GUI Plugin] Kindle Collections (old) meme Plugins 2070 08-11-2014 12:02 AM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 12:27 PM


All times are GMT -4. The time now is 12:31 PM.


MobileRead.com is a privately owned, operated and funded community.