00001 <?php
00007 ?>
00008 <html>
00009 <head>
00010 <title>Testing HTML_ToPDF</title>
00011 </head>
00012 <body>
00013 Creating the PDF from local HTML file.... Note that we customize the headers and footers!<br />
00014 <?php
00015
00016 require_once dirname(__FILE__) . '/../HTML_ToPDF.php';
00017
00018
00019 $htmlFile = dirname(__FILE__) . '/test.html';
00020
00021
00022
00023 $defaultDomain = 'www.rustyparts.com';
00024
00025 $pdfFile = dirname(__FILE__) . '/timecard.pdf';
00026
00027 @unlink($pdfFile);
00028
00029
00030 $pdf =& new HTML_ToPDF($htmlFile, $defaultDomain, $pdfFile);
00031
00032 $pdf->setHeader('color', 'blue');
00033 $pdf->setFooter('left', 'Generated by HTML_ToPDF');
00034 $pdf->setFooter('right', '$D');
00035 $result = $pdf->convert();
00036
00037
00038 if (PEAR::isError($result)) {
00039 die($result->getMessage());
00040 }
00041 else {
00042 echo "PDF file created successfully: $result";
00043 echo '<br />Click <a href="' . basename($result) . '">here</a> to view the PDF file.';
00044 }
00045 ?>
00046 </body>
00047 </html>