![]() |
#1 |
Member
![]() Posts: 20
Karma: 12
Join Date: Sep 2011
Device: Kindke
|
ePub to Mobi: can't get the reference type="text" to work
Hi everyone,
I've been banging my head on the walls for a while no trying to get calibre to set the Begin mark properly in the Mobi file when converting an ePub. Based on what I've in the forums and elsewhere, I tried the following so far: In the content.opf file Code:
<guide> <reference href="Text/one.html" title="Start" type="text" /> </guide> Code:
<guide> <reference href="Text/one.html" title="Start Here" type="text" /> </guide> Code:
<guide> <reference href="Text/one.html" title="Start Here" type="Start" /> </guide> Code:
<guide> <reference href="Text/one.html" title="Start Here" type="start" /> </guide> I'm using caliber 0.8.18 on a Windows XP Pro PC. Any help would be greatly appreciated. TIA |
![]() |
![]() |
![]() |
#2 |
Member
![]() Posts: 20
Karma: 12
Join Date: Sep 2011
Device: Kindke
|
Well, it looks like a bug in Calibre. In my latest test, my ePub <guide> section looks like this:
Code:
<guide> <reference href="Text/cover.xhtml" title="Cover" type="cover" /> <reference href="Text/toc.html" title="Table Of Contents" type="toc" /> <reference href="Text/title_page.html" title="Title Page" type="title-page" /> <reference href="Text/dedication.xhtml" title="Dedication" type="dedication" /> <reference href="Text/quote.xhtml" title="Epigraph" type="epigraph" /> <reference href="Text/one.html" title="Start" type="text" /> </guide> Code:
<guide> <reference type="text" href="Free Fall - Laura Anne Gilman.html#filepos236" /> <reference type="title-page" title="Title Page" href="Free Fall - Laura Anne Gilman.html#filepos5059" /> <reference type="toc" title="Table Of Contents" href="Free Fall - Laura Anne Gilman.html#filepos689921" /> <reference type="text" title="Start" href="Free Fall - Laura Anne Gilman.html#filepos7192" /> </guide> Could it be something that I'm doing wrong in the ePub that make calibre misbehave? Last edited by DoctorOhh; 09-13-2011 at 02:40 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,887
Karma: 26594726
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Use title="start"
That is lowercase start not Start |
![]() |
![]() |
![]() |
#4 |
Member
![]() Posts: 20
Karma: 12
Join Date: Sep 2011
Device: Kindke
|
I'll try it tonight when I'm back home but the entry with "Start" in the resulting mobi files works as intended. It's the extra reference type="text" without title and pointing to a non existing filepos that cause the problem. If I deleted the first reference line of the mobi guide and repackage it, it works just fine even if the title has a capital S.
|
![]() |
![]() |
![]() |
#5 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,887
Karma: 26594726
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
The entries in the guide are superseded by the contentstart EXTH entry, which will ony be correctly set if you use lowercase start
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Member
![]() Posts: 20
Karma: 12
Join Date: Sep 2011
Device: Kindke
|
I did some tests using title="start" and it works but not always.
First, a working exemple: The Epub guide: Code:
<guide> <reference href="Text/cover.xhtml" title="Cover" type="cover" /> <reference href="Text/toc.html" title="Table Of Contents" type="toc" /> <reference href="Text/title_page.html" title="Title Page" type="title-page" /> <reference href="Text/dedication.xhtml" title="Dedication" type="dedication" /> <reference href="Text/quote.xhtml" title="Epigraph" type="epigraph" /> <reference href="Text/one.html" title="start" type="text" /> </guide> Code:
<guide> <reference type="text" href="Free Fall - Laura Anne Gilman.html#filepos7332" /> <reference type="title-page" title="Title Page" href="Free Fall - Laura Anne Gilman.html#filepos5059" /> <reference type="toc" title="Table Of Contents" href="Free Fall - Laura Anne Gilman.html#filepos690061" /> <reference type="text" title="start" href="Free Fall - Laura Anne Gilman.html#filepos7332" /> </guide> </package> Only the first reference is needed. When I remove the second reference type="text" title="start" and repack the mobi, it sill opens where it should. Second example, I decide that the reader should start reading at the dedication. (This pass all the Epub validation tests so I assume it's valid Epub.) The Epub guide: Code:
<guide> <reference href="Text/cover.xhtml" title="Cover" type="cover" /> <reference href="Text/toc.html" title="Table Of Contents" type="toc" /> <reference href="Text/title_page.html" title="Title Page" type="title-page" /> <reference href="Text/dedication.xhtml" title="Dedication" type="dedication" /> <reference href="Text/quote.xhtml" title="Epigraph" type="epigraph" /> <reference href="Text/dedication.xhtml" title="start" type="text" /> </guide> Code:
<guide> <reference type="text" href="Free Fall - Laura Anne Gilman.html#filepos178" /> <reference type="title-page" title="Title Page" href="Free Fall - Laura Anne Gilman.html#filepos5001" /> <reference type="toc" title="Table Of Contents" href="Free Fall - Laura Anne Gilman.html#filepos690003" /> </guide> I'm not sure if it's easy to fix or not but there is a problem there although the work around is easy. Also, since the Epub standard clearly states that type="text" always mark the 'First "real" page of content (e.g. "Chapter 1")', I don't think that calibre should bother checking the title at all and just use the first type="text". That should probably be low on your priority because once we know about it, it's not a big thing to add the title. And while I'm at it, I always want to thank you for the great job you do on calibre. Best |
![]() |
![]() |
![]() |
#7 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,887
Karma: 26594726
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
calibre is designed to convert files from arbitrary sources that can be arbitrarily messed up. As such relying on files complying with the EPUB spec is very optimistic
![]() There was a regression in 0.8.18 that made the set of guide entries that worked smaller than in 0.8.17. That has been fixed for 0.8.19. Basically the (fixed) algorithm is that either title or type must be start (case independent) and the last entry wins in case of multiple matches. And note that the entries that end up in the <guide> in the MOBI file are irrelevant. The new calibre MOBI engine (in 0.8.18) writes contentstart into the EXTH header, which is always used by the Kindle in preference to whatever is in <guide>. |
![]() |
![]() |
![]() |
#8 |
Member
![]() Posts: 20
Karma: 12
Join Date: Sep 2011
Device: Kindke
|
Thanks you for this. Having to just put the title to whichever guide reference we want the Kindle to use will be quite simple indeed.
Also, thanks for the clarification about EXTH header. I'm guessing my way worked because I was using MobiPocket Creator to "repackage" and it probably just use the guide to set everything else. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Ebook not starting at "first" page after converting from epub to mobi | bfollowell | Conversion | 7 | 08-01-2011 01:52 PM |
Epub to Mobi - missing chapters "Demo Verison Limitations" | LynneWhite | Calibre | 3 | 12-31-2010 05:52 AM |
EPUB to MOBI: "Failed: Convert book 1 of 1" | Jillo | Introduce Yourself | 4 | 02-20-2010 07:49 PM |
"PK": Only text when I open in Sigil an ePub file generated with Calibre | Terisa de morgan | Sigil | 3 | 12-14-2009 12:24 PM |
Content Mobi Reference ("Huge Collections") on Kindle | Mike L | Amazon Kindle | 26 | 04-28-2009 04:14 PM |