View Full Version : ePub Cover Page


Timoleon
08-07-2008, 06:56 PM
Hi All ---

I've been fooling with ePub files for the past week or so since Sony made the new upgrade available. I've tried "hand-crafting" some ePub files, and have also had Book Glutton convert some html files over, and although I've had luck with both, I can't seem to get my Sony PRS-505 or Adobe DE to recognize cover pages. Anyone have any hints, or boilerplate that I might try?

Tim

...anxiously awaiting Kovid Goyal's latest masterpiece...:book2:

llasram
08-07-2008, 07:09 PM
I've been fooling with ePub files for the past week or so since Sony made the new upgrade available. I've tried "hand-crafting" some ePub files, and have also had Book Glutton convert some html files over, and although I've had luck with both, I can't seem to get my Sony PRS-505 or Adobe DE to recognize cover pages. Anyone have any hints, or boilerplate that I might try?

What do you mean by "cover pages"? In EPUB the book "cover" is just the first page of the book, so if you have a cover image you can wrap it in some XHTML (and possibly SVG) and add an <itemref/> to the cover HTML as the first item in your <spine/>.

Hope that helps!

wallcraft
08-07-2008, 10:34 PM
Most of the ePubs I have seen include a single page titlepage.xhtml or title_page.html (or whatever) as the first item in the spine. Some just include one large xhtml file, and then whatever is on the 1st page is the "cover" page as far as Adobe Digital Editions is concerned. I have also seen some cover pages listed in the spine with the linear="no" attribute, but that may be dangerous if there is ever an ePub reader that treats such items differently to linear="yes" (see OPF 2.0: Spine (http://www.openebook.org/2007/opf/OPF_2.0_final_spec.html#Section2.4)).

An ePub can have a "guide" section in its .opf file, but it is optional and Adobe DE ignores it. This means that OEB-based ePubs, which are entirely legal ePubs, won't necessarily show their cover image when viewed by Adobe DE. It is now common for MOBI ebooks to only have the cover in a guide item of type "other.ms-coverimage-standard", so these won't automatically convert to Adobe DE compliant ePubs without special handling.

There are advantages to the "first page is the cover page" approach though. For one thing, it does not have to be (or include) a bitmapped image.

Timoleon
08-07-2008, 11:46 PM
Thanks, both.

For some reason, the cover art in my creations shows up on the second page rather than the first, in Adobe Digital Editions. I need to investigate my methods a little more thoroughly, I guess:blink:

Tim

georg3200
01-09-2009, 10:21 AM
Hi there,

I have the same problems. I'm not really sure how the cover.html works.

But I could make a png-graphic file to show as the "cover" and "thumbnail" of the book. I added a line to <manifest..> and the <spine.. > section of content.opf.

It looks like this:

<manifest xmlns="http://www.idpf.org/2007/opf">
<item id="logo" href="logo.png" media-type="image/png" />
...
<manifest>
<spine xmlns="http://www.idpf.org/2007/opf" toc="ncxtoc">
<itemref idref="logo"/>
...
<spine>

It's the line with the logo. Make sure, that it is at the very beginning of the sections. Make sure, that the file logo.png is in the same folder as content.opf.
I've tested it with ADE, cause I do not have a Sony PRS...

Georg

llasram
01-09-2009, 10:29 AM
It's the line with the logo. Make sure, that it is at the very beginning of the sections. Make sure, that the file logo.png is in the same folder as content.opf.

The OPF spec states that the <spine/> can only contain OPS Content Documents -- basically just HTML, in most cases. ADE may render a PNG listed in the <spine/>, but there's no guarantee another EPUB reader will.

Hadrien
01-13-2009, 03:40 PM
The OPF spec states that the <spine/> can only contain OPS Content Documents -- basically just HTML, in most cases. ADE may render a PNG listed in the <spine/>, but there's no guarantee another EPUB reader will.

Should be allowed as long as you've set up a DTBook or XHTML flow as the fallback.

llasram
01-13-2009, 08:39 PM
Should be allowed as long as you've set up a DTBook or XHTML flow as the fallback.

Actually, I'm not sure the OPF spec allows that. The only reference it makes to an item with one of the OPS Core Media Types having a fallback is:

For the purpose of fallback specification, the file with the media type application/x-dtbncx+xml that specifies the publication’s NCX (see below) should be considered a Core Media Type, thus fallback information must not be provided for this file.

The "thus fallback information must not be provides" bit is what gets me. Instead of making NCX a special exception which must not have fallback information provided, the spec makes it one of the Core Media Types and implies that because of this it is disallowed from having a fallback.

Is disallowing such fallbacks actually useful? I can't think of a good reason for it.

Chang
11-06-2009, 09:54 AM
Maybe my question goes under this thread.

Am I right that if I want to have a cover from a real book for my ebook, I need to have xhtml file as my first page and that xhtml file contains just an image of my book cover? For example, in Adobe DE there is a small cover picture next to the author and title. Is it always the same as the first page of my ebook? Is it possible to have book cover in the small picture frame without creating xhtml file with the same picture and keep it as a first page in the ebook. Maybe a bit hardly explained but I hope you get my point :)

pdurrant
11-06-2009, 10:28 AM
If ADE handled the (optional) guide element, you could specify the cover in that, and leave the cover out of the flow in the spine. Then ADE could get the cover for library display, but start the book at the first page, rather than the cover.

Unfortunately, ADE currently ignores the guide items completely and yes, it does just use the first item in the spine as the cover.

No, there isn't a way around this that confirms to the ePub standard.


Maybe my question goes under this thread.

Am I right that if I want to have a cover from a real book for my ebook, I need to have xhtml file as my first page and that xhtml file contains just an image of my book cover? For example, in Adobe DE there is a small cover picture next to the author and title. Is it always the same as the first page of my ebook? Is it possible to have book cover in the small picture frame without creating xhtml file with the same picture and keep it as a first page in the ebook. Maybe a bit hardly explained but I hope you get my point :)

HarryT
11-06-2009, 12:22 PM
When you convert Mobi to ePub with Calibre, it picks up the cover image from the "Guide" item in the Mobi book.