mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
PDF Output: Make the minimum height for headers and footers scale with the base font size
This commit is contained in:
parent
8942e8e658
commit
bcd8bcdcb5
@ -1153,6 +1153,7 @@ OptionRecommendation(name='search_replace',
|
||||
specializer=partial(self.output_plugin.specialize_css_for_output,
|
||||
self.log, self.opts))
|
||||
flattener(self.oeb, self.opts)
|
||||
self.opts._final_base_font_size = fbase
|
||||
|
||||
self.opts.insert_blank_line = oibl
|
||||
self.opts.remove_paragraph_spacing = orps
|
||||
|
@ -192,12 +192,12 @@ class PDFWriter(QObject):
|
||||
self.header = opts.pdf_header_template
|
||||
if self.header:
|
||||
self.header = self.header.strip()
|
||||
min_margin = 36
|
||||
min_margin = 1.5 * opts._final_base_font_size
|
||||
if self.footer and opts.margin_bottom < min_margin:
|
||||
self.log.warn('Bottom margin is too small for footer, increasing it.')
|
||||
self.log.warn('Bottom margin is too small for footer, increasing it to %.1fpts' % min_margin)
|
||||
opts.margin_bottom = min_margin
|
||||
if self.header and opts.margin_top < min_margin:
|
||||
self.log.warn('Top margin is too small for header, increasing it.')
|
||||
self.log.warn('Top margin is too small for header, increasing it to %.1fpts' % min_margin)
|
||||
opts.margin_top = min_margin
|
||||
|
||||
self.page.setViewportSize(QSize(self.doc.width(), self.doc.height()))
|
||||
|
Loading…
x
Reference in New Issue
Block a user