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

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader > Kobo Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 04-17-2014, 03:48 PM   #1
scoky
Connoisseur
scoky can differentiate black from dark navy bluescoky can differentiate black from dark navy bluescoky can differentiate black from dark navy bluescoky can differentiate black from dark navy bluescoky can differentiate black from dark navy bluescoky can differentiate black from dark navy bluescoky can differentiate black from dark navy bluescoky can differentiate black from dark navy bluescoky can differentiate black from dark navy bluescoky can differentiate black from dark navy bluescoky can differentiate black from dark navy blue
 
Posts: 50
Karma: 13112
Join Date: Feb 2013
Device: Kindle Paperwhite; KOBO AURA HD
How to modify the top margin?

Hi guys, do you know how to change the top margin. I have used kobopatcher to reduce the bottom margin, however I didn't find how to modify the top margin.Could you know it? Thanks.
scoky is offline   Reply With Quote
Old 04-19-2014, 01:57 PM   #2
GeoffR
Wizard
GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.
 
GeoffR's Avatar
 
Posts: 1,679
Karma: 3275450
Join Date: Nov 2012
Location: New Zealand
Device: Kobo Glo
The epub reader has only a very small top margin built-in, in firmware 3.2.0 it is just 15 pixels on the Glo, or less than 2mm. So, if you are reading kepubs, then one way to reduce the top margin is to sideload the book as an epub.

If you are already reading epubs and your top margin is larger than 2mm, then you can edit the book to remove the @page margin/padding. But if you want to remove the remaining 2mm top margin from the built-in epub reader, then I don't think anyone knows how to do that yet.

Edit: Attached a screenshot from my Glo showing a page from an epub with no extra top margin/padding in the book, just the 15 pixel top margin built in to the epub reader.
Attached Thumbnails
Click image for larger version

Name:	screen_001.png
Views:	109
Size:	120.4 KB
ID:	121856  

Last edited by GeoffR; 04-19-2014 at 02:07 PM. Reason: Added screenshot
GeoffR is offline   Reply With Quote
 
Advertisement
Old 04-20-2014, 11:54 AM   #3
scoky
Connoisseur
scoky can differentiate black from dark navy bluescoky can differentiate black from dark navy bluescoky can differentiate black from dark navy bluescoky can differentiate black from dark navy bluescoky can differentiate black from dark navy bluescoky can differentiate black from dark navy bluescoky can differentiate black from dark navy bluescoky can differentiate black from dark navy bluescoky can differentiate black from dark navy bluescoky can differentiate black from dark navy bluescoky can differentiate black from dark navy blue
 
Posts: 50
Karma: 13112
Join Date: Feb 2013
Device: Kindle Paperwhite; KOBO AURA HD
Quote:
Originally Posted by GeoffR View Post
The epub reader has only a very small top margin built-in, in firmware 3.2.0 it is just 15 pixels on the Glo, or less than 2mm. So, if you are reading kepubs, then one way to reduce the top margin is to sideload the book as an epub.

If you are already reading epubs and your top margin is larger than 2mm, then you can edit the book to remove the @page margin/padding. But if you want to remove the remaining 2mm top margin from the built-in epub reader, then I don't think anyone knows how to do that yet.

Edit: Attached a screenshot from my Glo showing a page from an epub with no extra top margin/padding in the book, just the 15 pixel top margin built in to the epub reader.
Thanks! However, actually I want to increase the top margin.....
scoky is offline   Reply With Quote
Old 04-20-2014, 02:23 PM   #4
jackie_w
Wizard
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 2,910
Karma: 4329601
Join Date: Sep 2009
Location: UK
Device: Sony PRS-350, PB360, Kobo Glo/AuraHD/Aura6"/AuraH2O
Quote:
Originally Posted by scoky View Post
Thanks! However, actually I want to increase the top margin.....
Not sure which Kobo model you have but if you're a calibre user this method will work for standard epubs (not sure about kepubs)

Just add something like the following to your custom kobo_extra.css file:
Code:
@page {margin-top: 10pt; margin-bottom: 0; margin-left: 0; margin-right: 0}
where the red bit is as big/small as you want it to be.

Edit: You will also need to re-send-to-device all your epubs from calibre to the Kobo afterwards for the bigger top margin to take effect.

Last edited by jackie_w; 04-20-2014 at 02:29 PM.
jackie_w is offline   Reply With Quote
Old 04-20-2014, 03:10 PM   #5
GeoffR
Wizard
GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.
 
GeoffR's Avatar
 
Posts: 1,679
Karma: 3275450
Join Date: Nov 2012
Location: New Zealand
Device: Kobo Glo
Quote:
Originally Posted by scoky View Post
Thanks! However, actually I want to increase the top margin.....
Well that is a nice change :-) Editing the book's stylesheet the way jackie_w suggests is probably the best way to go, that is what I do.

However I do have a patch for the epub reader's built-in stylesheet if anyone wants to try it. Although it has the advantage that the books don't need to be edited and sideloaded again, it has the disadvantage that the page margin set in the built-in stylesheet overrides any page margin set in the book, which means the book can't use a smaller margin. (Some books use a zero margin for the cover page, for example).

Here is the patch for firmware 3.2.0.
Spoiler:
Code:
<Patch>
# Apply this version of the patch with kpg.exe
patch_name = `ePub stylesheet additions (page margin example)`
patch_enable = `yes`
replace_xor_00 = 1181FAA, `\x00\x00watchout, your CSS is about to get truncated!\x00\x00\x00`, `\n@page {margin: 25px 0px 0px 0px}\n\x00`
</Patch>

<Patch>
# Apply this version of the patch with patch32lsb
patch_name = `ePub stylesheet additions (page margin example)`
patch_enable = `yes`
replace_string = 1181FAA, `\x00\x00watchout, your CSS is about to get truncated!\x00\x00`, `\n@page {margin: 25px 0px 0px 0px}\n`
</Patch>


Edit: I have been looking into a way to make the top margin adjustable, i.e. so that when you adjust the left/right margins the top margin changes to match. I think it is possible to do it, and if I had the source code I think I could add this feature in 5 minutes, but it is an awful lot more work to do it with a patch :-(

Last edited by GeoffR; 04-20-2014 at 04:08 PM. Reason: Note on adjustable margin.
GeoffR 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
CSS margin instead of margin-top, etc. icallaci Conversion 24 10-19-2013 10:52 AM
@page { margin-bottom: 5.000000pt; margin-top: 5.000000pt; } cybmole Conversion 15 02-12-2011 12:57 PM
Top Margin in epub penguintri ePub 8 05-08-2010 09:37 PM
ePub and top margin specification tompe Upload Help 6 01-02-2010 12:24 PM
calibre ignore margin-top and margin-bottom bender Calibre 2 12-11-2009 07:58 AM


All times are GMT -4. The time now is 05:32 PM.


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