1

Bonjour,

Tout d'abord, un énorme merci pour cette librairie qui facilite bien des choses !

Cependant, j'ai un petit souci concernant la hauteur de mes différents éléments.


En gros, j'initialise un document de 250mm par 357mm avec des marges de 10,10,10,10 de la manière suivante :

$html2pdf = new HTML2PDF('P',array(250,337),'fr', false, 'ISO-8859-15', array(10, 10, 10, 10));

Mon pdf est censé contenir un tableau sur la totalité de la page de 3 lignes 3 colonnes, j'indique donc la taille de mon tableau en 230mm par 317mm (j'ai soustrait les marges).

J'indique ensuite toutes les tailles en mm, de tous les éléments, TD, TABLE et même TR, je mets padding, margin, border à 0.
Tout est alors censé rentré exactement dans du 230*317.



<page backtop="0mm" backbottom="0mm" backleft="0mm" backright="0mm">
<table style="width: 230mm; height: 317mm; padding: 0; margin: 0; table-collapse: collapse; border: none;" cellspacing="0" cellpadding="0" border="0">
<tr style="padding:0; margin: 0; border: none;">
<td style="width: 10mm; height: 10mm; background-color: #000; padding: 0; margin: 0; border: none;">hg</td>
<td style="width: 210mm; height: 10mm; background-color: #CCC; padding: 0; margin: 0; border: none;">h</td>
<td style="width: 10mm; height: 10mm; background-color: #000000; padding: 0; margin: 0; border: none;">hd</td>
</tr>
<tr style="padding:0; margin: 0; border: none;">
<td style="width: 10mm; height: 297mm; background-color: #CCC; padding: 0 margin: 0; border: none;">mg</td>
<td style="width: 210mm; height: 297mm; padding: 0; margin: 0; border: none;">m</td>
<td style="width: 10mm; height: 297mm; background-color: #CCC; padding: 0; margin: 0; border: none;">md</td>
</tr>
<tr style="padding:0; margin: 0; border: none;">
<td style="width: 10mm; height: 10mm; background-color: #000; padding: 0; margin: 0; border: none;">bg</td>
<td style="width: 210mm; height: 10mm; background-color: #CCC; padding: 0; margin: 0; border: none;">b</td>
<td style="width: 10mm; height: 10mm; background-color: #000; padding: 0; margin: 0; border: none;">bd</td>
</tr>
</table>
</page>


En largeur, je n'ai aucune problème, tout rentre nickel.
En hauteur, par contre, j'ai 1mm de trop, et le document passe sur 2 pages.
Si je spécifie 9mm de hauteur pour ma ligne du bas, au lieu de 10mm, ca rentre nickel, mais donc mon tableau fait 316mm de haut, alors qu'il devrait rentré pil poil avec du 317mm..

Bizarre non? Il y a une explication à ce 1mm de haut qui pose problème?

Merci bcp du temps que vous accorderez à me répondre smile





2

Alors la, aucune idée. Apres impression, quelle est la hauteur du tableau en le mesurant ?
Ancien pseudo : lolo

3

316mm.

La terre ne s'arretera pas de tourner pour 1mm, je ferai avec smile