[v4.03] (je ne peux pas modifier le titre...)
Bonjour,
Je ne connais pas du tout html2pdf et j'ai donc essayé d'installer celui-ci
Le code suivant me renvoit en http : TCPDF ERROR: Some data has already been output, can't send PDF file
<?php
$content = "
<page>
<h1>Exemple d'utilisation</h1>
<br>
Ceci est un <b>exemple d'utilisation</b>
de <a href='http://html2pdf.fr/'>HTML2PDF</a>.<br>
</page>";
require_once(dirname(__FILE__).'/html2pdf/html2pdf.class.php');
$html2pdf = new HTML2PDF('P','A4','fr');
$html2pdf->WriteHTML($content);
$html2pdf->Output('exemple.pdf');
?>
Et si je l'execute en php en shell j'obtiens :
PHP Notice: Undefined variable: kPathUrl in /var/www/html2pdf/_class/tcpdfConfig.php on line 80
%PDF-1.7
3 0 obj
<</Type /Page /Parent 1 0 R /MediaBox [0 0 595.28 841.89] /Group << /Type /Group /S /Transparency /CS /DeviceRGB >> /Resources 2 0 R
/Annots [ 200001 0 R ]
/Contents 4 0 R>> endobj
4 0 obj
<</Filter /FlateDecode /Length 269>> stream
?D??OO?0????M=???????
????^(&mf?????틻v?7????45L:B?(?????1?O?T?MZ???Z??v?*"c??1?Jv???????hU?by_ϳ?\?jt?w0?%???5?(??%V3l3?oI?5?6??Ǿ????m?
endstream endobj
1 0 obj <</Type /Pages /Kids [ 3 0 R ] /Count 1 >> endobj
5 0 obj
<< /Type /OCG /Name (??print) /Usage << /Print <</PrintState /ON>> /View <</ViewState /OFF>> >> >> endobj
6 0 obj
<< /Type /OCG /Name (??view) /Usage << /Print <</PrintState /OFF>> /View <</ViewState /ON>> >> >> endobj
7 0 obj
<</Type /Font /Subtype /Type1 /BaseFont /Helvetica /Name /F1 /Encoding /WinAnsiEncoding >> endobj
8 0 obj
<</Type /Font /Subtype /Type1 /BaseFont /Helvetica-Bold /Name /F2 /Encoding /WinAnsiEncoding >> endobj
2 0 obj << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI] /Font << /F1 7 0 R /F2 8 0 R >> /XObject << >> /Properties <</OC1 5 0 R /OC2 6 0 R>> /ExtGState << >> >> endobj
200001 0 obj <</Type /Annot /Subtype /Link /Rect [182.17 759.84 234.95 769.84] /Contents (??http://html2pdf.fr/) /P 3 0 R /NM (0001-0000) /M (D:20130122160339+01'00') /Border [0 0 0] /A <</S /URI /URI (http://html2pdf.fr/)>> /H /I>> endobj
9 0 obj
<< /Creator (??HTML2PDF - TCPDF) /Producer (??TCPDF 5.0.002 \(http://www.tcpdf.org\) \(TCPDF\)) /CreationDate (D:20130122160339+01'00') /ModDate (D:20130122160339+01'00') >> endobj
10 0 obj
<< /Type /Catalog /Pages 1 0 R /OpenAction [3 0 R /FitH null] /PageLayout /SinglePage /PageMode /UseNone /Names << >> /ViewerPreferences << /Direction /L2R >> /OCProperties <</OCGs [5 0 R 6 0 R] /D <</ON [5 0 R] /OFF [6 0 R] /AS [<</Event /Print /OCGs [5 0 R 6 0 R] /Category [/Print]>> <</Event /View /OCGs [5 0 R 6 0 R] /Category [/View]>>]>>>> >> endobj
xref
0 11
0000000000 65535 f
0000000537 00000 n
0000001050 00000 n
0000000009 00000 n
0000000198 00000 n
0000000597 00000 n
0000000716 00000 n
0000000833 00000 n
0000000939 00000 n
0000001478 00000 n
0000001727 00000 n
200001 1
0000001219 00000 n
trailer << /Size 11 /Root 10 0 R /Info 9 0 R >>
startxref
2093
%%EOF
Et si je redirige cette reponse dans > test.pdf et bien cela marche ...
Des idées ?
Merci à vous,