Bonjour ,
je veux convertir une table html en une image jpeg ou png
Merci pour votre aide
$nom_image = "test.jpg";
$image = imagecreatefromjpeg($nom_image);
$couleur = imagecolorallocate($image, 0, 0, 0);
imagestring($image, 14, 25, 145, $texte, $couleur);
<?php
header('Content-type: image/png');
$im = imagecreatetruecolor(600, 400);
$white = imagecolorallocate($im, 255, 255, 255);
$black = imagecolorallocate($im, 0, 0, 0);
imagefilledrectangle($im, 0, 0, 599, 399, $white);
$text = 'Php Ouate de phoque(none)';
$text1 = 'Php Ouate de phoque(<i></i>)';
$text2 = 'Php Ouate de phoque(<b></b>)';
$font = 'arial.ttf';
$font2 = 'ariali.ttf';
$font3 = 'arialbd.ttf';
imagettftext($im, 20, 0, 15, 25, $black, $font, $text);
imagettftext($im, 20, 0, 15, 65, $black, $font2, $text1);
imagettftext($im, 20, 0, 15, 105, $black, $font3, $text2);
imagepng($im);
imagedestroy($im);
?>
(Dans le cas présent, les fichier arial.ttf, ariali.ttf et arialbd.ttf doivent être dans le même dossier que ton script)Code : Tout sélectionner
<table height="413" style="background-image: url(http://mymariee.com/wp-content/uploads/2014/06/vip.jpg);background-repeat:no-repeat;" width="590">
<tbody>
<tr colspan="2">
<td height="90" width="600">
</td>
</tr>
<tr>
<td height="180" width="150">
</td>
<td height="180" width="450">
<center>
<p>
</p>
<p>
<a href="http://mymariee.com/blog/association-des-professionnels-du-mariage-p-m/12011008-just-married-sign-bling-bling-2/" rel="attachment wp-att-3028"><img alt="association des professionnels du mariage" class="alignleft size-thumbnail wp-image-3028" src="http://mymariee.com/wp-content/uploads/2014/04/12011008-just-married-sign-bling-bling-150x193.jpg" /></a>
</p>
<p>
</p>
<p>
</p>
</center>
</td>
</tr>
<tr>
<td height="143" width="180">
<span style="font-size:36px;"><span style="font-family:georgia,serif;"><span style="color:#F0FFF0;"> date de mariage</span></span></span>
</td>
<td height="143" style="text-align: center;" width="420">
<span style="font-size:36px;"><span style="color:#F0FFF0;"><span style="font-family:georgia,serif;">nom et prénom</span></span></span>
</td>
</tr>
</tbody>
</table>