View Single Post
Old 10-26-2015, 06:24 PM   #82
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: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
Quote:
Originally Posted by Nick_1964 View Post
Lately in dutch books it is common that they add stupid lines to the .css with the page margins.
Like this:
@page { margin: 3.00em 1.00em 0.70em 1.00em; }
Sometimes in the beginning of the .css but also in the middle or end and much more worse, not in the .css but in every html file.
I now add the following line to
I dont understand always the fully syntax of the patches, can I patch it somewhere (3.17.3 and the other on 3.18.0) so it will always be something like this:
@page { margin: 0.00em 0.00em 0.00em 0.00em!important; } ??
I do now put this in the extra css of calibre but with directly downloaded books (mostly epub) that offcourse doesn't work.
If it is already in the patch, sorry but reading line for line does make it all look to each other,can someone point it out for me ??
The `ePub fixed/adjustable top/bottom margins` patch can do this. If you uncomment the replace_string line after the first two 'Optional replacement value' comments and set the replacement value to '0\00' then all four @page margins in ePubs will be set to zero. However I'm not sure what happens if the book has an .xpgt file with margins set in that, I always delete any .xpgt files before sideloading using the Modify ePub plugin.

(The KePub reader just ignores @page, so no need to do anything for KePubs.)

Here is the section of the patch for 3.18.0, customised to use fixed top/bottom margins of zero (the left/right margins are set to zero by default):
Code:
#
# Optional replacement value: Uncomment for a FIXED TOP MARGIN size in px,
# default 25px. Replacement value is margin size, two digits separated by \0
# (Leave commented out for an adjustable top margin.)
replace_string = B4FDDC, `%\01`, `0\00`
#
# Optional replacement value: Uncomment for a FIXED BOTTOM MARGIN size in px,
# default 00px. Replacement value is margin size, two digits separated by \0
# (Leave commented out for an adjustable bottom margin.)
replace_string = B4FDF0, `%\01`, `0\00`
Edit: You can also use the Modify ePub plugin to remove the @page and body margins, it does a good job with the @page margins, but doesn't always remove all body margins in books that have had their CSS structure flattened by a Calibre conversion.

Last edited by GeoffR; 10-26-2015 at 06:42 PM. Reason: Modify ePub plugin
GeoffR is offline   Reply With Quote