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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 02-08-2011, 02:14 AM   #1
goaspy
Connoisseur
goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.
 
goaspy's Avatar
 
Posts: 77
Karma: 9324
Join Date: Feb 2010
Device: Sony PRS-650, Kindle 3
Kindle Page Numbers

The new Kindle Firmware 3.1 is able to display page numbers.

Will it be possible to set page numbers from Calibre by converting to MOBI? Maybe similar to the way epub calculates pages. Or import page numbers from epub if this is possible.
goaspy is offline   Reply With Quote
Old 02-08-2011, 02:47 AM   #2
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 62,779
Karma: 40397151
Join Date: Nov 2006
Location: UK
Device: PW2, iPad Retina Mini, iPhone 4, MS Surface Pro, Onyx T68, N7,
If you can explain to us what the technical specification of the new page number mechanism is, someone can implement it. Just asking a question such as "is it possible" without specifying what needs to be done isn't going to achieve very much .
HarryT is offline   Reply With Quote
Old 02-08-2011, 03:54 AM   #3
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 8,781
Karma: 12516053
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
Quote:
Originally Posted by goaspy View Post
Will it be possible to set page numbers from Calibre by converting to MOBI? Maybe similar to the way epub calculates pages. Or import page numbers from epub if this is possible.
First off it hasn't been released yet so this really isn't a question but a request to predict the future.

My prediction, Since their numbering equates to specific print version the odds that this will be implemented in calibre conversions to mobi is very remote. I don't see Amazon having any reason to supply this data via a API like their metadata. Of course anything is possible.
DoctorOhh is online now   Reply With Quote
Old 02-08-2011, 03:55 AM   #4
goaspy
Connoisseur
goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.
 
goaspy's Avatar
 
Posts: 77
Karma: 9324
Join Date: Feb 2010
Device: Sony PRS-650, Kindle 3
I will investigate as much as I can, Amazon already sells books with page numbers.
goaspy is offline   Reply With Quote
Old 02-08-2011, 11:04 AM   #5
sam.doran
Junior Member
sam.doran began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Feb 2011
Location: Bowling Green, VA
Device: Kindle 3
From reading on Amazon's site, it looks like the page numbers are linked to an ISBN. Since calibre already has ISBN info for most books (or can acquire it automagically), I imagine it should be fairly simple to implement. I'm far from a programmer, but it looks as though the pieces are all there, it's just a matter of putting an ISBN into the .mobi file.
sam.doran is offline   Reply With Quote
Old 02-08-2011, 11:12 AM   #6
goaspy
Connoisseur
goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.
 
goaspy's Avatar
 
Posts: 77
Karma: 9324
Join Date: Feb 2010
Device: Sony PRS-650, Kindle 3
The ISBN doesn't give you the pages, it is mentioned just so you know that page X from your kindle book is the same with page X from that book.
goaspy is offline   Reply With Quote
Old 02-08-2011, 11:17 AM   #7
DMSmillie
Enquiring Mind
DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'
 
DMSmillie's Avatar
 
Posts: 562
Karma: 42350
Join Date: Aug 2010
Location: London, UK
Device: Kindle 3 (WiFi)
Quote:
Originally Posted by sam.doran View Post
From reading on Amazon's site, it looks like the page numbers are linked to an ISBN. Since calibre already has ISBN info for most books (or can acquire it automagically), I imagine it should be fairly simple to implement. I'm far from a programmer, but it looks as though the pieces are all there, it's just a matter of putting an ISBN into the .mobi file.
How would the bibliographic data associated with an ISBN create links between pages in the print version and the points in the Kindle version where the page number should be incremented? The ISBN simply identifies the print version that the page numbering is based on.

One possibility is that Amazon might have introduced an implementation of some form of the NCX <pagelist> coding. But at the moment, that's just a guess.

Last edited by DMSmillie; 02-08-2011 at 11:22 AM. Reason: Added quote from sam's post for clarity
DMSmillie is offline   Reply With Quote
Old 02-08-2011, 12:57 PM   #8
Manichean
Wizard
Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!
 
Manichean's Avatar
 
Posts: 3,130
Karma: 80446
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
It could be just that they use the fact that the number of screen pages in an ebook and the number of print pages in a paper book scale mostly linearly. Thus, if you know the total number of print pages, and the total number and current number of screen pages, you can easily calculate the current print page. This wouldn't necessarily be 100% exact, though.
Manichean is offline   Reply With Quote
Old 02-08-2011, 04:01 PM   #9
goaspy
Connoisseur
goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.
 
goaspy's Avatar
 
Posts: 77
Karma: 9324
Join Date: Feb 2010
Device: Sony PRS-650, Kindle 3
This looks like a dead end (or not).

The page numbers are not in the book itself, they are in the 'apnx' file. The popular highligts file is the 'phl', and the 'ea' file I don't know what it's for.
If you delete these files from the kindle, the page numbers disappear, along with popular highlights.

The interesting part is that this apnx file works with a certain mobi file.

Update: Even better, the same file works with other mobi files as well, I can jump to page X, but there's nothing special in the mobile file, it's just a converted epub (created manually).
Because this book is smaller than the first one, if I jump to the last page, it displays 100%, Page 318 of 380 (fake numbers but similar).
There are about 18.7 locations per page, confirmed by the difference above.

Last edited by goaspy; 02-08-2011 at 04:26 PM.
goaspy is offline   Reply With Quote
Old 02-08-2011, 04:30 PM   #10
Piper_
~~~~~
Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.
 
Piper_'s Avatar
 
Posts: 762
Karma: 1278391
Join Date: Aug 2010
Location: USA
Device: Kindle 3, Sony 350
Quote:
Originally Posted by goaspy View Post
The interesting part is that this apnx file works with a certain mobi file.

Update: Even better, the same file works with other mobi files as well, I can jump to page X, but there's nothing special in the mobile file, it's just a converted epub (created manually).
That's great news. Maybe we could have an apnx file repository.

It would be nice if we could grab the .apnx from Amazon by forging the asin, but that so far has only allowed synchronizing.

Heck, I couldn't even get the .apnx of some of my older .azw books until I deregistered and registered back into that old account.

So it looks like they only send you page files for the books you have in your archive.
Piper_ is offline   Reply With Quote
Old 02-08-2011, 04:34 PM   #11
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,433
Karma: 950001
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
It sounds like the page number file is a simple mapping of stream location to page number.

Any chance you can send me the mobi and its apnx file so I can get a look at it?

If we can determine the structure of the file we can add support for writing it to the Kindle when using send to device. The only issue is the calculation of what a page is. My first idea would be to use the EPUB character count calculation to provide pseudo page numbers. I dont see how we could provide numbers that correspond to a print book like ons purchased due to lack of proper mapping info.
user_none is offline   Reply With Quote
Old 02-08-2011, 06:22 PM   #12
dwig
Guru
dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.
 
dwig's Avatar
 
Posts: 953
Karma: 1351860
Join Date: Dec 2004
Location: Paradise (Key West, FL)
Device: Current:Kindle 3/WiFi Retired:Clie - UX50, T415, ...
Quote:
Originally Posted by dwanthny View Post
...My prediction, Since their numbering equates to specific print version the odds that this will be implemented in calibre conversions to mobi is very remote. I don't see Amazon having any reason to supply this data via a API like their metadata. Of course anything is possible.
True. Without a database that correlates some print version's pages numbers with a particular text string, or some other text attribute, there would be no way for a converter to create the new page numbers, whatever underlying mechanism Amazon is planning to use.

The only dream feature I can think of that might work would be for a super intelligent PDF converter to not only strip headers and footer automagically, but to also read the page numbers in either the header or footer and generate Amazon's new page number tags in the appropriate locations (or build the location to page number data table if that is the mechanism).
dwig is offline   Reply With Quote
Old 02-08-2011, 08:02 PM   #13
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,433
Karma: 950001
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
goaspy has sent me a the book and apnx file that he was looking at.

Here's what I've figured out so far:

The file starts with

Code:
{"contentGuid":"8d3d16e0","asin":"B002RHGYOA","cdeType":"EBOK","fileRevisionId":"1296868639127"} ) = {"asin":"1906694184","pageMap":"(4,a,1)"}
  • contentGuid is most likely just a guid used to differentiate the file from others.
  • The first asin is the amazon asin for the Kindle version of the book.
  • cdeType is a Mobi document type specified as ebook. I haven't played with it much but I'm going to assume this is important. The 3.1 update looks to have a new navigation system for periodicals. Most likely the apnx will have a different meaning (but same format) depending on the cdeType.
  • fileRevisionId should be obvious.
  • The second asin is the isbn for the paper back version of the book.
  • Don't know what pageMap does yet.

Following this header is a list of 4 byte sequences of big endian ints. They are in an increasing order. The total number of the 4 byte sequences is 573. The first 3 ints are all 0 which leads me to believe they are padding. The total number of pages within the book are 570 (as shown on the Kindle itself). I need to do some testing but it looks like my assumption is correct and the apnx file is a list o file locations where each is the beginning of a new page.
user_none is offline   Reply With Quote
Old 02-09-2011, 08:45 PM   #14
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,433
Karma: 950001
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
I've reverse engineered the APNX file format. Full specs are in format_docs/pdb/apnx.txt of the calibre source. I've added support to the Kindle interface to write it when sending MOBI files to the Kindle. Pages are mapped the same way EPUB page numbers are using 1024 character blocks. If all goes well Kovid will merge the change and it will be in the next (0.7.45) release.

Thank you to goaspy for helping with with finding test files for me to look at. Your input was helpful too and make the whole process quicker than it would have been.
user_none is offline   Reply With Quote
Old 02-09-2011, 09:04 PM   #15
Piper_
~~~~~
Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.Piper_ ought to be getting tired of karma fortunes by now.
 
Piper_'s Avatar
 
Posts: 762
Karma: 1278391
Join Date: Aug 2010
Location: USA
Device: Kindle 3, Sony 350
Quote:
Originally Posted by user_none View Post
I've reverse engineered the APNX file format. Full specs are in format_docs/pdb/apnx.txt of the calibre source. I've added support to the Kindle interface to write it when sending MOBI files to the Kindle. Pages are mapped the same way EPUB page numbers are using 1024 character blocks. If all goes well Kovid will merge the change and it will be in the next (0.7.45) release.

Thank you to goaspy for helping with with finding test files for me to look at. Your input was helpful too and make the whole process quicker than it would have been.
Wow, that is just awesome! And so fast. I was afraid to hope. lol

Karma on its way. And a little something else for
Piper_ is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Firmware Update Kindle adds Page Numbers (and more) koland Amazon Kindle 304 07-02-2011 03:54 AM
Kindle adds Page Numbers (and more) koland News 53 03-03-2011 04:30 PM
Is there a hack for displaying page numbers rather than location numbers? nesler Kindle Developer's Corner 16 02-15-2011 12:00 AM
Epub to Kindle and page numbers apropos Calibre 11 12-09-2010 01:42 PM
Page numbers in iphone vs Real Kindle palex481 Amazon Kindle 26 03-16-2009 05:28 PM


All times are GMT -4. The time now is 01:50 AM.


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