From b9f659ef7481407860df57f19d379fcad0239ecb Mon Sep 17 00:00:00 2001 From: Akash Tom Date: Wed, 18 Feb 2026 15:08:39 +0530 Subject: [PATCH] fix: apply margin for header and footer for ids header-html and footer-html --- frappe/utils/pdf.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frappe/utils/pdf.py b/frappe/utils/pdf.py index e93349f4db..9dad6463e6 100644 --- a/frappe/utils/pdf.py +++ b/frappe/utils/pdf.py @@ -369,6 +369,12 @@ def prepare_header_footer(soup: BeautifulSoup): # {"header-html": "/tmp/frappe-pdf-random.html"} options[html_id] = fname + + if html_id == "header-html": + options["margin-top"] = "25mm" + elif html_id == "footer-html": + options["margin-bottom"] = "25mm" + else: if html_id == "header-html": options["margin-top"] = "15mm"