Mobileread
Kindle Page Numbers
#11  user_none 02-08-2011, 05:34 PM
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.
Reply 

#12  dwig 02-08-2011, 07:22 PM
Quote dwanthny
...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).
Reply 

#13  user_none 02-08-2011, 09:02 PM
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)"}

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.
Reply 

#14  user_none 02-09-2011, 09:45 PM
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.
Reply 

#15  Piper_ 02-09-2011, 10:04 PM
Quote user_none
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
Reply 

#16  DoctorOhh 02-09-2011, 11:08 PM
Quote user_none
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.
I think it is great that you have been able to implement these pseudo page numbers similar to epub. It's not what Amazon is advertising but it will be invaluable to Kindle users on this forum. Especially for the user who asked for a way to be able to assign x pages of reading to her home schooled child.

Reply 

#17  goaspy 02-10-2011, 02:41 AM
Quote user_none
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.
Yeah, it was a good day for science You are fast!!
Thanks for your help, I can't wait to give it a go.

Cheers.
Reply 

#18  goaspy 02-10-2011, 07:25 PM
Here is a proof of concept to entertain you until the next version of Calibre gets out.

Many thanks to user_none for figuring the specs out.

Just get the attachment, extract the content, and run the little proggy (Windows only).

image »

Enter the facts, ISBN (optional), the number of locations (the Kindle will tell you ) and the desired number of pages.

Press 'Generate' then look for a file named unknown.apnx in the same location where you keep the executable.

That's it! Rename the file after your mobi/azw file, and transfer it on the Kindle (or in 'My Kindle Content' folder in documents for Kindle4PC).

Enjoy!
[zip] ApnxGen.zip (13.9 KB, 566 views)
Reply 

#19  JSWolf 02-10-2011, 07:27 PM
Quote goaspy
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.
But it's not the same. I looked as the sample Amazon showed and I think it's like x44 for the Kindle version with the pBook being x52. Close, but not close enough.
Reply 

#20  DMSmillie 02-10-2011, 08:08 PM
Quote JSWolf
But it's not the same. I looked as the sample Amazon showed and I think it's like x44 for the Kindle version with the pBook being x52. Close, but not close enough.
What sample are you referring to, JSWolf?
Reply 

 « First  « Prev Next »  Last »  (2/13)
Today's Posts | Search this Thread | Login | Register