j'ai réalisé une facture contient n ligne mais lorsque j'ouvre le facture en pdf le tcpdf gener bcp des erreur :


Notice: Undefined index: thead in C:\wamp\www\gestion ouvrage\tcpdf\tcpdf.php on line 20898

Notice: Undefined index: cols in C:\wamp\www\gestion ouvrage\tcpdf\tcpdf.php on line 22394

Notice: Undefined index: cols in C:\wamp\www\gestion ouvrage\tcpdf\tcpdf.php on line 22396

Warning: Division by zero in C:\wamp\www\gestion ouvrage\tcpdf\tcpdf.php on line 22396

Notice: Undefined index: cols in C:\wamp\www\gestion ouvrage\tcpdf\tcpdf.php on line 22398

Warning: array_fill() [function.array-fill]: Number of elements must be positive in C:\wamp\www\gestion ouvrage\tcpdf\tcpdf.php on line 22398

Notice: Undefined offset: 2 in C:\wamp\www\gestion ouvrage\tcpdf\tcpdf.php on line 22528

Notice: Undefined offset: 2 in C:\wamp\www\gestion ouvrage\tcpdf\tcpdf.php on line 22528

Notice: Undefined offset: 2 in C:\wamp\www\gestion ouvrage\tcpdf\tcpdf.php on line 22528

Notice: Undefined index: old_cell_padding in C:\wamp\www\gestion ouvrage\tcpdf\tcpdf.php on line 24025

Notice: Undefined index: R in C:\wamp\www\gestion ouvrage\tcpdf\tcpdf.php on line 3497
je ne sais le problème au quel niveau


et voila mon code de générer le fichier pdf

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<?php
require_once('../tcpdf/config/lang/eng.php');
require_once('../tcpdf/tcpdf.php');
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Amine');
$pdf->SetTitle('TCPDF Example');
$pdf->SetSubject('EXEMPLE D\'UTILISATION');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
 
//set default header data
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' ', PDF_HEADER_STRING);
 
// set header and footer fonts
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
 
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
 
//set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
 
//set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
 
//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
// set some language dependent data:
$lg = Array();
$lg['a_meta_charset'] = 'UTF-8';
$lg['a_meta_dir'] = 'rtl';
$lg['a_meta_language'] = 'fa';
$lg['w_page'] = 'page';
 
//set some language-dependent strings
$pdf->setLanguageArray($lg);
// set font
$pdf->SetFont('aealarabiya', '', 13);
 
// add a page
$pdf->AddPage();
// récupérer la valeur de la variable nom du formulaire.
$imp = $_GET['imp'];
require"../core.php";
$result_ligne = mysql_query("SELECT * FROM facture WHERE id ='$imp' ");
$row_ligne = mysql_fetch_array($result_ligne);
$date = $row_ligne['date_facture'];
$type_operation =$row_ligne['type_operation'];
$client =$row_ligne['benficiaire'];
$adresse = $row_ligne['adresse'];
$total = $row_ligne['total'];
 
 
$result = mysql_query("SELECT * FROM ligne_facture WHERE facture_id ='$imp' ");
$chaine = "";
	while($row = mysql_fetch_array($result)) {
		$titre= $row['titre_id'];	
		$qte_titre =$row['qte_titre'];
		$prix_unitaire_titre =$row['prix_unitaire_titre'];
		$prix_total_titre =$row['prix_total_titre'];
 
		$sql_titre = mysql_query("select * from titre where id ='$titre' " );
		$row_titre = mysql_fetch_array($sql_titre);
		$nom_ouvrage = $row_titre['titre_ouvrage'];
 
 
		$chaine = $chaine.'
        <tr>
          <th>'.$nom_ouvrage.'</th>
          <th >'.$qte_titre.'</th>
          <th >'.$prix_unitaire_titre.'</th>
          <th >'.$prix_total_titre.'</th>
        </tr>
        ';
 
	}
 
 
$html = '<p></p>
    <p></p>
<table width="80%" height="542" border="0" align="center" cellpadding="2" cellspacing="0">
  <tr>
    <td>table width="95%" border="0" align="center" cellpadding="2" cellspacing="0" dir="rtl">
 
      <tr><td width="19%" align="right"><strong>&#1601;&#1575;&#1578;&#1608;&#1585;&#1577; &#1585;&#1602;&#1605;</strong></td>
	    <td width="30%">'.$imp.'</td>
        <td height="13" align="center">'.$client.'</td>
 
 
      </tr>
      <tr>
        <td height="13" align="right"><strong>&#1575;&#1604;&#1589;&#1575;&#1583;&#1585;&#1577; &#1601;&#1610;</strong></td>
		<td width="30%" height="13">'.$date.'</td>
		<td height="13" align="center">'.$adresse.'</td>
        </tr>
      <tr>
	  <td height="28" align="right"><strong>&#1606;&#1608;&#1593; &#1575;&#1604;&#1593;&#1605;&#1604;&#1610;&#1577;</strong></td>
        <td height="28">'.$type_operation.'</td>
		<td height="28" align="center">&nbsp;</td>
 
      </tr>
    </table>
      <p>&nbsp;</p>
      <table width="95%" border="1" align="center" bordercolor="#000000" cellpadding="0" cellspacing="0">
      <thead>
        <tr>
          <th bgcolor="#999999" scope="col"><strong>&#1575;&#1604;&#1579;&#1605;&#1606; &#1575;&#1604;&#1580;&#1605;&#1604;&#1610;</strong></th>
          <th bgcolor="#999999" scope="col"><strong>&#1575;&#1604;&#1579;&#1605;&#1606; &#1575;&#1604;&#1601;&#1585;&#1583;&#1610;</strong></th>
          <th bgcolor="#999999" scope="col"><strong>&#1575;&#1604;&#1603;&#1605;&#1610;&#1577;</strong></th>
          <th bgcolor="#999999" scope="col"><strong>&#1575;&#1604;&#1593;&#1606;&#1608;&#1575;&#1606;</strong></th>
        </tr>
        </thead>
        <tbody>
        <tr>
          <th scope="col">&nbsp;</th>
          <th scope="col">&nbsp;</th>
          <th scope="col">&nbsp;</th>
          <th scope="col">&nbsp;</th>
        </tr>
        </tbody>
      </table>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <table width="95%" border="0" align="center" cellpadding="2">
        <tr>
          <td width="78%" align="right">&nbsp;</td>
          <td width="22%" align="right" bgcolor="#999999"><strong>&#1575;&#1604;&#1605;&#1576;&#1604;&#1594; &#1575;&#1604;&#1580;&#1605;&#1604;&#1610; &#1604;&#1604;&#1601;&#1575;&#1578;&#1608;&#1585;&#1577;</strong></td>
        </tr>
      </table>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <table width="95%" border="0" align="center" cellpadding="2" cellspacing="0">
        <tr>
          <td colspan="3"><hr /></td>
        </tr>
        <tr>
          <td width="37%" align="left"><span dir="ltr">(216) 71 848 300 &#1575;&#1604;&#1607;&#1575;&#1578;&#1601; </span><br />
            <span dir="ltr">(216) 71 788 194 &#1575;&#1604;&#1601;&#1575;&#1603;&#1587;<br />
          <a href="http://info@ena.nat.tn">info</a></span><a href="http://info@ena.nat.tn">@ena.nat.tn</a></td>
          <td width="38%" align="right">&nbsp;</td>
          <td width="25%" align="right"><pre>&#1575;&#1604;&#1605;&#1583;&#1585;&#1587;&#1577; &#1575;&#1604;&#1608;&#1591;&#1606;&#1610;&#1577; &#1604;&#1604;&#1573;&#1583;&#1575;&#1585;&#1577;
24 &#1548; &#1588;&#1575;&#1585;&#1593; &#1575;&#1604;&#1583;&#1603;&#1578;&#1608;&#1585; &#1603;&#1604;&#1605;&#1575;&#1578; 
 
</pre></td>
        </tr>
      </table>
    <p>&nbsp;</p></td>
  </tr>
</table>
';
 
// output the HTML content
$pdf->writeHTML($html, true, 0, true, 0);
// ---------------------------------------------------------
 
//Close and output PDF document
$pdf->Output('example.pdf', 'I');
 
//============================================================+
// END OF FILE
//==============================================
?>