Bonjour a tous,
Je tente en ce moment de convertir un page html/php en pdf
J'utilise donc html2pdf qui est un outils qui répondrai exactement a mes attentes.
Héla hélas celui ne fait que des bêtise
Pourtant le code de ma page est le plus simple possible afin d'avoir un résultat impeccable même avec ces précautions la page s'affiche mal : s
Donc rien de bien complexe dans le code et le résultat en HTML est parfait
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153 <?php ob_start(); ?> <page> <table width="760" height="1126" border=0 style="background:url(../../../images/bdc3.jpg);"> <tr> <td valign="top"> <table border=0 width=760 height=112> <tr> <td> </td> </tr> </table> <table border=0 width=760 height=20> <tr> <td width=590> </td> <td>bbbb </td> </tr> </table> <table border=0 width=760 height=30> <tr> <td> </td> </tr> </table> <table border=0 width=760 height=75> <tr> <td width=355> </td> <td>bbbbbbbb <br> bbbbb <br> bbbb <br> bbbb </td> </tr> </table> <table border=0 width=760 height=30> <tr v align="top"> <td width="220"> </td> <td>bbbbb </td> </tr> </table> <table border=0 width=760 height=55> <tr> <td> </td> </tr> </table> <table border=0 width=760 height=42> <tr> <td width=5> </td> <td>bbbbb </td> </tr> </table> <table border=0 width=760 height=30> <tr> <td width=195> </td> <td><span style="margin-left:25px;">bbbbbb</span> <br> bbbbbb </td> </tr> </table> <table border=0 width=760 height=70> <tr> <td> </td> </tr> </table> <TABLE border=0 height="350" width=760> <TR valign="top"> <TD width=80>bbbb</TD> <TD width=310>bbbbb</TD> <TD width=72>bbbbbb</TD> <TD width=82>bbbbbb</TD> <TD width=82>bbbbb</TD> </TR> </table> <table border=0 width=760 height=0> <tr> <td> </td> </tr> </table> <table border=0 width=760 height=0> <tr> <td width=660> </td> <td>bbbbbbbb </td> </tr> </table> <table border=0 width=760 height=40> <tr> <td> </td> </tr> </table> <table border=0 width=760 height=25> <tr> <td width="242">bbbbbb </td> <td width="245">bbbbbb </td> <td>bbbbbbb </td> </tr> </table> <table border=0 width=760 height=165> <tr> <td> </td> </tr> </table> </td> </tr> </table> </page> <?php $content = ob_get_clean(); require_once(dirname(__FILE__).'/../html2pdf.class.php'); $pdf = new HTML2PDF('P','A4'); $pdf->WriteHTML($content, isset($_GET['vuehtml'])); $pdf->Output(); ?>
petit screen :
La page hTML :
http://img53.imageshack.us/img53/2246/screenle4.jpg
Le resultat en PDF :
http://img57.imageshack.us/img57/7015/screen2pl1.jpg
Partager