01-21-2010, 10:57 AM | #1 | |
Wizard
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:
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! |
|
01-21-2010, 11:03 AM | #2 |
zeldinha zippy zeldissima
Posts: 27,827
Karma: 921169
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 ? |
Advert | |
|
01-21-2010, 11:17 AM | #3 |
Wizard
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. |
01-21-2010, 11:37 AM | #4 |
zeldinha zippy zeldissima
Posts: 27,827
Karma: 921169
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. |
01-21-2010, 11:56 AM | #5 |
Wizard
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. |
Advert | |
|
01-21-2010, 11:58 AM | #6 |
zeldinha zippy zeldissima
Posts: 27,827
Karma: 921169
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 ) |
01-21-2010, 07:06 PM | #7 | |
Wizard
Posts: 1,454
Karma: 37243
Join Date: Dec 2009
Location: Europe
Device: pocketbook 360, kindle 4
|
Quote:
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 |
|
01-21-2010, 08:09 PM | #8 |
Wizard
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. |
01-22-2010, 07:27 AM | #9 |
frumious Bandersnatch
Posts: 7,516
Karma: 18512745
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?
|
01-22-2010, 07:38 AM | #10 |
The Grand Mouse 高貴的老鼠
Posts: 71,504
Karma: 306214458
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
|
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.
|
01-22-2010, 07:44 AM | #11 | |
Wizard
Posts: 1,454
Karma: 37243
Join Date: Dec 2009
Location: Europe
Device: pocketbook 360, kindle 4
|
Quote:
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. |
|
01-22-2010, 07:56 AM | #12 | |
Wizard
Posts: 1,454
Karma: 37243
Join Date: Dec 2009
Location: Europe
Device: pocketbook 360, kindle 4
|
Quote:
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. |
|
01-22-2010, 08:05 AM | #13 | |
frumious Bandersnatch
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Quote:
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. |
|
01-22-2010, 08:24 AM | #14 | ||
Wizard
Posts: 1,454
Karma: 37243
Join Date: Dec 2009
Location: Europe
Device: pocketbook 360, kindle 4
|
Quote:
Quote:
|
||
01-22-2010, 08:35 AM | #15 | |
The Grand Mouse 高貴的老鼠
Posts: 71,504
Karma: 306214458
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
|
Quote:
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. |
|
|
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 |