From 6084a669f2807b8fc8deab7f6480785adf959ec3 Mon Sep 17 00:00:00 2001 From: andrewpthompson Date: Mon, 20 Aug 2018 10:52:34 +0930 Subject: [PATCH 1/3] Fix long address lines overflowing label generateLabel() - Width did not take into account paddingLeft --- CRM/Utils/PDF/Label.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Utils/PDF/Label.php b/CRM/Utils/PDF/Label.php index 0f6a613feb8..b05b42d0645 100644 --- a/CRM/Utils/PDF/Label.php +++ b/CRM/Utils/PDF/Label.php @@ -185,7 +185,7 @@ public function LabelSetFormat(&$format, $unit) { */ public function generateLabel($text) { $args = array( - 'w' => $this->width, + 'w' => $this->width - 2 * $this->paddingLeft, 'h' => 0, 'txt' => $text, 'border' => 0, From 86462e6e42fd399e1b461c57c3a8697f8f5f47e7 Mon Sep 17 00:00:00 2001 From: andrewpthompson Date: Wed, 22 Aug 2018 10:24:49 +0930 Subject: [PATCH 2/3] Added comment explaining paddingLeft --- CRM/Utils/PDF/Label.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CRM/Utils/PDF/Label.php b/CRM/Utils/PDF/Label.php index b05b42d0645..c481ea200bb 100644 --- a/CRM/Utils/PDF/Label.php +++ b/CRM/Utils/PDF/Label.php @@ -184,6 +184,8 @@ public function LabelSetFormat(&$format, $unit) { * @param string $text */ public function generateLabel($text) { + // paddingLeft is used for both left & right padding so needs to be + // subtracted twice from width to get the width that is available for text $args = array( 'w' => $this->width - 2 * $this->paddingLeft, 'h' => 0, From d5d5c66ec9f5f98a403d8f1fa88d908d45cb505c Mon Sep 17 00:00:00 2001 From: andrewpthompson Date: Wed, 22 Aug 2018 10:27:09 +0930 Subject: [PATCH 3/3] Fixed whitespace --- CRM/Utils/PDF/Label.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Utils/PDF/Label.php b/CRM/Utils/PDF/Label.php index c481ea200bb..97d765de033 100644 --- a/CRM/Utils/PDF/Label.php +++ b/CRM/Utils/PDF/Label.php @@ -184,7 +184,7 @@ public function LabelSetFormat(&$format, $unit) { * @param string $text */ public function generateLabel($text) { - // paddingLeft is used for both left & right padding so needs to be + // paddingLeft is used for both left & right padding so needs to be // subtracted twice from width to get the width that is available for text $args = array( 'w' => $this->width - 2 * $this->paddingLeft,