From 19349fa2e102443d4ed926f6e7e54a31ebe2a455 Mon Sep 17 00:00:00 2001 From: Peter Rotich <peter@osticket.com> Date: Mon, 3 Sep 2012 10:13:10 -0400 Subject: [PATCH] Encode text to UTF8 Change the with of the info table --- include/class.pdf.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/include/class.pdf.php b/include/class.pdf.php index 2257dcc17..17c2e0588 100644 --- a/include/class.pdf.php +++ b/include/class.pdf.php @@ -82,12 +82,24 @@ class Ticket2PDF extends FPDF $this->Cell(0, 7, 'Page ' . ($this->PageNo() - $this->pageOffset), 0, 0, 'R'); } + function Cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='') { + parent::Cell($w, $h, $this->_utf8($txt), $border, $ln, $align, $fill, $link); + } + function WriteText($w, $text, $border) { $this->SetFont('Times','',11); $this->MultiCell($w, 5, $text, $border, 'L'); } + + function _utf8($text) { + + if(function_exists('iconv')) + return iconv('UTF-8', 'windows-1252', $text); + + return utf8_encode($text); + } function _print() { @@ -95,7 +107,7 @@ class Ticket2PDF extends FPDF return; $w =(($this->w/2)-$this->lMargin); - $l = 40; + $l = 35; $c = $w-$l; $this->SetDrawColor(220, 220, 220); $this->SetFillColor(244, 250, 255); -- GitLab