12-30-2009, 07:14 AM | #1 |
frumious Bandersnatch
Posts: 7,536
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Testing margins in ePUB.
Since tompe reported that the Cybooks don't set an appropriate default top margin in ePUBs, I decided to do some tests. I tried with @page CSS rules, with margins for the body element, with Adobe page templates... but couldn't find a satisfactory solution.
So, I'm uploading a test ePUB file and asking for help. It is just a cover image and some dummy text. What I want is: -The cover should take the full screen, or if the aspect ratio does not match, it should be displayed as big as possible to fit the screen. This includes the generated thumbnail if applicable -The text should have customizable margins. I mean, I want to be able to set a 0 margin, or a 2mm margin, or whatever, for all 4 edges. I could not find a way to make the side margins narrower than default (but I didn't try negative margins for <body>). -Ideally, all should be done with standards-compliant CSS, but I could accept some simple page templates. -I'm interested primarily in something that works for the Cybooks, but it's better yet if it works for other readers and software. |
12-30-2009, 07:27 AM | #2 |
eBook Enthusiast
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
|
On the Pocketbook 360, the bottom of the cover is truncated by the status bar, and the text is displayed with no margins (as it is for all ePubs). The PB360 ignores margin settings in ePubs - this is a reasonable decision for a small-screen device (IMHO).
On the Sony PRS-600, again the title page has no bottom border visible, and the text appears with no visible margins. That's a little odd, because the Sony does respect margin settings - the ones in my own ePubs work fine. |
Advert | |
|
12-30-2009, 08:16 AM | #3 |
frumious Bandersnatch
Posts: 7,536
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
I didn't explain myself... The file I uploaded has no margins (but no "margin: 0" either). In the Cybooks it's shown with side margins, though. I want to find a way to set the margins (or better, to unset them and let the user set them... when the software provides the feature ) that would work in as many devices as possible. The uploaded file was intended more as a starting point for others to make their own tests and help me
Last edited by Jellby; 12-30-2009 at 09:32 AM. |
12-30-2009, 08:18 AM | #4 |
eBook Enthusiast
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
|
Oh, OK, that explains it .
|
12-31-2009, 05:45 AM | #5 |
frumious Bandersnatch
Posts: 7,536
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Adding margins to the page template makes the margins wider, and the additional space comes outside the page numbers, so I wonder if the default margins shown are in reality paddings...
|
Advert | |
|
12-31-2009, 06:36 AM | #6 | |
eBook Enthusiast
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
|
Quote:
I'm not sure that I understand your meaning, there. In all the eBooks that I create, I set a 13pt right margin. The ADE page numbers, on both the Sony and the Opus, are displayed in that margin. |
|
12-31-2009, 07:37 AM | #7 |
frumious Bandersnatch
Posts: 7,536
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
I guess you add the margin in CSS, probably for the <body> or @page element. I meant adding the margin to the .xpgt file, like this:
Code:
<fo:simple-page-master master-name="text"> <fo:region-body margin="5mm"/> </fo:simple-page-master> |
12-31-2009, 11:22 AM | #8 |
frumious Bandersnatch
Posts: 7,536
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Setting paddings to zero does not change anything. Negative margins in @page or <body> have no effect either. But negative margins in the page template do work, although only for the side margins, the top margin of the first page in a flow stays there (subsequent pages, as we know, have no default margin).
But using negative margins is no solution, as that would break the book in other readers. I've noticed too that the default margins seem to be proportional to the font size chosen. |
01-03-2010, 12:57 PM | #9 |
frumious Bandersnatch
Posts: 7,536
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Ah... silly me!
It's all in the <body> margins, but the <body> must have a class in order to have its settings override the default ones in the reader (and no, !important is not enough). Additional margins can be added to @page, but these go outside the page numbers. This is a sample file, with zero margins in the <body class="normargin"> element, and 2mm margins in @page. There is still the issue with the top margin in the cover (and maybe the first page of text, I can't say for sure with an <h1> there). Still testing. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
iPad Testing .epub Files from Calibre on iPad | Fabe | Apple Devices | 46 | 06-08-2012 05:37 AM |
Can't seem to change epub margins | Desertway | Calibre | 7 | 01-19-2012 05:28 AM |
userstyle.css and epub margins | tselling | Sony Reader Dev Corner | 8 | 10-28-2010 02:51 PM |
Epub to mobi margins.. | Corran006 | Calibre | 0 | 08-27-2010 09:39 PM |
Classic epub Margins on nook | Trubu | Barnes & Noble NOOK | 6 | 12-15-2009 12:03 AM |