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

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 01-21-2010, 10:57 AM   #1
omk3
Wizard
omk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five words
 
omk3's Avatar
 
Posts: 1,454
Karma: 37243
Join Date: Dec 2009
Location: Europe
Device: pocketbook 360, kindle 4
My first epub: Cover is on page 2 (?)

I have now more or less completed my first-ever hand-crafted epub. I tried to do it properly, with clean code and manually editing everything that was needed. I used Jellby's "The Prince and the Pauper" as a guide for the parts I found most confusing (thanks Jellby!), and in the end I got it in a format I am happy with, with embedded fonts for titles, with margins and different indents for the first paragraph of a chapter and so on. Pretty simple stuff for all your experienced folks, but it was my first time with xhtml and css and I'm quite happy with my progress. I got my epub validated and it works and looks fine.

Except for the cover. The strange thing about the cover is, it is on page 2-3(!). I try to navigate to page 1, but it seems there is no such thing.

I shamelessly copied the script for the cover page, and I don't really understand it. It is like this:
Quote:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<title> cover </title>
</head>

<body>

<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
width="100%" height="100%" viewBox="0 0 600 800" preserveAspectRatio="xMidYMid meet">
<image width="600" height="800" xlink:href="images/cover.jpg" />
</svg>

</body>
</html>
As I understand it it's supposed to resize the image according to screen size, keeping aspect ratio. I removed the link to the style sheet from the cover page as it was not needed and added margins which I didn't want.
The cover appears with a small margin everywhere but on the bottom side, and as I said before, is on page 2-3 instead of page 1.

As everything works and looks okay it's not really a problem, it's just weird. Am I making a really obvious mistake that I can't see?

The image I used for the cover is 600x800 and has no white margins of its own.

Thanks for any comments!
omk3 is offline   Reply With Quote
Old 01-21-2010, 11:03 AM   #2
zelda_pinwheel
zeldinha zippy zeldissima
zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.
 
zelda_pinwheel's Avatar
 
Posts: 27,828
Karma: 908606
Join Date: Dec 2007
Location: Paris, France
Device: eb1150 & is that a nook in her pocket, or she just happy to see you?
hm, very odd !

when you say it's on page 2-3, do you mean there is a blank page before the cover, when you open the book ? or simply that the page number displayed is 2-3 ?

in the toc.ncx, is the cover given the first playorder slot ? is there anything before it ?
zelda_pinwheel is offline   Reply With Quote
 
Enthusiast
Old 01-21-2010, 11:17 AM   #3
omk3
Wizard
omk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five words
 
omk3's Avatar
 
Posts: 1,454
Karma: 37243
Join Date: Dec 2009
Location: Europe
Device: pocketbook 360, kindle 4
There is no page before that, it's just that the number displayed is 2-3 (or just 2 in Adobe Digital Editions)

I have not included the cover in the toc.ncx, but in content.opf it is first in the <spine toc="ncx">. Hmm...maybe I should have included it in the toc then? I'll try it now.

[EDIT] I added the cover to the toc, now my toc is more complete, but other than that nothing changed. It is still on page 2 (or 2-3 on the reader) and it still has margins top left and right but not bottom...

Last edited by omk3; 01-21-2010 at 11:25 AM.
omk3 is offline   Reply With Quote
Old 01-21-2010, 11:37 AM   #4
zelda_pinwheel
zeldinha zippy zeldissima
zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.
 
zelda_pinwheel's Avatar
 
Posts: 27,828
Karma: 908606
Join Date: Dec 2007
Location: Paris, France
Device: eb1150 & is that a nook in her pocket, or she just happy to see you?
add some css (you can add it directly in the page in the <head> element, instead of in an external stylesheet) to remove the margins around the cover :

Code:
<style type="text/css">

 body {margin : 0;
   padding : 0;}

</style>

i don't know why it's marked page 2, unless the margins are causing it to be larger than the page, and therefore it gets "bumped" to a second page... in which case, margin 0 might fix that.
zelda_pinwheel is offline   Reply With Quote
Old 01-21-2010, 11:56 AM   #5
omk3
Wizard
omk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five words
 
omk3's Avatar
 
Posts: 1,454
Karma: 37243
Join Date: Dec 2009
Location: Europe
Device: pocketbook 360, kindle 4
Brilliant about the margins, thanks!

I should have thought of it myself instead of relying on the margins disappearing by themselves...
My excuse is that I thought the svg script took care of it (I don't even know what svg is ) and that I have been looking at this specific epub for too long now... Maybe I need to clear my head a little.

Anyway, cover now looks beautiful, but is still on page 2-3 on the reader, and on Adobe Digital Editions it was page 2, then after some scrolling up and down it is on page 3! Nothing before it of course, it just refuses to be on the first page... On the reader I specifically ask "go to page 1" and it displays page 2-3 instead.
omk3 is offline   Reply With Quote
Old 01-21-2010, 11:58 AM   #6
zelda_pinwheel
zeldinha zippy zeldissima
zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.
 
zelda_pinwheel's Avatar
 
Posts: 27,828
Karma: 908606
Join Date: Dec 2007
Location: Paris, France
Device: eb1150 & is that a nook in her pocket, or she just happy to see you?
weird. i'll think about it some more, and hopefully one of the epub Geniuses we've got around here will have an idea to solve this. i was hoping it was just a question of ADE thinking the image was too big and didn't fit on the first page... at least you got the margins sorted.

(svg = Scalable Vector Graphic )
zelda_pinwheel is offline   Reply With Quote
Old 01-21-2010, 07:06 PM   #7
omk3
Wizard
omk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five words
 
omk3's Avatar
 
Posts: 1,454
Karma: 37243
Join Date: Dec 2009
Location: Europe
Device: pocketbook 360, kindle 4
Quote:
Originally Posted by zelda_pinwheel View Post
Oooh, right, now I get it!

Cleared my head a little (with a few pints, not very effective) and looked at everything again, well at my cover.xhtml and the content.opf, but nothing stands out. Every other book I've opened starts on page 1. I guess I have to accept that my ebook will be unique
omk3 is offline   Reply With Quote
Old 01-21-2010, 08:09 PM   #8
omk3
Wizard
omk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five words
 
omk3's Avatar
 
Posts: 1,454
Karma: 37243
Join Date: Dec 2009
Location: Europe
Device: pocketbook 360, kindle 4
Hmmmm, I think I'm on to something...

(For what's following, I'm using the word "page" for the page numbers displayed on the bottom of the reader, and the word "screen" for each page turn on my reader, to avoid confusion)

Scrolling up and down my book in ADE in frustration, I noticed that every screen had two or three little page numbers on the side. That's a lot!

On my reader, starting from the beginning and turning the pages, I get:

page 2-3 for the cover
page 4 for the title page
Then comes the first short story with pages 5-6, 6-9, 9-11, 11.
So one screen spans 2 pages, the next 3.5, the next 2.5, and then only one (half actually) because it's end of chapter.
Another short story is so small it is actually only one paragraph, and is a little more than half a screen (small font). This is on pages 131-132.

So what I think is, this all has something to do with the way adobe calculates pages. My ebook is a collection of 32 short stories spanning 280 pages, and while some of them are normal short story length, some can be as short as a paragraph or half a page. I have every story in its own xtml, and most of them don't reach 10kb of size. I believe this results (in a way I don't quite understand) in pages of shorter length than usual, so that each screen displays 2-3 pages by default. That would explain my cover being 2-3 (though I would expect it to be 1-3 actually) and it would mean that there isn't much I can do about it.

Do you think I have come to the right conclusion? Has anyone had the same experience? I would guess that, if I am correct, poetry collections with small poems could have exactly the same behaviour.
omk3 is offline   Reply With Quote
Old 01-22-2010, 07:27 AM   #9
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 6,043
Karma: 4347035
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
I get usually around one and a half screens per page, and that's with a fairly small font size. I believe ADE calculates pages just based on the byte length of the file, so if you have lots of XHTML code, or use multi-byte unicode characters, you could get shorter pages... Can we have a look at your full book?
Jellby is offline   Reply With Quote
Old 01-22-2010, 07:38 AM   #10
pdurrant
The Grand Mouse
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 31,163
Karma: 86241230
Join Date: Jul 2007
Location: Norfolk, England
Device: NOOK ST GlowLight
Quote:
Originally Posted by omk3 View Post
So what I think is, this all has something to do with the way adobe calculates pages.
Exactly. I think Adobe use 1KB (or perhaps 2KB) per 'page'. There is a non-standard way to include a mapping between page numbers and the contents, so that you could specify that the cover was page 1, and the title page page 2, and the first story started on page 3. But I'm not sure it's worth doing.
pdurrant is offline   Reply With Quote
Old 01-22-2010, 07:44 AM   #11
omk3
Wizard
omk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five words
 
omk3's Avatar
 
Posts: 1,454
Karma: 37243
Join Date: Dec 2009
Location: Europe
Device: pocketbook 360, kindle 4
Quote:
Originally Posted by Jellby View Post
I get usually around one and a half screens per page, and that's with a fairly small font size. I believe ADE calculates pages just based on the byte length of the file, so if you have lots of XHTML code, or use multi-byte unicode characters, you could get shorter pages... Can we have a look at your full book?
It is actually a copyrighted book I had as a paper book and converted to ebook, so I could not really post it here. (I could send it to you personally if you really wanted to see it though, I guess)

The code in the xhtml files is the absolute minimum, link to css, then <h2>, <div> and <p> tags, and some tags for italics or specific formatting for poems (one or two), so there's not really a lot of code, no. I tried to keep it as clean as possible.

The book is in english, with only a few accented characters in the whole book and nothing else extraordinary, so no multi-byte unicode characters either. As I said, actually the xhtml files are really small, nine of them are in the 2-5 kb range (not including the title page which is smaller) , and the largest is 35kb. Actually only five of them are over 10kb.
omk3 is offline   Reply With Quote
Old 01-22-2010, 07:56 AM   #12
omk3
Wizard
omk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five words
 
omk3's Avatar
 
Posts: 1,454
Karma: 37243
Join Date: Dec 2009
Location: Europe
Device: pocketbook 360, kindle 4
Quote:
Originally Posted by pdurrant View Post
Exactly. I think Adobe use 1KB (or perhaps 2KB) per 'page'. There is a non-standard way to include a mapping between page numbers and the contents, so that you could specify that the cover was page 1, and the title page page 2, and the first story started on page 3. But I'm not sure it's worth doing.
I'm sure it's not worth it at all, it's just that I would expect the first page to at least include the number one. I wouldn't mind my first page being 1-3 (much), but 2-3 is just weird...

Pages actually do seem to change every 1kb. But "The Prince and the Pauper"'s cover is 3kb and is on page 1. My cover is 3kb and is on page 2-3.
omk3 is offline   Reply With Quote
Old 01-22-2010, 08:05 AM   #13
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 6,043
Karma: 4347035
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by omk3 View Post
Pages actually do seem to change every 1kb. But "The Prince and the Pauper"'s cover is 3kb and is on page 1. My cover is 3kb and is on page 2-3.
The size of the cover image should not matter, it's only the XHTML code and text that counts, not linked elements.

Could you create another sample file replacing copyrighted text with "lorem ipsum" or any other dummy text? Just a couple of "chapters" would be enough.
Jellby is offline   Reply With Quote
Old 01-22-2010, 08:24 AM   #14
omk3
Wizard
omk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five wordsomk3 can name that ebook in five words
 
omk3's Avatar
 
Posts: 1,454
Karma: 37243
Join Date: Dec 2009
Location: Europe
Device: pocketbook 360, kindle 4
Quote:
Originally Posted by Jellby View Post
The size of the cover image should not matter, it's only the XHTML code and text that counts, not linked elements.
Yes, I was referring to the cover.xhtml. The cover.jpg is a lot larger than that.

Quote:
Originally Posted by Jellby View Post
Could you create another sample file replacing copyrighted text with "lorem ipsum" or any other dummy text? Just a couple of "chapters" would be enough.
I was thinking about something like that. I need to find out how it works, and I'll get back to you
omk3 is offline   Reply With Quote
Old 01-22-2010, 08:35 AM   #15
pdurrant
The Grand Mouse
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 31,163
Karma: 86241230
Join Date: Jul 2007
Location: Norfolk, England
Device: NOOK ST GlowLight
Quote:
Originally Posted by omk3 View Post
Yes, I was referring to the cover.xhtml. The cover.jpg is a lot larger than that.
I've just take a look at your code. Take out all the commented out code -- it still gets counted in the sizes.

When I take all the comments out from your cover.html, I see the cover on page 1 and the title page on page 2.
pdurrant 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
Convert to EPUB without Cover Page? Handyman1 Calibre 14 10-17-2010 10:18 AM
ePub Page Numbering Using Page-map Dark123 Calibre 2 06-16-2010 07:15 AM
ePub Suppress Cover Page daveps Calibre 3 02-10-2010 10:12 AM
ePub Cover Page Timoleon ePub 10 11-06-2009 11:22 AM
EPUB=>Mobi: Start/open at cover page - how to? Skydog Calibre 6 10-16-2009 09:43 PM


All times are GMT -4. The time now is 09:13 AM.


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