Hello everybody
I am getting crazy to find a way for creating a PDF file from a PHP script. I found this last script but i cannot make it work properly.
This is where i downloaded the project files :
http://sourceforge.net/projects/html2fpdf/
And this is the PHP file which should create the PDF file
<?php
require_once("html2fpdf.php");
$html=file_get_contents("ivano.html");
$pdf=new HTML2FPDF();
$pdf -> AddPage();
$pdf -> WriteHTML($html);
$pdf -> Output ('prova.pdf','I');
?>
Instead of seeing the file IVANO.HTML that is the following i see strange characters on the screen. How can i fix it ?
This is the HTML code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body>
HELLO
</body>
</html>
This is what i see
%PDF-1.3 3 0 obj <> endobj 4 0 obj <> stream xœ•? Åw>ÅK']øW°0¸˜¨‰›†0‰61&]üú¡&]\8xw?îÝIœ§ºÃ›ìØA@Ê9Ü{Gò•£O9gïB|åT>N‡àˆä…)Õ#} m5´ÞPà"Vð×á9ŒÛær‹MXÃ=R/œ)£¨±…ò¬Pø×V™PÂÖ‹ÒΕŠ[*L‰êŠ ÁDm¿°°7-HZ endstream endobj 1 0 obj <> endobj 5 0 obj <> endobj 6 0 obj <> endobj 7 0 obj <> endobj 2 0 obj <<< /F1 5 0 R /F2 6 0 R /F3 7 0 R >> >> endobj 8 0 obj << /Producer (FPDF 1.52) /Creator (HTML2FPDF >> http://html2fpdf.sf.net) /CreationDate (D:20091125192228) >> endobj 9 0 obj << /Type /Catalog /Pages 1 0 R /OpenAction [3 0 R /FitH null] /PageLayout /OneColumn >> endobj xref 0 10 0000000000 65535 f 0000000321 00000 n 0000000709 00000 n 0000000009 00000 n 0000000087 00000 n 0000000408 00000 n 0000000504 00000 n 0000000605 00000 n 0000000817 00000 n 0000000941 00000 n trailer << /Size 10 /Root 9 0 R /Info 8 0 R >> startxref 1044 %%EOF