Mobileread
Corrections to format_docs/pdb/apnx.txt
#1  j.p.s 11-24-2019, 06:43 PM
I've been trying to learn some details of amazon's apnx format and the least difficult for me to follow description I've found is calbre's format_docs/pdb/apnx.txt, but I think that has not kept up with the source code and some of it does not reflect what can be gleaned from examination of an apnx file and how a book from amazon behaves.
Quote
Page Mapping Header
-------------------

The page mapping header is a string enclosed in {} containing key, value pairs.

content comments

asin The ISBN 10 for the paper book the pages correspond to
pageMap Three value tuple. Looks like: "(N,N,N)"
1) Number of bytes after header that starts the page numbering sequence
2) unknown
3) unknown
I think the tuple descriptions should be something like:

A pbook that has X leafs has 2X page numbers, which may be Indo-Arabic numerals, Roman numerals, or something else. There is a value in the Page List section and the end of the apnx file that is the byte of the book HTML that is the start of the page for each labeled page in the book.

1) The first labeled page of the sequence of pages this tuple describes.
2) Page number type, a: Indo-Arabic numeral, r: Roman numeral, c: something else
3) Value of page number for the first page of this sequence.

A tuple with page type "c" can only describe 1 page. The other types get incremented by 1 until the first page of the next tuple.
Reply 

#2  jhowell 11-24-2019, 07:26 PM
My best guess is that "c" stands for character string. It supports a list of values separated by "|" characters as the third entry in the tuple.

There is some additional information in the MobileRead Wiki: https://wiki.mobileread.com/wiki/APNX
Reply 

#3  j.p.s 11-24-2019, 09:21 PM
Quote jhowell
My best guess is that "c" stands for character string. It supports a list of values separated by "|" characters as the third entry in the tuple.

There is some additional information in the MobileRead Wiki: https://wiki.mobileread.com/wiki/APNX
Thanks. I've read the wki page before, but it must have been at a time when I wasn't able to follow it and much of it didn't stick.

I still think that docs/pdb/apnx.txt should be updated similar to as suggested in post #1 and maybe a reference to the wiki page added.
Reply 

#4  kovidgoyal 11-24-2019, 10:41 PM
Feel free to post the updated text file and I will add it to calibre, or directly send a pull request.
Reply 

#5  j.p.s 11-29-2019, 06:22 PM
Quote kovidgoyal
Feel free to post the updated text file and I will add it to calibre, or directly send a pull request.
OK, I just made my first ever github pull request.

Also attached here.
[txt] apnx.txt (3.0 KB, 12 views)
Reply 

#6  kovidgoyal 11-29-2019, 11:25 PM
Thanks, merged.
Reply 

Today's Posts | Search this Thread | Login | Register