01: <?PHP
02:
03: $content = '<style>
04: table { border-collapse:collapse; border-spacing:0; }
05: table#css { border:0 none;padding:0;margin:1mm 0 0;width:200mm; }
06: table#css td { text-align:center; margin:0;padding:1mm;border:0.4mm solid #000; }
07: table#css td.R { width:21mm; }
08: table#css td.D { width:74mm; }
09: table#css td.Q { width:16mm; }
10: table#css td.P { width:21mm; }
11: table#css td.M { width:26mm; }
12: table#css td.T { width:11mm; }
13: table#borders { border:0 none;padding:0;margin:1mm 0 0;width:200mm; }
14: table#borders td { text-align:center; margin:0; width:100mm; padding:25mm; border:25mm solid #000; }
15: /* 0.5 + */
16: </style>
17: <page backtop="0" backbottom="0" backleft="0" backright="0" format="A4">
18:
19: <p>100mm, 25mm et 10mm</p>
20: <div style="width:100mm;background:#800000;height:0.5mm;margin:0.1mm 0 0 0mm;"></div>
21: <div style="width:25mm;background:#800000;height:0.5mm;margin:0.1mm 0 0 0mm;"></div>
22: <div style="width:10mm;background:#800000;height:0.5mm;margin:0.1mm 0 0 0mm;"></div>
23:
24:
25: <div style="margin-top:100px;">width 100mm (border et padding � 0) => OK</div>
26:
27: <div style="width:100mm;background:#800000;height:0.5mm;margin:1mm 0 0 0;"></div>
28: <table border="0" cellspacing="0" cellpadding="0" style="border:0 none;padding:0;margin:0;width:200mm;">
29: <tr>
30: <td style="margin:0; width:100mm; padding:0 0;background:#EFEFEF;">
31: 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
32: </td>
33: </tr>
34: </table>
35:
36: <div style="margin-top:100px;">border-left 25mm + width 100mm + border-right 25mm => 200 au lieu de 150</div>
37:
38: <div style="width:25mm;background:#800000;height:0.5mm;margin:1mm 0 0 0mm;"></div>
39: <div style="width:100mm;background:#800000;height:0.5mm;margin:1mm 0 0 25mm;"></div>
40: <div style="width:25mm;background:#800000;height:0.5mm;margin:1mm 0 0 125mm;"></div>
41: <table border="0" cellspacing="0" cellpadding="0" style="border:0 none;padding:0;margin:0;width:200mm;">
42: <tr>
43: <td style="margin:0; width:100mm; padding:0 0; border:25mm solid #000; border-width:0.2mm 25mm;background:#EFEFEF;">
44: 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
45: </td>
46: </tr>
47: </table>
48:
49: <div style="margin-top:100px;">padding-left 25mm + width 100mm + padding-right 25mm => 200 au lieu de 150</div>
50:
51: <div style="width:25mm;background:#800000;height:0.5mm;margin:1mm 0 0 0mm;"></div>
52: <div style="width:100mm;background:#800000;height:0.5mm;margin:1mm 0 0 25mm;"></div>
53: <div style="width:25mm;background:#800000;height:0.5mm;margin:1mm 0 0 125mm;"></div>
54: <table border="0" cellspacing="0" cellpadding="0" style="border:0 none;padding:0;margin:0;width:200mm;">
55: <tr>
56: <td style="margin:0; width:100mm; padding:0 25mm; background:#EFEFEF;">
57: 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
58: </td>
59: </tr>
60: </table>
61:
62: <div style="margin-top:100px;">border 25mm + padding 25mm + width 100mm => d�passe les 200mm</div>
63:
64: <div style="width:25mm;background:#800000;height:0.5mm;margin:1mm 0 0 0mm;"></div>
65: <div style="width:25mm;background:#800000;height:0.5mm;margin:1mm 0 0 25mm;"></div>
66: <div style="width:100mm;background:#800000;height:0.5mm;margin:1mm 0 0 50mm;"></div>
67: <div style="width:25mm;background:#800000;height:0.5mm;margin:1mm 0 0 150mm;"></div>
68: <div style="width:25mm;background:#800000;height:0.5mm;margin:1mm 0 0 175mm;"></div>
69: <table border="0" cellspacing="0" cellpadding="0" style="border:0 none;padding:0;margin:0;width:200mm;">
70: <tr>
71: <td style="margin:0; width:100mm; padding:0 25mm; border:25mm solid #000; border-width:0.2mm 25mm; background:#EFEFEF;">
72: 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
73: </td>
74: </tr>
75: </table>
76:
77: </page>';
78:
79: require_once('./html2pdf/html2pdf.class.php');
80: $html2pdf = new HTML2PDF('P','A4','fr', false, 'ISO-8859-15',array(5, 5, 5, 5));
81: $html2pdf->pdf->SetDisplayMode('fullwidth', 'OneColumn');
82: //$html2pdf->setModeDebug();
83: $html2pdf->setDefaultFont('Arial');
84: $html2pdf->writeHTML($content, isset($_GET['vuehtml']));
85: $html2pdf->Output($filename, 'D');
86:
87: ?>