From d84626293c1f2e568831d98d5e75495272f7cea7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 6 Oct 2019 23:07:56 +0530 Subject: [PATCH] PDF Output: Fix a bug that prevented the first style property in the header or footer template from being applied --- src/calibre/ebooks/pdf/html_writer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/pdf/html_writer.py b/src/calibre/ebooks/pdf/html_writer.py index 8d16d0addb..dc9d7bcf27 100644 --- a/src/calibre/ebooks/pdf/html_writer.py +++ b/src/calibre/ebooks/pdf/html_writer.py @@ -921,7 +921,7 @@ def add_header_footer(manager, opts, pdf_doc, container, page_number_display_map root = container.parsed(name) body = last_tag(root) body.attrib.pop('id', None) - body.set('style', 'margin: 0; padding: 0; border-width: 0; background-color: unset') + body.set('style', 'margin: 0; padding: 0; border-width: 0; background-color: unset;') job = job_for_name(container, name, Margins(0, 0, 0, 0), page_layout) def m(tag_name, text=None, style=None, **attrs): @@ -1006,7 +1006,7 @@ def add_header_footer(manager, opts, pdf_doc, container, page_number_display_map style = ans.get('style') or '' style = ( 'margin: 0; padding: 0; height: {height}pt; border-width: 0;' - 'display: flex; align-items: center; overflow: hidden; background-color: unset').format(height=height) + style + 'display: flex; align-items: center; overflow: hidden; background-color: unset;').format(height=height) + style ans.set('style', style) for child in ans.xpath('descendant-or-self::*[@class]'): cls = frozenset(child.get('class').split())