From 1a60f979c7b897b53d2b8ba827bdeff742d6441f Mon Sep 17 00:00:00 2001 From: sbkolate Date: Sat, 5 Mar 2016 19:09:33 +0530 Subject: [PATCH 1/2] Fix table header background color in pdf view wkhtmltopdf removes div/th background color reference: http://stackoverflow.com/questions/25118343/wkhtmltopdf-div-background-color background-color: #eee !important; //will fix the problem in Modern Print Pdf View Check this url Table Header border is comming in print priview https://demo.erpnext.com/api/method/frappe.templates.pages.print.download_pdf?doctype=Sales%20Invoice&name=%5BSelect%5D00024&format=Standard&no_letterhead=0 but Table Header background color is removed in pdf https://demo.erpnext.com/print?doctype=Sales%20Invoice&name=%5BSelect%5D00024&format=Standard&no_letterhead=0 --- frappe/templates/styles/modern.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/templates/styles/modern.css b/frappe/templates/styles/modern.css index b2c0381f41..5e65b7c0e3 100644 --- a/frappe/templates/styles/modern.css +++ b/frappe/templates/styles/modern.css @@ -13,5 +13,5 @@ } .print-format th { - background-color: #eee; + background-color: #eee !important; } From 5c88e19576c6ab0c961f5d0c30b6aa028834fa90 Mon Sep 17 00:00:00 2001 From: sbkolate Date: Sat, 5 Mar 2016 19:44:38 +0530 Subject: [PATCH 2/2] Update test_print_format.py --- frappe/print/doctype/print_format/test_print_format.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/print/doctype/print_format/test_print_format.py b/frappe/print/doctype/print_format/test_print_format.py index aa8c79200d..2ce113543c 100644 --- a/frappe/print/doctype/print_format/test_print_format.py +++ b/frappe/print/doctype/print_format/test_print_format.py @@ -23,7 +23,7 @@ class TestPrintFormat(unittest.TestCase): def test_print_user_modern(self): print_html = self.test_print_user("Modern") - self.assertTrue(re.findall('th {[\s]*background-color: #eee;[\s]*}', print_html)) + self.assertTrue(re.findall('th {[\s]*background-color: #eee !important;[\s]*}', print_html)) def test_print_user_classic(self): print_html = self.test_print_user("Classic")