File: test.php - Tab length: 1 2 4 8 - Lines: on off - No wrap: on off

<?PHP

$content = '<style>
table { border-collapse:collapse; border-spacing:0; }
table#css { border:0 none;padding:0;margin:1mm 0 0;width:200mm; }
table#css td { text-align:center; margin:0;padding:1mm;border:0.4mm solid #000; }
table#css td.R { width:21mm; }
table#css td.D { width:74mm; }
table#css td.Q { width:16mm; }
table#css td.P { width:21mm; }
table#css td.M { width:26mm; }
table#css td.T { width:11mm; }
table#borders { border:0 none;padding:0;margin:1mm 0 0;width:200mm; }
table#borders td { text-align:center; margin:0; width:100mm; padding:25mm; border:25mm solid #000; }
/* 0.5 +  */
</style>
<page backtop="0" backbottom="0" backleft="0" backright="0" format="A4">
   
    <p>100mm, 25mm et 10mm</p>
    <div style="width:100mm;background:#800000;height:0.5mm;margin:0.1mm 0 0 0mm;"></div>
    <div style="width:25mm;background:#800000;height:0.5mm;margin:0.1mm 0 0 0mm;"></div>
    <div style="width:10mm;background:#800000;height:0.5mm;margin:0.1mm 0 0 0mm;"></div>
   
   
    <div style="margin-top:100px;">width 100mm (border et padding � 0) => OK</div>
   
    <div style="width:100mm;background:#800000;height:0.5mm;margin:1mm 0 0 0;"></div>
    <table border="0" cellspacing="0" cellpadding="0" style="border:0 none;padding:0;margin:0;width:200mm;">
        <tr>
            <td style="margin:0; width:100mm; padding:0 0;background:#EFEFEF;">
                x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x
            </td>
        </tr>
    </table>
   
    <div style="margin-top:100px;">border-left 25mm + width 100mm + border-right 25mm => 200 au lieu de 150</div>
   
    <div style="width:25mm;background:#800000;height:0.5mm;margin:1mm 0 0 0mm;"></div>
    <div style="width:100mm;background:#800000;height:0.5mm;margin:1mm 0 0 25mm;"></div>
    <div style="width:25mm;background:#800000;height:0.5mm;margin:1mm 0 0 125mm;"></div>
    <table border="0" cellspacing="0" cellpadding="0" style="border:0 none;padding:0;margin:0;width:200mm;">
        <tr>
            <td style="margin:0; width:100mm; padding:0 0; border:25mm solid #000; border-width:0.2mm 25mm;background:#EFEFEF;">
                x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x
            </td>
        </tr>
    </table>
   
    <div style="margin-top:100px;">padding-left 25mm + width 100mm + padding-right 25mm => 200 au lieu de 150</div>
   
    <div style="width:25mm;background:#800000;height:0.5mm;margin:1mm 0 0 0mm;"></div>
    <div style="width:100mm;background:#800000;height:0.5mm;margin:1mm 0 0 25mm;"></div>
    <div style="width:25mm;background:#800000;height:0.5mm;margin:1mm 0 0 125mm;"></div>
    <table border="0" cellspacing="0" cellpadding="0" style="border:0 none;padding:0;margin:0;width:200mm;">
        <tr>
            <td style="margin:0; width:100mm; padding:0 25mm; background:#EFEFEF;">
                x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x
            </td>
        </tr>
    </table>
   
    <div style="margin-top:100px;">border 25mm + padding 25mm + width 100mm => d�passe les 200mm</div>
   
    <div style="width:25mm;background:#800000;height:0.5mm;margin:1mm 0 0 0mm;"></div>
    <div style="width:25mm;background:#800000;height:0.5mm;margin:1mm 0 0 25mm;"></div>
    <div style="width:100mm;background:#800000;height:0.5mm;margin:1mm 0 0 50mm;"></div>
    <div style="width:25mm;background:#800000;height:0.5mm;margin:1mm 0 0 150mm;"></div>
    <div style="width:25mm;background:#800000;height:0.5mm;margin:1mm 0 0 175mm;"></div>
    <table border="0" cellspacing="0" cellpadding="0" style="border:0 none;padding:0;margin:0;width:200mm;">
        <tr>
            <td style="margin:0; width:100mm; padding:0 25mm; border:25mm solid #000; border-width:0.2mm 25mm; background:#EFEFEF;">
                x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x
            </td>
        </tr>
    </table>
   
</page>'
;

    require_once('./html2pdf/html2pdf.class.php');
    $html2pdf = new HTML2PDF('P','A4','fr', false, 'ISO-8859-15',array(5, 5, 5, 5));
    $html2pdf->pdf->SetDisplayMode('fullwidth', 'OneColumn');
    //$html2pdf->setModeDebug();
    $html2pdf->setDefaultFont('Arial');
    $html2pdf->writeHTML($content, isset($_GET['vuehtml']));
    $html2pdf->Output($filename, 'D');

?>