1

I have installed html2pdf, and it is working great. Super program.

I just have one problem: right aligment in tables. The first rows work fine, but then on the third or fourth, there seems to be a space extra inserted on the right hand side. The more rows I have, the more rows with problems.

Here's a code example I'm using (the problem starts on row four here). Any help would be grealy appreciated.

ob_start();
?>
<html>
<head></head>
<body>
<table>

<tr>
<td>
One
</td>
<td>
Two
</td>
<td>
Three
</td>
<td style="text-align:right;">
3453.1
</td>
</tr>

<tr>
<td>
One
</td>
<td>
Two
</td>
<td>
Three
</td>
<td style="text-align:right;">
12
</td>
</tr>

<tr>
<td>
One
</td>
<td>
Two
</td>
<td>
Three
</td>
<td style="text-align:right;">
0.00
</td>
</tr>

<tr>
<td>
One
</td>
<td>
Two
</td>
<td>
Three
</td>
<td style="text-align:right;">
23.46
</td>
</tr>

</table>
</body>
</html>

<?
$html= ob_get_contents();
ob_end_clean();

//converts html to PDF
require_once('html2pdf_v4.00/html2pdf.class.php');
$html2pdf = new HTML2PDF('P','A4', 'en');
$html2pdf->pdf->SetDisplayMode('fullpage');
$html2pdf->WriteHTML($html,isset($_GET['vuehtml']));
$html2pdf->Output("PDF.pdf",'I');

2

aoups... an error sad
for HTML2PDF v3.29
and v4.00, on parsingHTML.class.php, method parse, line 180
replace
if ($k<count($todos)-1 && in_array($todos[$k+1]['name'], $balises_clean))
by
if ($k<$nb-1 && in_array($todos[$k+1]['name'], $balises_clean))

Ancien pseudo : lolo

3

Wow! That was quick. Thanks a lot; the alignments work perfectly now.