From 9c32f06236bce36534abc2d64915652b6ed78cbc Mon Sep 17 00:00:00 2001 From: Anas-hameed Date: Wed, 13 Dec 2023 16:13:52 +0500 Subject: [PATCH 1/5] Anas/EDLY-6211 Improve image design in pdf report --- figures/helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/figures/helpers.py b/figures/helpers.py index 5c80b5da..d3f73cf4 100644 --- a/figures/helpers.py +++ b/figures/helpers.py @@ -396,7 +396,7 @@ def header(self): self.set_font('DejaVuSerif', size=14) self.cell(0, 18, '', 0, 0, 'C', True) self.ln(1) - self.image(name=logo_url, x=70, w=65, h=15) + self.image(name=logo_url, x=70, h=25) self.ln(5) def footer(self): From 007089d7ae54d4c76ba84c12d07fe3afed20ca82 Mon Sep 17 00:00:00 2001 From: Anas-hameed Date: Wed, 13 Dec 2023 17:00:18 +0500 Subject: [PATCH 2/5] update the height --- figures/helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/figures/helpers.py b/figures/helpers.py index d3f73cf4..b1f45600 100644 --- a/figures/helpers.py +++ b/figures/helpers.py @@ -396,7 +396,7 @@ def header(self): self.set_font('DejaVuSerif', size=14) self.cell(0, 18, '', 0, 0, 'C', True) self.ln(1) - self.image(name=logo_url, x=70, h=25) + self.image(name=logo_url, x=70, h=15) self.ln(5) def footer(self): From c462b8e9253f611dad374959ce324ee1f28a480e Mon Sep 17 00:00:00 2001 From: Anas-hameed Date: Wed, 13 Dec 2023 18:26:36 +0500 Subject: [PATCH 3/5] Fix: center align the image --- figures/helpers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/figures/helpers.py b/figures/helpers.py index b1f45600..4108f099 100644 --- a/figures/helpers.py +++ b/figures/helpers.py @@ -396,7 +396,8 @@ def header(self): self.set_font('DejaVuSerif', size=14) self.cell(0, 18, '', 0, 0, 'C', True) self.ln(1) - self.image(name=logo_url, x=70, h=15) + x = (self.w - self.get_string_width(logo_url)) / 2 + self.image(name=logo_url, x=x, h=15) self.ln(5) def footer(self): From 598c6db4c4380177f137972e7c6c0a8eea0fe835 Mon Sep 17 00:00:00 2001 From: Anas-hameed Date: Thu, 14 Dec 2023 10:32:40 +0500 Subject: [PATCH 4/5] Add logger --- figures/helpers.py | 1 + 1 file changed, 1 insertion(+) diff --git a/figures/helpers.py b/figures/helpers.py index 4108f099..61285fac 100644 --- a/figures/helpers.py +++ b/figures/helpers.py @@ -397,6 +397,7 @@ def header(self): self.cell(0, 18, '', 0, 0, 'C', True) self.ln(1) x = (self.w - self.get_string_width(logo_url)) / 2 + logger.info("X value is: ", x) self.image(name=logo_url, x=x, h=15) self.ln(5) From 31d085513366acb1c79d9494c89d2bdbbc5b3872 Mon Sep 17 00:00:00 2001 From: Anas-hameed Date: Fri, 15 Dec 2023 11:43:40 +0500 Subject: [PATCH 5/5] Add logger --- figures/helpers.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/figures/helpers.py b/figures/helpers.py index 61285fac..6dd26834 100644 --- a/figures/helpers.py +++ b/figures/helpers.py @@ -44,8 +44,8 @@ An important point is that we should not expect this module to be a permanent home for functionality. """ - from __future__ import absolute_import +import os import calendar import csv import datetime @@ -396,9 +396,7 @@ def header(self): self.set_font('DejaVuSerif', size=14) self.cell(0, 18, '', 0, 0, 'C', True) self.ln(1) - x = (self.w - self.get_string_width(logo_url)) / 2 - logger.info("X value is: ", x) - self.image(name=logo_url, x=x, h=15) + self.image(name=logo_url, x=110, h=15) self.ln(5) def footer(self):