For removing adobe margins there is a class that does this, RemoveAdobeMargins(object) in calibre.ebooks.oeb.transforms.page_margin. Kovid added this a few weeks back as Dwanthny mentioned. It requires an oeb object though, which isn't something the current plugin is really creating when it extracts an epub.
An epub specific plugin which extracts to OEB and does all these epub specific checks/transformations might make more sense, and would be simpler to integrate into Calibre later, and it fits in pretty well with the existing Tweak Epub option which is just begging to be expanded.
|