Bonjour tout le monde,
Je débute avec HTML2PDF.
Après 2 heures de recherche, je n'arrive toujours pas à générer mon PDF.
Mon code est très basique et il me génère des caractère bizarre :
%PDF-1.7 3 0 obj <> /Resources 2 0 R /Contents 4 0 R>> endobj 4 0 obj <> stream xœ3Ð35W(W0RðR0PÈRˆŽR)@ì®`¨g`` Îå¢ ïf¨`hä+„¤)¸†p§ $RN„îBˆbd²(]h(Ѐ"°Ð׈¡‰ž¡¹‚…¡…ž…‘BHŠB´FAN~f¬BˆHE 6§Àìáâ*Ä&Hž¹z¯Eî endstream endobj 1 0 obj <> endobj 5 0 obj << /Type /OCG /Name (þÿprint) /Usage << /Print <> /View <> >> >> endobj 6 0 obj << /Type /OCG /Name (þÿview) /Usage << /Print <> /View <> >> >> endobj 7 0 obj <> endobj 2 0 obj << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI] /Font << /F1 7 0 R >> /XObject << >> /Properties <> /ExtGState << >> >> endobj 8 0 obj << /Creator (þÿHTML2PDF - TCPDF) /Producer (þÿTCPDF 5.0.002 \(http://www.tcpdf.org\) \(TCPDF\)) /CreationDate (D:20110629170104+02'00') /ModDate (D:20110629170104+02'00') >> endobj 9 0 obj << /Type /Catalog /Pages 1 0 R /OpenAction [3 0 R /FitH null] /PageLayout /SinglePage /PageMode /UseNone /Names << >> /ViewerPreferences << /Direction /L2R >> /OCProperties <> <>]>>>> >> endobj xref 0 10 0000000000 65535 f 0000000377 00000 n 0000000779 00000 n 0000000009 00000 n 0000000175 00000 n 0000000437 00000 n 0000000556 00000 n 0000000673 00000 n 0000000938 00000 n 0000001187 00000 n trailer << /Size 10 /Root 9 0 R /Info 8 0 R >> startxref 1552 %%EOF
Et voici mon code basique :
<?php
$content = "<page>
plop
</page>";
require_once(dirname(__FILE__) . '/html2pdf/html2pdf.class.php');
$html2pdf = new HTML2PDF('P', 'A4', 'fr');
$html2pdf->WriteHTML($content);
$html2pdf->Output('');
?>
Merci de votre aide !