View Single Post
Old 12-04-2014, 05:08 PM   #8
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,827
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by Doitsu View Post
Hi Ruben,

To be honest, I've only limited experience with this topic. I only toyed it with it when KevinH added the APNX generation feature to KindleUnpack. If you have super-technical questions he's the guy to ask.

Adding a page number basically consists of the following:

1. Adding unique page number targets to the .html files. For example.
<a id="page1" /> (which Sigil will save as <a id="page1"></a>). You can, of course, add ids to all tags that can have one.

2. Adding a pagelist to the NCX file or a separate pagemap file. Since Kindlegen supports both methods and pagemap is an ADE extension, I'd recommend pagelists, unless you're going for cross-plattform compatibility.


AFAIK, yes. Calibre uses UUIDs and my simple KindleGen wrappper (which includes KevinH's dualmetafix_mmap.py script) uses only the last 12 characters of the UUID to generate a fake ASIN and it seems to be working. However, the downside is that if you sideload books with a fake ASIN and an EBOK book type, Paperwhites will not generate a cover, even if the book contains one. (For more background information on this see the dualmetafix_mmap.py thread.)
However, my plugin can optionally also generate a thumbnail image, if you set the corresponding kindlegen.ini parameter. For more details, see the kindlegen wrapper thread. Note that in order to generate thumbnails, you'll need to open a command line prompt as an administrator and enter the following command to download and install the Python Imaging Library.
Code:
pip install Pillow
Here's practical workflow example that uses my plugin, you can of course also use Kindlegen and dualmetafix_mmap.py manually.

1. Install my simple Kindlegen Sigil plugin.
2. Change the following kindlegen.ini parameters before running the plugin:
Code:
  azw3_only = True
  donotaddsource = True
  add_asin = True
3. Download PW2_pagelist_2.zip and extract pagelist.epub.

4. Open pagelist.epub with Sigil and use the Kindlegen plugin to generate an .azw3 file with it. If all goes well, you should end up with a Page number test [paglist]_e9b1fce6366b.azw3 file and a thumbnail_e9b1fce6366b_EBOK_portrait.jpg file. (Your random ASIN will of course be different.)

5. Run Kindleunpack and unpack the .azw3 file with it using the default settings. Kindleunpack will unpack the file and automatically generate mobi8-Page number test [paglist]_e9b1fce6366b.apnx. Rename this file so that it has the same name as the .azw3 file, but an .apnx extension. I.e. Page number test [paglist]_e9b1fce6366b.apnx

6. Copy the .azw3 file to a folder in the Kindle /documents folder and the thumbnail .jpg file to the (hidden) /system/thumbnails folder. Create a new folder in the folder that contains the .azw3 using the same name as the book but with the extension .sdr. In my specific example, I'd need to create Page number test [paglist]_e9b1fce6366b.sdr. Copy the .apnx file into this folder.

For example if you put the .azw3 file in the folder /document/test, it should contain the following:

Code:
Page number test [paglist]_e9b1fce6366b.azw3
Page number test [paglist]_e9b1fce6366b.sdr
(The Page number test [paglist]_e9b1fce6366b.sdr folder should contain Page number test [paglist]_e9b1fce6366b.apnx.)

To test the page numbers, open the new .azw3 file and select Go To > Page or Location. If the .apnx is valid, the Page button should be no longer greyed out and you should be able to select a page by entering its number.

To display the page number while reading a book, tap the lower left corner to toggle between page number, min left in this chapter/book and location.
Many, many thanks Doitsu!! Very very clear your answer; for the rest, you know a lot about this stuff The best for you.
RbnJrg is offline   Reply With Quote