View Full Version : Epub 3 -Epub 2 Apple Errors


holdit
12-19-2012, 10:10 AM
First of all thanks for the help with my last post, I have a new problem with a different file.

I have an Apple Fixed Layout epub which works great on my IPad, however when I try to upload it to my IBooks account I get a 5107 error ( No Landmarks) after researching for about a week I have found out a few things but Apple is soo slow in replying so I thought I'd ask here.

It seems that any epub done using epub2 needs to have a guide in the content.opf file ( this is present in the book)

but I then read that any file in Epub3 needs to have a Landmarks code inserted in the toc.ncx.

I left the guide in the content and added the Landmarks code in the .opf and the file just hangs when trying to upload thru ITunes Producer.

My question here is this, to distinguish the difference between epub2 and 3 where do I look for the code that will tell me this?

IBooks Display options,container.xml, and doc.ncx do not seem to have any indication if the file is Epub 2 or 3. But idf I look in the content I see

<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://www.idpf.org/2007/opf" version="3.0" xml:lang="en" unique-identifier="uid">

I would think this would be where I would identify epub2 or 3?

Common sense tells me that if this was an epub 2 file I would not be having these problems as I have the correct <guide> code there already. So it has to be epub3 .

Now since I'm having a problem adding the <landmarks> code can I change the epub from 3 to 2 bypass adding the Landmarks?

or can someone show me exactly how to add as the way I did ha\s to be wrong.

thanks

HHIT

dgatwood
12-19-2012, 02:26 PM
Have you run an EPUB validator on the content? It might prove illuminating. Or it might pass, in which case you should go to bugreport.apple.com and file a bug against iTunes Producer about the hang. :)

mzmm
12-19-2012, 07:49 PM
It seems that any epub done using epub2 needs to have a guide in the content.opf file

yes. also, one of the entries in the guide needs to have type="text" or type="bodymatter" declared.

but I then read that any file in Epub3 needs to have a Landmarks code inserted in the toc.ncx

this is incorrect - the toc.ncx is no longer used (although continues to be supported) in epub3. the toc.ncx is going to be exactly like a toc.ncx in an epub2, and you don't need to add to it to make it conform to epub3. your landmarks are going to be inserted somewhere else.

My question here is this, to distinguish the difference between epub2 and 3 where do I look for the code that will tell me this?

<package xmlns="http://www.idpf.org/2007/opf" version="3.0" ... > as you noticed is one of the ways you can tell immediately.

So it has to be epub3.

yep.

can someone show me exactly how to add as the way I did ha\s to be wrong.


if you have the content.opf sorted out and it contains the guide element with at least one reference to the text/bodymatter, ie:

<guide>
<reference href="cover.html" title="Cover" type="cover"/>
<reference href="page01.html" title="Chapter One" type="text"/>
</guide>

then you're going to create a new html page that will contain all of the navigation elements (toc, landmarks, etc).

nav.html will look something like this:

<?xml version="1.0" encoding="utf-8"?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
<head>
<title>
Navigation
</title>
</head>
<body>
<nav epub:type="toc">
<ol>
<li>
<a href="cover.html">Cover</a>
</li>
<li>
<a href="page01.html">Chapter One</a>
</li>
<li>
<a href="page02.html">Chapter Two</a>
</li>
</ol>
</nav>
<nav epub:type="landmarks">
<h2>
Landmarks
</h2>
<ol>
<li>
<a epub:type="cover" href="cover.html">Cover</a>
</li>
<li>
<a epub:type="bodymatter" href="page01.html">Chapter One</a>
</li>
</ol>
</nav>
</body>
</html>

you'll notice that <nav epub:type="toc"> is epub3's ncx, and <nav epub:type="landmarks"> is basically the guide from the opf.

once you've got that done, you'll need to declare nav.html in the <manifest> in the opf like any other html page, and also assign it the properties="nav":

<item href="toc.html" id="toc" media-type="application/xhtml+xml" properties="nav"/>

more good times here: http://idpf.org/epub/30/spec/epub30-contentdocs.html#sec-xhtml-nav-def-types-toc

hope that helps

holdit
12-20-2012, 08:05 AM
thx for that info.

hIt