1

Bonjour Spipu,

Pardon mais je n'y arrive pas...
J'ai parcouru le forum en long en large et en travers et je n'ai rien trouvé de suffisament clair pour moi...
Autant le header ne me prend pas la tête, autant le footer me casse les pieds !
Il contient le visuel avec la maison et les mentions.

Peux-tu simplement m'indiquer ce que je ne fais pas bien.

Voici mon code :
<table style="width:750px" border="0" cellpadding="0" cellspacing="0">
<THEAD><tr align="center">
<td style="width:750px">
<img src="images/traitJaune.gif" width="50" height="45" alt=""><br><br>
<span class="TitreMarron">La Boutique</span><br>
<span class="TexteCourantMarron">www.luc-thienpont.com</span> </td>
</tr></THEAD>
<tr align="center">
<td valign="bottom" style="width:750px"><br>
<span class='gigaTitreJaune'>Bon de commande</span><br>
<span class="TitreMarron">N° <?php echo $ID_CMD;?> du <?php echo $date_tte_lettre;?></span><br>
<?php if ($NUM_COLISSIMO != "") {?>
<span class="petiTexteMarron">Expédiée sous le N° <?php echo $NUM_COLISSIMO;?></span><br>
<?php }?> </td>
</tr>
<tr>
<td style="width:750px; height:50px"> </td>
</tr>
</table>
<div style="width:750px"><?php echo $ligne_cde ;?></div>
<table style='width:750px' border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="width:750px; height:40px" align="left"> </td>
</tr>
<tr>
<td align="left" style="width:750px">
<table style="width:700px" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="bottom" scope="row" align="right" style="width:550px"><span class="SousTitreMarron">Montant total de votre commande :</span></td>
<td align="right" valign="bottom" style="width:150px"><span class="groTitreMarron"><?php echo $tarif_total;?> €</span></td>
</tr>
<tr>
<td valign="bottom" align="right" style="width:550px"><span class="SousTitreMarron">Montant des frais de transport :</span></td>
<td valign="bottom" align="right" style="width:150px"><span class="SousTitreMarron"><?php echo $prix_liv;?></span></td>
</tr>
<tr>
<td colspan="2" valign="bottom" align="right" style="width:700px"> </td>
</tr>
<tr>
<td valign="bottom" align="right" style="width:550px"><span class="SousTitreMarron">TOTAL À RÉGLER :</span></td>
<td valign="bottom" align="right" style="width:150px"> </td>
</tr>
<tr>
<td colspan="2" valign="bottom" align="right" style="width:700px; height:20px"> </td>
</tr>
</table> </td>
</tr>
<tfoot><tr>
<td align="center" style="width:750px"><img src="images/basdepage.jpg" width="730" height="155" alt=""><span class="petiTexteMarron">Capital Social 10 000 € - SIRET : 431 436 583 00014 - R.C.S. Bordeaux : B 431436583<br>
Banque CRCA 33460 Margaux n° 10749306000 - Accise n° FR002 346 E 0424 - TVA : FR58431436583</span></td>
</tr></tfoot>
</table>

<?php
$content = ob_get_clean();
require_once(dirname(__FILE__).'/html2pdf_v3.19/html2pdf.class.php');
$html2pdf = new HTML2PDF('P','A4','fr');
$html2pdf -> Addfont('Georgia','');
$html2pdf -> Addfont('Georgia','B','georgia_bold.php');
$html2pdf -> Addfont('Verdana','');
// $html2pdf->pdf->SetDisplayMode('fullpage');
$html2pdf->WriteHTML($content, isset($_GET['vuehtml']));
// $html2pdf->pdf->IncludeJS("print(true);");
$html2pdf->Output();
require 'parame/close_connect_LTH.php'; ?>

2

pour moi, le résultat PDF est normal. Tu cherchais à obtenir quoi ? qu'est-ce qui n'est pas comme tu l'aimerais ?
Ancien pseudo : lolo

3

je voudrai que le header et footer soient sur chaque pages et, concernant ce dernier, qu'il soit en bas de page et non pas immédiatement collé apres le total.

4

ah ok, ben dans ce cas là ce n'est pas des headers de footers de tableau qu'il faut utiliser (thead et tfoot) mais des headers et des footers de page (page_header et page_footer)

regarde l'exemple "about"

il faut toujours regarder les exemples tongue
Ancien pseudo : lolo

5

non vraiment je n'y arrive pas...
Je ne m'y retrouve pas dans l'exemple About.

La fatigue peut-être ou mon QI de gobi...

Faut-il créer un style page_header ?
Faut-il ajouter des lignes au niveau des déclarations concernant htlml2pdf ?
etc... etc ...

6

Ne prend même pas la peine de me répondre, je progresse et je vais bien finir par y arriver !
Excuses pour le dérangement et merci wink

r.E

7

Ancien pseudo : lolo

8

salut spipu !

Bon j'ai bien avancé ! Header et Footer sont placés, les marges sont définies, j'ai enfin conquis tout html2pdf ! Tout ? non, car un petit détail résiste, une sombre histoire de liste trop longue pour entrer sur une seule page. La fonction php qui appelle cette liste (ul) est placée dans une div (pour éviter le pb de TD trop long). Le pb est que cette div chevauche mon footer et que donc ça va pas...
Peux-tu me guider stp ?

SOURCE :
?>
<style type="text/css">
<!--

ul{
padding:0px;
margin:0 0 0 10px;
list-style:none;
}

li{
padding-bottom:20px;
display:block;
}

.TitreMarron {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 15px;
color: #604C3F;
font-weight: bold;
font-style: normal;
}

.groTitreMarron {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 20px;
color: #604C3F;
font-style: normal;
font-weight:bold
}

.TexteCourantMarron {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 12px;
color: #604C3F;
font-weight: normal;
}
.gigaTitreJaune {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 40px;
color: #FCC931;
font-style: normal;
font-weight: bold;
}

.groTitreJaune {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 12px;
color: #FCC931;
font-style: normal;
font-weight:bold
}

.SousTitreMarron {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 12px;
color: #604C3F;
font-style: normal;
font-weight:bold
}
.petiTexteMarron {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 9px;
color: #604C3F;
font-style: normal;
font-weight: normal;
}
.TexteBaseNoir{
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #666666;
font-style: normal;
font-weight: normal;
}
-->
</style>
<page>
<div style=" position:absolute; top:0px; width:750px; left:5px; height:auto">
<table style="width:750px" border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="width:750px" align="center">
<img src="images/traitJaune.gif" width="50" height="45" alt=""><br><br>
<span class="TitreMarron">La Boutique</span><br>
<span class="TexteCourantMarron">www.luc-thienpont.com</span> </td>
</tr>
<tr>
<td valign="bottom" style="width:750px" align="center"><br>
<span class='gigaTitreJaune'>Bon de commande</span><br>
<span class="TitreMarron">N° <?php echo $ID_CMD;?> du <?php echo $date_tte_lettre;?></span><br>
<?php if ($NUM_COLISSIMO != "") {?>
<span class="petiTexteMarron">Expédiée sous le N° <?php echo $NUM_COLISSIMO;?></span><br>
<?php }?> </td>
</tr>
<tr>
<td style="width:750px; height:50px"> </td>
</tr>
</table>
<table style='width:750px' border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left" style="width:750px"> </td>
</tr>
</table>
<page_footer>
<table style="width:700px" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td style="width:750px" align="center" valign="bottom"><img src="images/basdepage.jpg" width="750" height="159" alt="" /><br />
<span class="petiTexteMarron">Capital Social 10 000 € - SIRET : 431 436 583 00014 - R.C.S. Bordeaux : B 431436583<br />
Banque CRCA 33460 Margaux n° 10749306000 - Accise n° FR002 346 E 0424 - TVA : FR58431436583</span><br />
<span class="SousTitreMarron">page [[page_cu]]/{nb}</span>
</td>
</tr>
</table>
</page_footer>

<div style="width:750px; position:absolute; top:0px; left:-20px">
<div style="position:absolute; width:750px; margin-top:212px; height: 310px;">
<?php echo $ligne_cde ;?><br />

<table style="width:700px" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="bottom" scope="row" align="right" style="width:550px"><span class="SousTitreMarron">Montant total de votre commande :</span></td>
<td align="right" valign="bottom" style="width:150px"><span class="groTitreMarron"><?php echo $tarif_total;?> €</span></td>
</tr>
<tr>
<td valign="bottom" align="right" style="width:550px"><span class="SousTitreMarron">Montant des frais de transport :</span></td>
<td valign="bottom" align="right" style="width:150px"><span class="SousTitreMarron"><?php echo $prix_liv;?></span></td>
</tr>
<tr>
<td colspan="2" valign="bottom" align="right" style="width:700px; height:15px"> </td>
</tr>
<tr>
<td align="right" style="width:550px" valign="bottom"><span class="SousTitreMarron">TOTAL À RÉGLER :</span></td>
<td align="right" style="width:150px"> </td>
</tr>
<tr>
<td colspan="2" valign="bottom" align="right" style="width:700px; height:20px"> </td>
</tr>
</table>
</div>
</div>
</div>
</page>


<?php
$content = ob_get_clean();
require_once(dirname(__FILE__).'/html2pdf_v3.20/html2pdf.class.php');
$html2pdf = new HTML2PDF('P','A4','fr', array(5,5,15,15));
$html2pdf -> Addfont('Georgia','');
$html2pdf -> Addfont('Georgia','B','georgia_bold.php');
$html2pdf -> Addfont('Verdana','');
$html2pdf->pdf->SetDisplayMode('fullpage');
$html2pdf->WriteHTML($content, isset($_GET['vuehtml']));
//$html2pdf->setTestTdInOnePage(false);
//$html2pdf->pdf->$pdf->AddPage();
// $html2pdf->pdf->IncludeJS("print(true);");
$html2pdf->Output();
require 'parame/close_connect_LTH.php'; ?>


merci,

rE

9

je te conseille de lire le wiki a propos de la balise page :

http://wiki.spipu.net/doku.php?id=html2pdf:fr:page

http://wiki.spipu.net/doku.php?id=html2pdf:fr:marges


tu dois imperativement mettre le page_footer en tout premier dans la balise page, et preciser egalement sa hauteur
Ancien pseudo : lolo

10

ça roule merci !