Tuesday, May 11, 2010

ePub validation

To get a book into Apple's iBook store, you need to convert the book to the format ePub. I've done that. But... I am using this page to try to validate this ePub file, but it seems to be invalid. However, there are no hints of how to fix it. (The file is made by Sigil.)
Does anybody know how to fix it?
(Lulu.com takes $100 for conversion and validation, and that's just ludicrous.)

OK, I tried using inDesign also, but the epub file it made does not validate either. (Also, oddly, when placing text with autoflow from the original .rtf file, it only imports about 25% of the text.)

14 comments:

Ganesha Games said...

I think the new Indesign CS5 can do that in a zip but not tried it yet.

Eolake Stobblehouse said...

Well, I *have* converted it, see? I can do it with Calibre, or with Sigil, and I've tried both. The problem is getting the file valid(ated).
(I could try running it through CS5, OK, but I'm not optimistic. Adobe is not known for making clean, simple code in documents.)

joyrpsig said...

The page you are using is a wrapper for [epubcheck] so I ran [epubcheck] from the command line, and received this error:

Sugar-Domino-b.epub/OEBPS/content.opf(10): unfinished element

Unable to find anything wrong with a code checker, or see anything with a visual code check, but I am cross eyes with tiredness, so that's my best shot.

joyrpsig said...

OK, so sleep eluded me.

Metadata for language is required in the file
[content.opf]
but this seems to be missing in
[Sugar-Domino-b.epub]
so I added a line
[en-US]
which cured the first error but generated two alternative errors
[/Sugar-Domino-b.epub: length of first filename in archive must be 8, but was 15]
[/Sugar-Domino-b.epub: Required META-INF/container.xml resource is missing]
nether of which seems to be true

Perhaps upgrade to Sigil.0.2.0 (you are using v.0.1.8?) and ensure you specify a language.

joyrpsig said...

Blogger is shafting the code. language line should read:

(LCHEV)dc:language(RCHEV)en-US(LCHEV)/dc:language(RCHEV)

with [?CHEV] standing for the left and right chevrons of XHTML

Eolake Stobblehouse said...

"Sugar-Domino-b.epub/OEBPS/content.opf(10): unfinished element"

That's the same error I got.
I tried dl'ing epubcheck, but neither my Mac now windows knew how to run it. I don't have a clue about command lines. (Who makes a command line app only these days?)
I'll try Sigil 2, thanks.

joyrpsig said...

Unix people like to make the command line sound complex, but here is a beginner's guide (ie written by a beginner) to running [epubcheck] which is a Java program:

Open:
[Terminal] app
it's in Applications:Utilities by default

Type:
java[space]-jar[space]

Drag & drop:[epubcheck] app file
into the [Terminal] window, because although it may be a command line, it's a Mac command line (the geeks hate it when people learn this easy usage without the opportunity to mistype the paths)

[Terminal] should insert the next [space] if not do it yourself

Drag & drop:
[target] EPUB file
into the [Terminal] window

Press:
[RETURN]

The [epubcheck] readme file shows these steps as:
[java -jar epubcheck-x.x.x.jar file.epub]

Q: "(Who makes a command line app only these days?)"
A: epubcheck

Eolake Stobblehouse said...

Ok, ta.

Timo Lehtinen said...

What do you drink in an ePub? iBeer?

poohbar said...

"Have sex with it too, maybe?"

Hic. Am I in the wrong topic?

TC [Girl] said...

ttl & poohbar: SILLY YOU's but GOOD ONES! lol!! :-D

Eolake Stobblehouse said...

Poohbar, yes, it seems you missed a turn right just after your last iBeer.

mushol said...

...adds export compatibility to Pages with the standard ePub file format (for use with iBooks).

http://support.apple.com/kb/HT4165

iWork 9.0.4 update today via Software Update. Not tested here yet.

Eolake Stobblehouse said...

Ah, thanks for info.