Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 11-10-2011, 03:44 PM   #1
andyd273
Junior Member
andyd273 began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Nov 2011
Device: none
Mobi to ePub (iBooks)

Helping a friend get his book up on the various bookstores, and I've been mostly successful, except for submitting to iBooks.

I'm somewhat new to doing ebooks, but Im working on it.

Basically, I did all the formatting in html, then converted it to Mobi using the KindleGen tool, which worked pretty good.
Submitted to Amazon no problem.

Then I used Calibre to convert it to ePub, and submitted it to B&N for the Nook, again no problem.

When I tried submitting the ePub to the iBookstore using Apples submission tool, I get a lot of errors, but if I just put it into my iBooks library on my phone, it opens no problem and looks just like it's supposed to.
andyd273 is offline   Reply With Quote
Old 11-10-2011, 06:03 PM   #2
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
For one thing, I wouldn't go html -> Mobi -> ePub, Kindlegen will generally destroy a lot of detail that the mobi format doesn't support. Depending on the formatting you chose to use you may not notice this, but either way Kindlegen needs to convert your html to Mobi markup language, which is most definitely not good html. Calibre then needs to convert that back to real xhtml, and generally does a good job, which is why B&N didn't have a problem. Calibre can go directly from html to ePub.

http://manual.calibre-ebook.com/faq....specific-order

Whether you use the html or mobi source, you can try opening the ePub in Sigil and run a check with its Flight Crew epub checking feature - fix any errors it gives you and see if that does the trick. Without the actual errors we can't provide much more help.

Last edited by ldolse; 11-10-2011 at 06:07 PM.
ldolse is offline   Reply With Quote
Advert
Old 11-11-2011, 09:26 AM   #3
andyd273
Junior Member
andyd273 began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Nov 2011
Device: none
Sigil

I did the conversion from the html to epub, then opened it in sigil.

Not a ton of errors, but I'm not sure what to do with them... most of them say "no character data is allowed by content model"
a few say "element 'br' is not allowed for content model '(p|h1|h2|h3|...'"
in this case it's a br inside of a blockquote...
how do I do line breaks inside of a blockquote?

I have a few that say "element 'metadata' is now allowed for content model", but those went away when I removed the <metadata></metadata> tags from the top of the <body>. I didn't put those all in there, it was calibre. not a big deal for this file because it's only 11 chapters, but I have one I'm helping with that'll end up being 372 chapters (one for each day of the year, plus a few extra sections) and I'm hoping not to have to edit out 372 <metadata></metadata> tags.

The last error is for OEBPS/images/titleart.jpg "this resource is present in the OPF <manifest> but it's not reachable (it's unused)."
Should I remove the reference to the titleart.jpg from the OPF file?
andyd273 is offline   Reply With Quote
Old 11-11-2011, 09:45 AM   #4
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,782
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by andyd273 View Post
I did the conversion from the html to epub, then opened it in sigil.

Not a ton of errors, but I'm not sure what to do with them... most of them say "no character data is allowed by content model"
a few say "element 'br' is not allowed for content model '(p|h1|h2|h3|...'"
in this case it's a br inside of a blockquote...
how do I do line breaks inside of a blockquote?

I have a few that say "element 'metadata' is now allowed for content model", but those went away when I removed the <metadata></metadata> tags from the top of the <body>. I didn't put those all in there, it was calibre. not a big deal for this file because it's only 11 chapters, but I have one I'm helping with that'll end up being 372 chapters (one for each day of the year, plus a few extra sections) and I'm hoping not to have to edit out 372 <metadata></metadata> tags.

The last error is for OEBPS/images/titleart.jpg "this resource is present in the OPF <manifest> but it's not reachable (it's unused)."
Should I remove the reference to the titleart.jpg from the OPF file?
I am not a expert, but blockquote is not an acceptable pair.
I always surround the contents with a <p> tag.

it is a naked BR (outside of a tag pair in the list)
Code:
...</h3>
<br />  <<no
<p>...
theducks is offline   Reply With Quote
Old 11-11-2011, 11:14 AM   #5
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
Quote:
Originally Posted by andyd273 View Post
I did the conversion from the html to epub, then opened it in sigil.

Not a ton of errors, but I'm not sure what to do with them... most of them say "no character data is allowed by content model"
a few say "element 'br' is not allowed for content model '(p|h1|h2|h3|...'"
in this case it's a br inside of a blockquote...
how do I do line breaks inside of a blockquote?

I have a few that say "element 'metadata' is now allowed for content model", but those went away when I removed the <metadata></metadata> tags from the top of the <body>. I didn't put those all in there, it was calibre. not a big deal for this file because it's only 11 chapters, but I have one I'm helping with that'll end up being 372 chapters (one for each day of the year, plus a few extra sections) and I'm hoping not to have to edit out 372 <metadata></metadata> tags.

The last error is for OEBPS/images/titleart.jpg "this resource is present in the OPF <manifest> but it's not reachable (it's unused)."
Should I remove the reference to the titleart.jpg from the OPF file?
Just use multiple <p></p> tags inside of a blockquote and control the top and bottom margins to your preference. theducks advice on this is equally valid.

Note Calibre generally creates working ePubs, but it's not guaranteed to create compliant ePubs. I'm not sure why Calibre inserted those metadata tags, someone else may be able to comment. Anyway you can use Sigil's search and replace to create a regex to remove them simultaneously for 372 chapters should the problem come up again.

If you're not using titleart.jpg then it's simplest to delete it, yes. Delete the actual file and Sigil will automatically update the OPF.

Last edited by ldolse; 11-11-2011 at 11:16 AM.
ldolse is offline   Reply With Quote
Advert
Old 11-11-2011, 09:01 PM   #6
dwig
Wizard
dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.
 
dwig's Avatar
 
Posts: 1,613
Karma: 6718479
Join Date: Dec 2004
Location: Paradise (Key West, FL)
Device: Current:Surface Go & Kindle 3 - Retired: DellV8p, Clie UX50, ...
Quote:
Originally Posted by theducks View Post
I am not a expert, but blockquote is not an acceptable pair.
I always surround the contents with a <p> tag.

it is a naked BR (outside of a tag pair in the list)
Code:
...</h3>
<br />  <<no
<p>...
<blockquote> is not a "block" structure in ePub. Any text inside of a <blockquote> has to be inside of a <p> or <div> inside of the <blockquote>. Also, any <br /> needs to be inside of a <p> or <div>, even when inside of a <blockquote>

Code:
<blockquote>
  <p> blah, blah, ..., more blah<br />
  another line of blah</p>
</blockquote>
dwig is offline   Reply With Quote
Old 11-12-2011, 02:06 AM   #7
osnova
Kindler of the Flame
osnova ought to be getting tired of karma fortunes by now.osnova ought to be getting tired of karma fortunes by now.osnova ought to be getting tired of karma fortunes by now.osnova ought to be getting tired of karma fortunes by now.osnova ought to be getting tired of karma fortunes by now.osnova ought to be getting tired of karma fortunes by now.osnova ought to be getting tired of karma fortunes by now.osnova ought to be getting tired of karma fortunes by now.osnova ought to be getting tired of karma fortunes by now.osnova ought to be getting tired of karma fortunes by now.osnova ought to be getting tired of karma fortunes by now.
 
osnova's Avatar
 
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
Andy,
This article may be useful to you.

In short, Calibre creates epubs that work; however, they are not necessarily fully compliant with epub spec. Also note this note from that article,

"Tip #4: Even though the files properly validate with an EpubCheck site and validate with iTunes Producer, they’re not being tested for everything that Apple’s system might require. Validation doesn’t necessarily mean valid."

So, even if you check your epub with EpubCheck, it is no guarantee that it will pass Apple's muster.


On a different note, why doesn't Calibre properly handle <blockquote> in epubs?

Last edited by osnova; 11-12-2011 at 02:08 AM.
osnova is offline   Reply With Quote
Old 11-12-2011, 02:23 AM   #8
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
Quote:
Originally Posted by osnova View Post
On a different note, why doesn't Calibre properly handle <blockquote> in epubs?
In this case, the non-compliant html came from the original html source - Calibre isn't guaranteed to fix problems like this in the input document (though it does in many cases).
ldolse is offline   Reply With Quote
Old 11-14-2011, 09:25 AM   #9
andyd273
Junior Member
andyd273 began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Nov 2011
Device: none
So in my kindle version I have a table of contents between the title page and the first chapter.
Not sure if it's the right way to do it, since there is also the table of contents file, but the example of how to prepare the html for KindleGen I found online did it that way.

For my chapters, I use:
<mbp: pagebreak />
<a name="chapter1"></a>
<h1 class='chapterhead'>Chapter 1</h1><br />

Which works good for the Kindle version, but when I make the epub in calibre it splits the chapters on the h1 tag, meaning that the TOC thinks that the chapter begins at the end of the previous page.

Is there a better way to do this?

Is there an epub publisher that i should be using instead of Calibre? Something that plays better with Apple?

Last edited by andyd273; 11-14-2011 at 09:26 AM. Reason: It goofed on the :P in the mbp:pagebreak
andyd273 is offline   Reply With Quote
Old 11-14-2011, 09:57 AM   #10
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,782
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
the H tag is all you need in epub with Calibre or Sigil

you don't need the anchor at all.
In some cases you might need to use:
<h1 title="What to show in the TOC">
when the H is not text (or overly ??)
theducks is offline   Reply With Quote
Old 11-15-2011, 10:46 AM   #11
andyd273
Junior Member
andyd273 began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Nov 2011
Device: none
So, maybe there is a better way to do stuff than I have been doing.
For Kindle I have a HTML, OPF, and toc.ncx. The ncx is bacially a xml with all of the table of contents info:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ncx PUBLIC "-//NISO//DTD ncx 2005-1//EN" "http://www.daisy.org/z3986/2005/ncx-2005-1.dtd">
<ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1">
<docTitle>
<text>My Title</text>
</docTitle>
<navMap>
<navPoint playOrder="1">
<navLabel>
<text>Introduction</text>
</navLabel>
<content src="Wolves.html#introduction"/>
</navPoint>
<navPoint playOrder="2">
<navLabel>
<text>A Word From the Author</text>
</navLabel>
<content src="Wolves.html#fromtheauthor"/>
</navPoint>
<navPoint playOrder="3">
<navLabel>
<text>Chapter 1 — The Scriptures</text>
</navLabel>
<content src="Wolves.html#Chapter1"/>
</navPoint>

And so on. If I don't need the A for the epub, then I probably don't need the toc.ncx either... but I assume that Calibre takes that into account.
andyd273 is offline   Reply With Quote
Old 11-15-2011, 10:51 AM   #12
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,782
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
You don't need the <a
because the default is Top of File in its absence.

You need the NCX always (in a EPUB).
theducks is offline   Reply With Quote
Old 11-15-2011, 04:04 PM   #13
andyd273
Junior Member
andyd273 began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Nov 2011
Device: none
Quote:
Originally Posted by theducks View Post
You don't need the <a
because the default is Top of File in its absence.

You need the NCX always (in a EPUB).
So in EPUB the best practice is to have a seperate HTML file for each chapter, while for Kindle Mobi it appears to work well with a single HTML file.

The NCX for Kindle relies on the A tag because it's a single HTML file, while the NCX for EPUB has problems with this.

So I either need to have two sources, with a single HTML for Kindle, and a separate single HTML for EPUB and expect Calibre to do the splitting on the H tags, or a HTML for each chapter for EPUB (which I don't want to do with my 382 chapter project...).

Hmm, wonder if I can just tell Calibre to split on the <mbp: pagebreak /> tag instead of the H tag...

Thanks for all the help.
andyd273 is offline   Reply With Quote
Old 11-15-2011, 04:57 PM   #14
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,782
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by andyd273 View Post
So in EPUB the best practice is to have a seperate HTML file for each chapter, while for Kindle Mobi it appears to work well with a single HTML file.

The NCX for Kindle relies on the A tag because it's a single HTML file, while the NCX for EPUB has problems with this.

So I either need to have two sources, with a single HTML for Kindle, and a separate single HTML for EPUB and expect Calibre to do the splitting on the H tags, or a HTML for each chapter for EPUB (which I don't want to do with my 382 chapter project...).

Hmm, wonder if I can just tell Calibre to split on the <mbp: pagebreak /> tag instead of the H tag...

Thanks for all the help.
EPUB does NOT have any problem with properly formed Anchors or referrals.

Some devices have a 260K single file (inside the EPUB), so splitting on chapter breaks makes a nice place to keep things under limits.
theducks is offline   Reply With Quote
Reply

Tags
calibre, epub, ibooks, mobi


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
18MB EPUB converts to 40MB Mobi! What can I do to reduce Mobi file size? perdman Conversion 11 12-09-2017 04:18 AM
Converting to ePub for iBooks AppleTard Conversion 5 08-26-2011 03:44 PM
mobi convert to ePub, cover OK in iBooks, not Stanza 1611mac Conversion 5 03-10-2011 12:04 PM
Cover in iBooks (epub) holdrio ePub 15 11-03-2010 11:09 AM
iBooks will allow any old (non-DRM) ePub ChristopherTD Apple Devices 28 03-14-2010 06:24 PM


All times are GMT -4. The time now is 07:42 PM.


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