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

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 07-09-2010, 05:38 PM   #1
lorddon
Member
lorddon began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Jun 2010
Device: Nook Wifi
Page Mapping Using toc.ncx

In my brief research I've found that adobe's method of page mapping is non standard and frowned upon by epub checkers. I discovered the preferred method is to use <pageList> under <navMap> in the toc.ncx, as described here.

Quote:
<pageList id="page-mapping">

<navLabel><text>Paper Edition Page Mapping</text></navLabel>

<pageTarget id="page-iii" value="3" type="front" playOrder="82">
<navLabel><text>Page iii</text></navLabel>
<content src="frontmatter.html#pageiii"/>
</pageTarget>

<!-- ... -->

<pageTarget id="page-105" value="105" type="normal" playOrder="192">
<navLabel><text>Page 105</text></navLabel>
<content src="chap5.html#page105"/>
</pageTarget>

</pageList>
My difficulty now is I don't understand how or where you add the anchors to mark where the pages begin in the xhtml files themselves.
lorddon is offline   Reply With Quote
Old 07-09-2010, 05:44 PM   #2
frabjous
Wizard
frabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameter
 
frabjous's Avatar
 
Posts: 1,213
Karma: 12890
Join Date: Feb 2009
Location: Amherst, Massachusetts, USA
Device: Sony PRS-505
I wouln't bother. Unless someone knows something I don't, or something has changed recently, I'm pretty sure the "preferred" method is not supported by any ePub software.

We've discussed this before.

I imagine however, that you're just supposed to use anchor tags. E.g. <a id="page105">first-word-of-page</a> inside chap5.html.

Last edited by frabjous; 07-09-2010 at 05:46 PM.
frabjous is offline   Reply With Quote
Advert
Old 07-09-2010, 06:35 PM   #3
charleski
Wizard
charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.
 
Posts: 1,196
Karma: 1281258
Join Date: Sep 2009
Device: PRS-505
It would be interesting to know if iBooks supports pageList.
charleski is offline   Reply With Quote
Old 07-09-2010, 09:35 PM   #4
st_albert
Guru
st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'
 
Posts: 668
Karma: 150000
Join Date: Feb 2010
Device: none
Quote:
Originally Posted by charleski View Post
It would be interesting to know if iBooks supports pageList.
Apparently they do. This is from page 13 of the iTunesConnect_PublisherUserGuide.pdf :
Quote:
Page Mapping
To provide a reading experience similar to printed books, the person reading a book on the iPad should be able to refer to and navigate to a particular page. This is especially useful in a classroom setting when the teacher instructs the students to go to a particular page in a textbook. An NCX (Naviagtion Control file for XML) file lets the reader jump directly to any of the major structural elements of the document (for example, chapter or section) or to a particular page. To provide navigation to a particular page, use the NCX defined pageList. Below is an example:

<pageList>
<pageTarget id=”p1” type=”normal” value=”1”>
<navLabel><text>1</text></navLabel>
<content src=”content.html#p1”/>
</pageTarget>
<pageTarget id=”p2” type=”normal” value=”2”>
<navLabel><text>2</text></navLabel>
<content src=”content.html#p2”/>
</pageTarget>
</pageList>


Further documentation on the pageList can be found here:
http://www.daisy.org/epub/issues/cla...m-requirements
st_albert is offline   Reply With Quote
Old 07-20-2010, 08:12 AM   #5
CrystalEYE
ePub investigator
CrystalEYE began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Feb 2009
Location: Augsburg, Germany
Device: Sony PSR-505, Amazon Kindle 2, Apple iPad, iPhone (iBooks, stanza)
As far as I understand, you don`t have to use anchors, but simply ids.
e.g. <p id="page105">First paragraph on page 105 in the printed version</p>
CrystalEYE is offline   Reply With Quote
Advert
Old 07-20-2010, 12:49 PM   #6
soup
Member
soup began at the beginning.
 
Posts: 24
Karma: 10
Join Date: Jul 2010
Device: Kobo
I think I found the answer to this the other day, I copy and pasted a line of code I thought would work and it did.

I don't have the code on me right now, but if you find an ePub with a working table of contents, maybe what I can remember off hand might be enough, however I'll post what I use up when I get the chance, I found it works remarkably well.

in the book I had with the line of code that worked, the code was around the chapter title, it read something like:

"calibre5_calibre3_toc_id1<title_chapter 1>"

now I KNOW that isn't the exact code, but it should help you find the right code if you have a book that has a working table of contents, also this was an ePub converted from a PDF using calibre.

if you do find the line, the '1' in "toc_id1" can be any number, and only have to be in chronological order, 1, 100, 1000, 10000 will wok just as well as 1, 2, 3, 4 etc.

the "chapter 1" part can read as anything you like, it will read on the TOC the same as that line of the page, but the font will be different.

you can place them anywhere in the page, it doesn't have to be at the beginning.

this worked on my kobo, I don't know what your reader is or if this will work on it, I'm new to this.

hope this helps. I should be able to give the exact code in about 10 hours time after this post.

Last edited by soup; 07-20-2010 at 12:54 PM.
soup is offline   Reply With Quote
Old 07-22-2010, 08:59 AM   #7
soup
Member
soup began at the beginning.
 
Posts: 24
Karma: 10
Join Date: Jul 2010
Device: Kobo
it took me a little longer to get my hands on it for you, but fially, it's here.

<h1 class="calibre7 calibre3 sgc-1 sgc-8" id="calibre_toc_3">Chapter 1</h1>

I just paste that code into any line I want to reference in my table of contents, and it comes up.

someone who knows more than me would probably be able to clean in it up for you, and give you a shorter line of code, but it does the job.

as I said before, the "3" in " id="calibre_toc_3" " is changable, and provided that the numbers are increasing order, they don't have to be in next number order.

the "Chapter 1" can be anything you like, but it will come up on both the line of the page you're referencing aswell as the table of contents, the font will be different on the table of contents.

as I said, this is from an epub that was converted from a PDF with calibre, edited with sigil, and worked correctly on the kobo; just a few points of reference for you.
soup is offline   Reply With Quote
Old 12-29-2017, 05:31 AM   #8
freewheeling
Zealot
freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.
 
Posts: 106
Karma: 508502
Join Date: Aug 2011
Location: Virginia
Device: Kindle 2i, Lenovo IdeaPad, Kindle PaperWhite
Quote:
Originally Posted by CrystalEYE View Post
As far as I understand, you don`t have to use anchors, but simply ids.
e.g. <p id="page105">First paragraph on page 105 in the printed version</p>
I'm trying this, but Sigil doesn't generate the pageList from it so I probably have to add that part. I'm using something like this:

<a id="page014">first word of new page</a>

So far that doesn't cause an error. Then I would have to add something like the following in the ncx file:

<pageList>
...
<pageTarget id=”page014” type=”normal” value=”14”>
<navLabel><text>14</text></navLabel>
<content src=”Chapter01.xhtml#page014”/>
...
</pageList>

Will this work?

Actually, I'm thinking that I don't need the "<navLabel><text>14</text></navLabel>" part. I'm just using the ncx to guide the creation of the APNX file in Calibre. I don't want the page numbers to show up anywhere in the actual text.

Last edited by freewheeling; 12-29-2017 at 05:39 AM. Reason: Clarification
freewheeling is offline   Reply With Quote
Old 12-29-2017, 07:27 AM   #9
Doitsu
Wizard
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: 4,274
Karma: 14242649
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by freewheeling View Post
I'm trying this, but Sigil doesn't generate the pageList from it so I probably have to add that part.
Since you mentioned that you're using Sigil, you might find my Pagelist plugin helpful, which'll automatically generate a pageList from page marker ids.

BTW, a typical pageList should look like this:

Code:
  <pageList>
    <navLabel>
      <text>Pages</text>
    </navLabel>
    <pageTarget id="page7" type="normal" value="7">
      <navLabel>
        <text>7</text>
      </navLabel>
      <content src="Text/book.xhtml#page7"/>
    </pageTarget>
    <pageTarget id="page8" type="normal" value="8">
      <navLabel>
        <text>8</text>
      </navLabel>
      <content src="Text/book.xhtml#page8"/>
    </pageTarget>
    <pageTarget id="page9" type="normal" value="9">
      <navLabel>
        <text>9</text>
      </navLabel>
      <content src="Text/book2.xhtml#page9"/>
    </pageTarget>
  </pageList>
Doitsu is offline   Reply With Quote
Old 12-30-2017, 12:06 AM   #10
freewheeling
Zealot
freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.
 
Posts: 106
Karma: 508502
Join Date: Aug 2011
Location: Virginia
Device: Kindle 2i, Lenovo IdeaPad, Kindle PaperWhite
Doitsu:

I actually tried to use that plugin, and have it installed, but I get an error message. I assumed that if I created the ePub with Sigil 9.9 that it would already be in ePub3 but perhaps I'm wrong and I need to run a conversion program on it.

Ahh, never mind. I forgot to change the epub declaration. DUH!

Last edited by freewheeling; 12-30-2017 at 12:29 AM.
freewheeling is offline   Reply With Quote
Old 12-30-2017, 02:21 AM   #11
freewheeling
Zealot
freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.
 
Posts: 106
Karma: 508502
Join Date: Aug 2011
Location: Virginia
Device: Kindle 2i, Lenovo IdeaPad, Kindle PaperWhite
The plugin appears to process the first 19 page numbers in the first chapter and then spits out this:

Quote:
IndexError: list index out of range
Error: list index out of range
freewheeling is offline   Reply With Quote
Old 12-30-2017, 02:36 AM   #12
freewheeling
Zealot
freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.freewheeling ought to be getting tired of karma fortunes by now.
 
Posts: 106
Karma: 508502
Join Date: Aug 2011
Location: Virginia
Device: Kindle 2i, Lenovo IdeaPad, Kindle PaperWhite
I suspect that what's happening is that I'm identifying the first word in the new page, which isn't a number. So I'm back to my previous method.

Update: I changed the targets to the empty first example and the plugin ran perfectly. However, using the APNX output in Calibre to send the book to my Kindle still doesn't produce accurate page numbers. They're clearly not using the PageList for anything. Maybe KindleCreate does. (I can't find a KindleGen, so KindleCreate is probably the latest version of that.)

Last edited by freewheeling; 12-30-2017 at 04:00 PM. Reason: Update
freewheeling is offline   Reply With Quote
Old 12-30-2017, 02:53 AM   #13
Doitsu
Wizard
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: 4,274
Karma: 14242649
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by freewheeling View Post
The plugin appears to process the first 19 page numbers in the first chapter and then spits out this:
Can you please paste the whole error message verbatim? It'd help me to check for this error, which should only be displayed, if the pagelist and/or the page target markers are incorrectly formatted.
Doitsu is offline   Reply With Quote
Old 01-06-2018, 03:34 PM   #14
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 6,926
Karma: 63374881
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, and NookColor. 2 Droid, 1 Win8 ePUB rdrs
Quote:
Originally Posted by freewheeling View Post
I suspect that what's happening is that I'm identifying the first word in the new page, which isn't a number. So I'm back to my previous method.

Update: I changed the targets to the empty first example and the plugin ran perfectly. However, using the APNX output in Calibre to send the book to my Kindle still doesn't produce accurate page numbers. They're clearly not using the PageList for anything. Maybe KindleCreate does. (I can't find a KindleGen, so KindleCreate is probably the latest version of that.)
Are you thinking that Kindlegen is going to give you "real page numbers" by using the Calibre plugin? That won't work. As far as I know, the APNX plugin, for Calibre does nothing but create them for those books being read VIA Calibre, for self-made/self-read books. Not books intended to be processed via the KDP or Kindlegen, etc.

I've never heard that the APNX plugin, for Calibre, can be used for anything in commercial production. Now, I could be utterly wrong, as we don't use Calibre for anything like this (we use it for its intended purpose, as a catalog, silly buggers that we are), so I suppose it COULD work, but I'd be very, very surprised, especially as the KDP very notoriously tends to reject most Calibre-made files as "unsupported." Moreover, you cannot upload an AZW to the KDP, so...???

Hitch
Hitch is online now   Reply With Quote
Old 01-06-2018, 05:39 PM   #15
jhowell
Wizard
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 2,348
Karma: 24554618
Join Date: Nov 2011
Location: Florida
Device: Oasis 2, Fire, iPad Air 2, Nexus 7
EPUBs with real page numbers are rare so few tools exist that work with them.

APNX files produced directly by calibre or by using the APNX plugin do not include pages defined in the NCX pageList, they only create approximately positioned pages based on a specified (or estimated) page count for the book.

Kindlegen will process a pageList and save it in the MOBI file produced, but I do not know of any software that can split out this information to produce a separate APNX file as needed for Kindle devices.

The KFX Output plugin for calibre will make use of an NCX pageList to produce KFX files containing real page numbers that can be sideloaded to Kindle devices. (KFX format does not rely on APNX files.)
jhowell 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
[Old Thread] calibre not creating content.opf or toc.ncx files during conversion foxxywith2xs Calibre 7 12-16-2012 07:49 PM
adding a toc.ncx file to the .prc package cyberbaffled Amazon Kindle 4 09-14-2010 02:21 PM
Can you bypass first two items in TOC.ncx? sueneu Kindle Formats 4 07-14-2010 08:36 AM
toc.ncx playOrder question aarcane ePub 8 05-25-2010 05:00 AM
toc.ncx navpoint content=src empty? KevinH Sigil 6 11-23-2009 01:39 PM


All times are GMT -4. The time now is 08:49 PM.


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