Bonjour,
J’utilise depuis peu Html2pdf. Jusqu'à présent, je rencontrais pas mal de problèmes.
Là, j'ai un problème ou j'obtiens l'erreur : Fatal error: Maximum execution time of 30 seconds exceeded in tcpdf.php.
Pourtant j'ai une table html simple à afficher et quand j'ai utilisé : $html2pdf->setModeDebug();, j'ai ça
step time delta memory peak
Init debug 0.2 ms 0.2 ms 12 540.3 Ko 16 044.1 Ko
PAGE 1 Begin 2 219.0 ms 2 218.9 ms 14 443.6 Ko 16 102.7 Ko
Table n1 Begin 2 318.2 ms 99.2 ms 14 574.4 Ko 16 102.7 Ko
Voilà mon code :
<?php
include(dirname(__FILE__).'/../fonctions.php');
connect();
$my_base=mysql_connect('localhost','root','');
mysql_set_charset('utf8', $my_base);
require_once(dirname(__FILE__).'/../html2pdf_v4.03/html2pdf.class.php');
$content_listes_cptes='<page>
<em>Listes des comptes </em>
<table>
<tr>
<th>Ncpte</th>
<th>Design</th>
<th>Chapitres</th>
</tr>';
$sql2='select Num_compte,intitule_compte,nature_compte,C.Id_chapitre,designation_chapitre from
Comptes C,Chapitres Ch where nature_compte="Charges" and Ch.Id_chapitre=C.Id_chapitre order by Num_compte ASC
';
$result2=mysql_query($sql2) or die ('Erreur SQL !'.$sql2.'<br />'.mysql_error());
$nbl = mysql_num_rows($result2);
while($data2=mysql_fetch_array($result2))
{
$num_cpte=$data2['Num_compte'] ;
$intitule=$data2['intitule_compte'] ;
$chapitre= $data2['designation_chapitre'] ;
$content_listes_cptes .='<tr>
<td>'.$num_cpte.'</td>
<td>'.$intitule.'</td>
<td > '.$chapitre.'</td>
</tr>';
}
$content_listes_cptes .='</table></page>';
$html2pdf = new HTML2PDF('P', 'A4', 'fr');
$html2pdf->setModeDebug();
$html2pdf->WriteHTML($content_listes_cptes);
$html2pdf->Output('etat_listes_comptes.pdf');
?>
D’où vient le probléme?
Merci de vos solutions .