FPDF do not support UTF-8 => utf8_decode all data
authorx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Mon, 16 Apr 2007 21:02:29 +0000 (21:02 +0000)
committerx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Mon, 16 Apr 2007 21:02:29 +0000 (21:02 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1709 839d8a87-29fc-0310-9880-83ba4fa771e5

modules/carnet.php
modules/carnet/contacts.pdf.inc.php

index 1363f5c..24bdaaa 100644 (file)
@@ -261,6 +261,11 @@ class CarnetModule extends PLModule
 
         while (list($alias) = $citer->next()) {
             $user = get_user_details($alias);
+            foreach ($user as &$value) {
+                if (is_utf8($value)) {
+                    $value = utf8_decode($value);
+                }
+            }
             $pdf = ContactsPDF::addContact($pdf, $user, $arg0 == 'photos' || $arg1 == 'photos');
         }
         $pdf->Output();
index 65c1116..bfeb1ae 100644 (file)
@@ -90,8 +90,8 @@ class ContactsPDF extends FPDF
         $this->SetFont('Vera Sans', 'B', 20);
         $this->SetTextColor(230);
         $this->Rotate(45, 55, 190);
-        $this->Text(55, 190, "informations limitées à un usage");
-        $this->Text(40, 210, "strictement personnel et non commercial");
+        $this->Text(55, 190, utf8_decode("informations limitées à un usage"));
+        $this->Text(40, 210, utf8_decode("strictement personnel et non commercial"));
         $this->Rotate(0);
 
         $this->setLeftMargin(5);
@@ -317,6 +317,11 @@ class ContactsPDF extends FPDF
 
         foreach ($x['adr'] as $a) {
             $self->Space();
+            foreach ($a as &$value) {
+                if (is_utf8($value)) {
+                    $value = utf8_decode($value);
+                }
+            }
             $self->Address($a);
         }
 
@@ -327,6 +332,11 @@ class ContactsPDF extends FPDF
                 {
                     continue;
                 }
+                foreach ($a as &$value) {
+                    if (is_utf8($value)) {
+                        $value = utf8_decode($value);
+                    }
+                }
                 $self->Space();
                 $self->AddressPro($a);
             }