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

Go Back   MobileRead Forums > E-Book Formats > Kindle Formats

Notices

Reply
 
Thread Tools Search this Thread
Old 04-26-2011, 11:14 AM   #1
mtrahan
Colonel Mustard
mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.
 
mtrahan's Avatar
 
Posts: 87
Karma: 1426
Join Date: Feb 2010
Location: Montreal
Device: iPod Touch, Kindle 3, iPad 2
ePub to Mobi with Calibre: cover is skipped when opening book

I've been working on a ePub file for a couple of days (with Sigil). The formatting seems to work fine in iBooks and ADE. But when I convert the file to Mobi with Calibre and put it on my Kindle, there is one problem: when I open the book, it skips the cover and jumps right to the "about" page.

The tite of the about page is between <h2> tags and is the first item on the TOC. The <h2> element is styled like this in CSS:
Quote:
h2.sectiontitle {
text-align: center;
page-break-before: always;
}
I guess the problem comes with the "page-break-before: always" part. How do I fix this problem (the book skipping cover) if I want to keep "page-break-before: always" in my "sectiontitle" class? Should I put special code in the first file—where the cover is—so that the Kindle explicitly knows that this is the start of the book?

Is it the good way to solve this problem or there is a cleaner way?

Also, not sure if this is a problem with the Calibre conversion? I know Calibre does the best with what input it gets, so ideally, I would prefer to add something in the original ePub with Sigil (to keep the original as good as possible). Or should I edit the output of Calibre conversion—the mobi file, directly?

Thanks in advance for your help.
mtrahan is offline   Reply With Quote
Old 04-26-2011, 12:13 PM   #2
ApK
What did you call me?
ApK ought to be getting tired of karma fortunes by now.ApK ought to be getting tired of karma fortunes by now.ApK ought to be getting tired of karma fortunes by now.ApK ought to be getting tired of karma fortunes by now.ApK ought to be getting tired of karma fortunes by now.ApK ought to be getting tired of karma fortunes by now.ApK ought to be getting tired of karma fortunes by now.ApK ought to be getting tired of karma fortunes by now.ApK ought to be getting tired of karma fortunes by now.ApK ought to be getting tired of karma fortunes by now.ApK ought to be getting tired of karma fortunes by now.
 
Posts: 4,057
Karma: 33514047
Join Date: Feb 2010
Location: NJ, USA
Device: Kindle
All Kindle books open to the beginning of the text. I've never seen one open to the cover...always have to page back, or "goto cover" to see it.

I've seen mention here, I think, that if you want a Kindle book to open to the cover image, you'd have to include the cover image as a graphic on the first content page.
ApK is online now   Reply With Quote
Old 04-26-2011, 02:00 PM   #3
mtrahan
Colonel Mustard
mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.
 
mtrahan's Avatar
 
Posts: 87
Karma: 1426
Join Date: Feb 2010
Location: Montreal
Device: iPod Touch, Kindle 3, iPad 2
Quote:
Originally Posted by ApK View Post
I've seen mention here, I think, that if you want a Kindle book to open to the cover image, you'd have to include the cover image as a graphic on the first content page.
Yes, this is what I did—my image cover.jpg is displayed on the first file, titlepage.xhtml, which contains this simple code:

Code:
<style type="text/css">
@page {padding: 0pt; margin:0pt}
body { text-align: center; padding:0pt; margin: 0pt; }
div { margin: 0pt; padding: 0pt; }

img.sgc-1 {height: 100%}
</style>
</head>

<body>
<div><img alt="cover" class="sgc-1" src="../Images/cover.jpg" /></div>
</body>
Also I just tested on another book, similar situation (cover displayed on first file), but before the first <h2> tag, there was a couple various pages (quotes that goes before the main text, etc.). And when opening the book on my Kindle for the first time, it skipped all those first pages to open where the first <h2> tag appears... So it definitely seems linked. I just noticed though that this <h2> tag had no "page-break-before" in his definition.

I still want to understand what I am doing wrong. Thanks for the help.
mtrahan is offline   Reply With Quote
Old 04-26-2011, 02:30 PM   #4
mtrahan
Colonel Mustard
mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.
 
mtrahan's Avatar
 
Posts: 87
Karma: 1426
Join Date: Feb 2010
Location: Montreal
Device: iPod Touch, Kindle 3, iPad 2
...I think I've found what I'm looking for on the forum: http://www.mobileread.com/forums/sho...d.php?t=106736

Gotta add a <reference type="start"> entry in the OPF. Guess it has to be added directly to the Mobi file? I'll test a bit later today and see if I can fix the problem that way.
mtrahan is offline   Reply With Quote
Old 04-26-2011, 03:55 PM   #5
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 8,762
Karma: 39536849
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Yes the anchor has to be added to the source, and the reference added to the guide portion of the OPF.
DiapDealer is online now   Reply With Quote
Old 04-26-2011, 04:17 PM   #6
mtrahan
Colonel Mustard
mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.
 
mtrahan's Avatar
 
Posts: 87
Karma: 1426
Join Date: Feb 2010
Location: Montreal
Device: iPod Touch, Kindle 3, iPad 2
Thanks for the confirmation. I will try it tonight.

Seems like an obvious question, but just in case: can I do this in the ePub (explode it with Calibre and edit it)? Then convert to Mobi and send to Kindle.

I'm asking because I don't know how to edit a .mobi file—seems much more complicated than ePub.
mtrahan is offline   Reply With Quote
Old 04-26-2011, 04:36 PM   #7
susan_cassidy
Wizard
susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.
 
Posts: 1,812
Karma: 1662214
Join Date: Jan 2009
Device: Kindle, iPad (not used much for reading)
You edit the source that you used for .mobi - usually HTML.
susan_cassidy is offline   Reply With Quote
Old 04-26-2011, 04:46 PM   #8
mtrahan
Colonel Mustard
mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.
 
mtrahan's Avatar
 
Posts: 87
Karma: 1426
Join Date: Feb 2010
Location: Montreal
Device: iPod Touch, Kindle 3, iPad 2
Quote:
Originally Posted by susan_cassidy View Post
You edit the source that you used for .mobi - usually HTML.
Source is ePub. I will try. Thanks for the clarification.
mtrahan is offline   Reply With Quote
Old 04-26-2011, 06:32 PM   #9
mtrahan
Colonel Mustard
mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.
 
mtrahan's Avatar
 
Posts: 87
Karma: 1426
Join Date: Feb 2010
Location: Montreal
Device: iPod Touch, Kindle 3, iPad 2
Hrm, it doesn't work to add <reference type="start" title="Start here" href="starthere.html"/> in the OPF—"start" type isn't a an accepted value in ePub so I can't do that (since my source file for mobi is ePub). My original file doesn't pass the Flight Crew validation if I leave this part in the OPF...

I guess I could do it just to convert the file to Mobi and then remove it after to keep the original file accepted by validation tools. But it doesn't exactly sound like a clean solution. I'm looking for something I could put in the original ePub file (that would pass validation), so that once converted to Mobi by Calibre my Kindle would open the book (for the first time) at the cover page (which is on titlepage.xhtml)... Is this possible?

Sorry to insist—just trying to find a good/clean workflow before I format/convert more books. I appreciate your help.
mtrahan is offline   Reply With Quote
Old 04-26-2011, 06:33 PM   #10
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 8,762
Karma: 39536849
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Seems like an obvious question, but just in case: can I do this in the ePub (explode it with Calibre and edit it)? Then convert to Mobi and send to Kindle.
Yes, you can use the Calibre's epub tweak to make those small edits, then rebuild the epub and convert to mobi.
DiapDealer is online now   Reply With Quote
Old 04-26-2011, 06:54 PM   #11
ATDrake
Wizzard
ATDrake ought to be getting tired of karma fortunes by now.ATDrake ought to be getting tired of karma fortunes by now.ATDrake ought to be getting tired of karma fortunes by now.ATDrake ought to be getting tired of karma fortunes by now.ATDrake ought to be getting tired of karma fortunes by now.ATDrake ought to be getting tired of karma fortunes by now.ATDrake ought to be getting tired of karma fortunes by now.ATDrake ought to be getting tired of karma fortunes by now.ATDrake ought to be getting tired of karma fortunes by now.ATDrake ought to be getting tired of karma fortunes by now.ATDrake ought to be getting tired of karma fortunes by now.
 
Posts: 6,024
Karma: 14748740
Join Date: Mar 2010
Location: Roundworld
Device: Kindle 2 International & Sony PRS-T1
I think for ePubs, you're supposed to use type="text" rather than "start", which is a Mobi-ism.

But I've never actually bothered creating real ePubs back from my converted/fixed files; just Mobis good enough to work on my Kindle, so I have no idea whether it'll validate or not.
ATDrake is offline   Reply With Quote
Old 04-26-2011, 07:22 PM   #12
mtrahan
Colonel Mustard
mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.mtrahan is no ebook tyro.
 
mtrahan's Avatar
 
Posts: 87
Karma: 1426
Join Date: Feb 2010
Location: Montreal
Device: iPod Touch, Kindle 3, iPad 2
Quote:
Originally Posted by ATDrake View Post
I think for ePubs, you're supposed to use type="text" rather than "start", which is a Mobi-ism.

But I've never actually bothered creating real ePubs back from my converted/fixed files; just Mobis good enough to work on my Kindle, so I have no idea whether it'll validate or not.
"text" is indeed an accepted value!

Unfortunately, there still must be something I'm doing wrong because it doesn't pass Flight Crew. I get this message "attribute 'name' is not declared for element 'a'"...

Here is the line in question: <div><a name="text"/><img alt="cover" class="sgc-1" src="../Images/cover.jpg" /></div>

Does anyone know what I'm doing wrong with this <a name="text"/> thingy? It's getting more ePub-specific though so maybe I will try the ePub forum if I can't find an answer soonish.

Thanks again!
mtrahan is offline   Reply With Quote
Old 04-26-2011, 07:37 PM   #13
netseeker
sleepless reader
netseeker ought to be getting tired of karma fortunes by now.netseeker ought to be getting tired of karma fortunes by now.netseeker ought to be getting tired of karma fortunes by now.netseeker ought to be getting tired of karma fortunes by now.netseeker ought to be getting tired of karma fortunes by now.netseeker ought to be getting tired of karma fortunes by now.netseeker ought to be getting tired of karma fortunes by now.netseeker ought to be getting tired of karma fortunes by now.netseeker ought to be getting tired of karma fortunes by now.netseeker ought to be getting tired of karma fortunes by now.netseeker ought to be getting tired of karma fortunes by now.
 
netseeker's Avatar
 
Posts: 4,770
Karma: 615335
Join Date: Jan 2008
Location: Germany, near Stuttgart
Device: Sony PRS-505, PB 360° & 302, nook wi-fi, Kindle 3
Quote:
Originally Posted by mtrahan View Post
Hrm, it doesn't work to add <reference type="start" title="Start here" href="starthere.html"/> in the OPF—"start" type isn't a an accepted value in ePub so I can't do that (since my source file for mobi is ePub). My original file doesn't pass the Flight Crew validation if I leave this part in the OPF...
We discussed the same problem in the german subforum yesterday. Our current solution/workaround is using reference type="preface" instead of "start". Try adding <reference type="preface" title="Start here" href="starthere.html"/> to your opf-guide.

Quote:
Originally Posted by mtrahan View Post
"text" is indeed an accepted value!
Yes, "text" is an accepted value for ePub but doesn't give the expected result after conversion to mobi.

Quote:
Originally Posted by mtrahan View Post
I get this message "attribute 'name' is not declared for element 'a'"...

Here is the line in question: <div><a name="text"/><img alt="cover" class="sgc-1" src="../Images/cover.jpg" /></div>
Use the id-attribute instead of name. (<a id=".."/>)
netseeker is offline   Reply With Quote
Old 04-26-2011, 07:43 PM   #14
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 8,762
Karma: 39536849
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Yes, "text" is an accepted value for ePub but doesn't give the expected result after conversion to mobi.
Type="text" achieves the expected result when creating the mobi from an ePub with kindlegen, so it must be a difference in calibre's conversion method.
DiapDealer is online now   Reply With Quote
Old 04-26-2011, 07:51 PM   #15
netseeker
sleepless reader
netseeker ought to be getting tired of karma fortunes by now.netseeker ought to be getting tired of karma fortunes by now.netseeker ought to be getting tired of karma fortunes by now.netseeker ought to be getting tired of karma fortunes by now.netseeker ought to be getting tired of karma fortunes by now.netseeker ought to be getting tired of karma fortunes by now.netseeker ought to be getting tired of karma fortunes by now.netseeker ought to be getting tired of karma fortunes by now.netseeker ought to be getting tired of karma fortunes by now.netseeker ought to be getting tired of karma fortunes by now.netseeker ought to be getting tired of karma fortunes by now.
 
netseeker's Avatar
 
Posts: 4,770
Karma: 615335
Join Date: Jan 2008
Location: Germany, near Stuttgart
Device: Sony PRS-505, PB 360° & 302, nook wi-fi, Kindle 3
Quote:
Originally Posted by DiapDealer View Post
Type="text" achieves the expected result when creating the mobi from an ePub with kindlegen, so it must be a difference in calibre's conversion method.
Yes, i think calibre just ignores type="text" (as well as almost all other guide reference types) when converting to mobi.
netseeker 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
ePub to Mobi cover art - inconsistent wannabee Conversion 5 03-15-2011 12:02 PM
PRS-650 Exclamation Point error opening epub book TimeTraveler Sony Reader 3 02-15-2011 10:38 PM
Pixelated font in e-book reader when opening EPUB format mst Recipes 7 02-13-2011 10:09 PM
Opening hyperlinks in Calibre EPUB news documents on the Nook TimboK Barnes & Noble NOOK 4 11-29-2010 04:18 PM
Calibre and sony formatting when opening book motero57 Calibre 2 01-29-2010 12:24 PM


All times are GMT -4. The time now is 10:31 AM.


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