From c4ab2de7fda907b7accf1604adf9a441c7966424 Mon Sep 17 00:00:00 2001 From: maxtorete Date: Sat, 23 Sep 2017 03:23:59 +0200 Subject: [PATCH] Fixed problem with margin top and bottom overwritten in print format (#3451) --- frappe/utils/pdf.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/frappe/utils/pdf.py b/frappe/utils/pdf.py index 332eaa738d..6fa7cd7231 100644 --- a/frappe/utils/pdf.py +++ b/frappe/utils/pdf.py @@ -65,6 +65,8 @@ def prepare_options(html, options): # defaults 'margin-right': '15mm', 'margin-left': '15mm', + 'margin-top': '15mm', + 'margin-bottom': '15mm', }) html, html_options = read_options_from_html(html) @@ -134,13 +136,6 @@ def prepare_header_footer(soup): # {"header-html": "/tmp/frappe-pdf-random.html"} options[html_id] = fname - else: - if html_id == "header-html": - options["margin-top"] = "15mm" - - elif html_id == "footer-html": - options["margin-bottom"] = "15mm" - return options def cleanup(fname, options):