View Single Post
Old 11-22-2013, 04:28 AM   #9
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,731
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by Iznogood View Post
I don't want to use the pagination information from within the mobi file. My text contains anchors
Code:
<a class="pagebreak" id="pageNNN"></a>
for every pagebreak, and these anchors should survive the epub to mobi conversion.
When I referred to "pagination information from within the mobi" I actually meant the page number anchors. If the KindleUnpack output is anything to go by, the anchors in the KF8 part survive the compilation while the page anchors in the Mobi7 part are lumped together with other anchors as <a id="fileposXXXX" /> anchors. (KindleUnpack apparently also cannot restore NCX pageLists.)

AFAIK, KindleUnpack doesn't distinguish between pageNNN anchors and other anchors in the mobi7 part, which is not really surprising since the tool predates the introduction of "real page numbers."

Quote:
Originally Posted by Iznogood View Post
So I need to search for the position of these anchors, and add that instead of the fake positions generated by calibre, and that should suffice *knock on wood*
That seems to be the sticking point. If finding page number targets was that easy, the extremely talented guys who reverse-engineered the Mobi7/KF8 file format for Calibre probably would've already added code that detects pageNNN anchors in Mobi7 files and used them for generating .apnx files with real page numbers in them.

IMHO, it might be helpful to cross-post your question to the KindleUnpack thread, since the KindleUnpack developers are intimately familiar with the file format and might be able to give you some pointers. Maybe one of them might even like the challenge to be the first one to develop code that'll allow to generate an .apnx file with real page numbers, if at all possible.
Doitsu is offline   Reply With Quote