Quote:
Originally Posted by capnm
Option 1:
You aim to just flag commercially published epubs (where this all started).
So you only look at the css files that have @page or body set in the css with margins (where you are right now).
This will skip all Calibre generated and many bespoke epubs.
It *might* produce unexpected/unwanted results on epubs with multiple @page declarations or multiple css files. (Pretty darn rare).
Option 2:
You want to take on modifying other epubs too.
Option 3:
Some sensible solution I've overlooked.
I'm in favor of option 1, leaving Calibre (re)generation to Calibre.
Of course, if you choose option 1, what happens if you zero the margins completely, then change your mind, and want 5pt margins?
Maybe inject @page even for zero margins?
Then the epub would still meet the search criteria of having body or @page margins set in the css ...
Clear as mud? 
|
I'm thinking something along the lines of option 1+3. I added the logic that ePubs without any body or @page margins flagged true in Quality Check and that wound up flagging 99% of my ePubs - I didn't particularly like that... I'm thinking to make a separate check for no @page margins in the css. That way the first check will generally only flag retail ePubs using either body or @page, and the second check will flag Calibre/bespoke/zeroed ePubs.
The search did highlight a fourth class of ePubs though - ones which have no css file whatsoever - around 1% of my ePubs. I haven't dug inside but I assume the stylesheet is inside the flow.
I don't want to get crazy with the xhtml modifications - it would be very simple to delete @page styles from each xhtml file. I think that would fix the issue kiwidude ran into with 1em specified there. It looks like that wouldn't provide ideal control to Calibre conversions though, looking at my old Calibre conversions it looks like it puts the default 5pt margins in both @page in the style tag and in the class Calibre assigns to body. I have no motivation to look up tags and class names in the html and correlate them to the css.