Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > Workshop

Notices

Reply
 
Thread Tools Search this Thread
Old 12-30-2009, 07:14 AM   #1
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: 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.
Attached Files
File Type: epub test.epub (36.1 KB, 276 views)
Jellby is offline   Reply With Quote
Old 12-30-2009, 07:27 AM   #2
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
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.
HarryT is offline   Reply With Quote
Advert
Old 12-30-2009, 08:16 AM   #3
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: 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.
Jellby is offline   Reply With Quote
Old 12-30-2009, 08:18 AM   #4
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
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 .
HarryT is offline   Reply With Quote
Old 12-31-2009, 05:45 AM   #5
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: 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...
Jellby is offline   Reply With Quote
Advert
Old 12-31-2009, 06:36 AM   #6
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
Quote:
Originally Posted by Jellby View Post
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...
Hi Jellby,

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.
HarryT is offline   Reply With Quote
Old 12-31-2009, 07:37 AM   #7
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: 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>
Jellby is offline   Reply With Quote
Old 12-31-2009, 11:22 AM   #8
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: 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.
Jellby is offline   Reply With Quote
Old 01-03-2010, 12:57 PM   #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: 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.
Attached Files
File Type: epub test18.epub (36.6 KB, 277 views)
Jellby is offline   Reply With Quote
Reply


Forum Jump

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


All times are GMT -4. The time now is 03:12 AM.


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