j'ai utilisé un script que j'ai trouvée sur internet,mais il ne marche pas!
ce script devrai normalement convertir un fichier html en pdf,et moi je veux convertir un fichier php en html,es ce a cause de qu'il ne marche pas?
voici mon script:
<?php
// Require the class
$path1 = "C:\Program Files\EasyPHP\www\Nouveau dossier";
require_once dirname($path1) . '\HTML_ToPDF.php';
// Full path to the file to be converted
$path = "./formulaire.php";
$htmlFile = dirname($path) . '/formulaire.php';
// The default domain for images that use a relative path
// (you'll need to change the paths in the test.html page
// to an image on your server)
$defaultDomain = 'http://localhost/';
// Full path to the PDF we are creating
$path = "./formulaire.php";
$pdfFile = dirname($path) . '/safae.pdf';
// Remove old one, just to make sure we are making it afresh
@unlink($pdfFile);
// Instnatiate the class with our variables
$pdf =& new HTML_ToPDF($htmlFile, $defaultDomain, $pdfFile);
// Set headers/footers
$pdf->setHeader('color', 'blue');
$pdf->setFooter('left', 'Generated by HTML_ToPDF');
$pdf->setFooter('right', '$D');
$result = $pdf->convert();
// Check if the result was an error
if (PEAR::isError($result)) {
die($result->getMessage());
}
else {
echo "PDF file created successfully: $result";
echo '<br />Click <a href="' . basename($result) . '">here</a> to view the PDF file.';
}
?>