![]() |
#1 |
Kindler of the Flame
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 582
Karma: 646016
Join Date: Oct 2009
Location: US of A
Device: K DX,3,KT,KP,KF, KFHD; Nook C, PRS600, iPad, Xoom, N900, N810, Zaurus
|
Is there a size limit for TOC.ncx?
Working on a large (source file 52Mb in UTF-8) mobi book that requires a large toc.ncx (about 1Mb, 6,703 links/waypoints). When compiling I get this with MPC and kindlegen:
Code:
Info(prcgen): Building table of content URL: C:\kindlegen\toc.ncx Warning(index build): string too long (max=255). Truncated. Warning(index build): string too long (max=255). Truncated. I had pretty large toc.ncx before that worked but not as large as this one. They definitely were larger than 255 bytes. Last edited by osnova; 10-21-2010 at 10:16 PM. |
![]() |
![]() |
![]() |
#2 |
Wizzard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,517
Karma: 33048258
Join Date: Mar 2010
Location: Roundworld
Device: Kindle 2 International, Sony PRS-T1, BlackBerry PlayBook, Acer Iconia
|
I think that error message refers to a single line within the toc.ncx to be too long. Do you have maybe a really long link inside?
|
![]() |
![]() |
![]() |
#3 |
Kindler of the Flame
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 582
Karma: 646016
Join Date: Oct 2009
Location: US of A
Device: K DX,3,KT,KP,KF, KFHD; Nook C, PRS600, iPad, Xoom, N900, N810, Zaurus
|
The largest link string is 17 characters long (preceded by MHC.html# for a total of 26 ASCII characters). Is that more than 255 bytes (for UTF-8)?
Plus the resulting book misses the entire toc.ncx navigation on the Kindle. So, I guess it does not just strip one or two waypoints but the entire thing. Last edited by osnova; 10-21-2010 at 09:53 PM. |
![]() |
![]() |
![]() |
#4 |
Wizzard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,517
Karma: 33048258
Join Date: Mar 2010
Location: Roundworld
Device: Kindle 2 International, Sony PRS-T1, BlackBerry PlayBook, Acer Iconia
|
Is it perhaps part of a longer line, like say, if you/your editing program have put the entire <navPoint><navLabel> etc. contents all in a single chunk with no breaks?
Because while the individual data strings involved may be pretty short, if KindleGen counts all the characters including spaces until it hits a linebreak as a "string" in its program, then that may account for it. I did a quick copy-paste of my usual bare-bones <navPoint> entry, and it was already 122 characters long. If I had both a long chapter title in the <text>, and the id= and src= contents were descriptive instead of cryptically short like I usually do, I think it could easily hit 255 chars. Or maybe it's just KindleGen being wonky without real reason, which happens often enough. If you don't mind my asking, did the build fail partway through, or do you have a finished .mobi file with an error message? Because sometimes KindleGen likes to spit up non-fatal error messages that actually have to do with some other part of the file, instead of the one that the preceding stuff would make you think was the culprit. |
![]() |
![]() |
![]() |
#5 |
Kindler of the Flame
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 582
Karma: 646016
Join Date: Oct 2009
Location: US of A
Device: K DX,3,KT,KP,KF, KFHD; Nook C, PRS600, iPad, Xoom, N900, N810, Zaurus
|
Here is an example of my navPoints:
Code:
<navPoint id="navPoint-" playOrder=""> <navLabel> <text>Label</text> </navLabel> <content src="M.html#toc"/> </navPoint> This same thing happens on Mobipocket Creator. The file is created at the end but without waypoint navigation. Thank you for brainstorming with me though. I appreciate it. I'll pare down toc.ncx and see if that affects the warnings. P.S. I am pushing the envelope on the Kindle. About a year ago I submitted a 89Mb dictionary for publication on DTP, they said they couldn't handle such a large file. After a month of back and forth they added the support for large files. Last edited by osnova; 10-21-2010 at 10:11 PM. |
![]() |
![]() |
![]() |
#6 |
Wizzard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,517
Karma: 33048258
Join Date: Mar 2010
Location: Roundworld
Device: Kindle 2 International, Sony PRS-T1, BlackBerry PlayBook, Acer Iconia
|
One additional thought: perhaps the error message refers not to anything within your source NCX, but a problem with the resulting waypoints that are supposed to be built for the book.
I'm not sure exactly how they're stored internally, but perhaps trying to generate whatever records are needed to quickly get to the farthest points in a 56 meg-equivalent book is what's giving the "index" error, if it's done in some way that overspills the 255-byte limit for however Mobi files reference their waypoints. Especially if they do it in some sort of special supplementary fashion so the entire book doesn't have to be loaded at once before the navigation is accessible. Depending on whether it's a conversion-time error and KindleGen is just plain choking on a large input file, or a limitation of the overall format, you may or may not want to try splitting your file up and referencing the various parts via an OPF and see if that helps any (assuming you're not already working from split files to avoid having to deal with 52 megs of text at once). The other possibility that I'd suggest is that perhaps you have a very minor error in the NCX file. I discovered that if I accidentally put in a superfluous empty end-tag, KindleGen would completely ignore the entire thing without even giving me an error message. But you do seem to have gotten error messages, so that's probably not it. Anyway, I hope you manage to find a way to fix whatever it is that's doing it. ETA: Maybe check your version of KindleGen? They did update it at some point to support Kindle Audio/Video and correspondingly larger image files than the older Mobi tools allowed; maybe they upgraded the overall filesize it could handle, too. |
![]() |
![]() |
![]() |
#7 |
Kindler of the Flame
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 582
Karma: 646016
Join Date: Oct 2009
Location: US of A
Device: K DX,3,KT,KP,KF, KFHD; Nook C, PRS600, iPad, Xoom, N900, N810, Zaurus
|
Thanks. I'll check your ideas.
So far, after wasting a lot of time I have figured out that up to 4,064 links in toc.ncx files work fine. Between 4,065 and 4,080 links gives as many warnings (Warning(index build): string too long (max=255). Truncated.); however, the resulting mobi file actually includes all the links. 4,081 and more links in toc.ncx gives only two of the above warnings and does not include any toc.ncx links/waypoints into the resulting mobi file. I feel (I don't know programming) that there is some connection to some variable in the code (unsigned integer on some systems is 0 to 255). I don't know if there is a data type that has 4,064 limitation |
![]() |
![]() |
![]() |
#8 |
Booklegger
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,801
Karma: 7999816
Join Date: Jun 2009
Location: Toronto, Ontario, Canada
Device: BeBook(1 & 2010), PEZ, PRS-505, Kobo BT, PRS-T1, Playbook, Kobo Touch
|
Well, 4064 == (4096 - 32) and those are both nice round binary numbers, so you may be on to something - but I'm not sure what
![]() |
![]() |
![]() |
![]() |
#9 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 64
Karma: 496222
Join Date: Dec 2009
Location: Zürich, Switzerland
Device: Kindle, iPhone, HTC D2 not Sony.
|
What version of Kindlegen are you guys using? 1.0, 1.1 or 1.2? There seems to be a fix related to NCX for kindlegen 1.1. We used kindlegen 1.0 and have the same error with a very big TOC.
|
![]() |
![]() |
![]() |
#10 |
Kindler of the Flame
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 582
Karma: 646016
Join Date: Oct 2009
Location: US of A
Device: K DX,3,KT,KP,KF, KFHD; Nook C, PRS600, iPad, Xoom, N900, N810, Zaurus
|
Thanks, I'll try it out.
|
![]() |
![]() |
![]() |
#11 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 64
Karma: 496222
Join Date: Dec 2009
Location: Zürich, Switzerland
Device: Kindle, iPhone, HTC D2 not Sony.
|
Kindlegen 1.2 includes the source file
Kindlegen 1.2 will result in an awfully large file because kindlegen 1.2 includes the source file. Use kindlestrip to trim the file back down to its original size.
TOCs with more then 4026 entires will work though. They did not work on kindlegen V1.0. Best Zeno |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Page Mapping Using toc.ncx | lorddon | ePub | 35 | 01-16-2018 12:18 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 |