From 0683a35d83e1d49edcb89d35c3bc9f673dd27891 Mon Sep 17 00:00:00 2001 From: Carsten Schmitz Date: Fri, 19 Apr 2013 22:48:46 +0200 Subject: [PATCH] Fixed issue #7712: Some problems with statistics in pdf format --- application/libraries/admin/pdf.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/application/libraries/admin/pdf.php b/application/libraries/admin/pdf.php index 27684bbf632..daa77ab69fc 100644 --- a/application/libraries/admin/pdf.php +++ b/application/libraries/admin/pdf.php @@ -448,7 +448,7 @@ function headTable($head, $table, $modulo=1 ) $maxwidth = $this->getFullWidth($array); $this->SetFillColor(220, 220, 220); - for($a=0;$aSetFont($this->FontFamily, 'B', $this->FontSizePt); if ($maxwidth[$b] > 140) $maxwidth[$b]=130; - if ($maxwidth[$b] < 20) $maxwidth[$b]=20; + if ($maxwidth[$b] < 25) $maxwidth[$b]=25; $this->MultiCell($maxwidth[$b],6,$this->delete_html($array[$a][$b]),0,'L',1,$bEndOfCell); $this->SetFont($this->FontFamily, $oldStyle, $this->FontSizePt); @@ -478,20 +478,22 @@ function headTable($head, $table, $modulo=1 ) { if ($a==1) { - $this->SetFillColor(250, 250, 250); + $this->SetFillColor(240, 240, 240); } //echo $maxwidth[$b]." max $b.Spalte
"; if ($maxwidth[$b] > 140) $maxwidth[$b]=130; if ($b==0) { - $iLines=$this->MultiCell($maxwidth[$b],6,$this->delete_html($array[$a][$b]),0,'L',$fill,$bEndOfCell); + $iHeight=$this->getStringHeight($maxwidth[$b],$this->delete_html($array[$a][$b])); + $this->MultiCell($maxwidth[$b],$iHeight,$this->delete_html($array[$a][$b]),0,'L',$fill,$bEndOfCell); } else { - $this->MultiCell($maxwidth[$b],$iLines,$this->delete_html($array[$a][$b]),0,'L',$fill,$bEndOfCell); + $iLines=$this->getStringHeight($maxwidth[$b],$this->delete_html($array[$a][$b])); + if ($iLines>$iHeight) $iHeight=$iLines; + $this->MultiCell($maxwidth[$b],$iHeight,$this->delete_html($array[$a][$b]),0,'L',$fill,$bEndOfCell); } - } } } @@ -603,7 +605,8 @@ function write_out($name) function delete_html($text) { - $text = html_entity_decode($text); + $text = html_entity_decode($text,null,'UTF-8'); + $text = str_replace("\t",' ',$text); return strip_tags($text); } } \ No newline at end of file