00001 <?php
00008 ?>
00009 <html>
00010 <head>
00011 <title>Testing HTML_ToPDF</title>
00012 </head>
00013 <body>
00014 Creating the PDF from remote web page...<br />
00015 <?php
00016
00017 require_once dirname(__FILE__) . '/../HTML_ToPDF.php';
00018
00019
00020
00021 $htmlFile = 'http:
00022 $defaultDomain = 'www.example.com';
00023 $pdfFile = dirname(__FILE__) . '/test2.pdf';
00024
00025 @unlink($pdfFile);
00026
00027 $pdf =& new HTML_ToPDF($htmlFile, $defaultDomain, $pdfFile);
00028
00029 $pdf->setUseCSS(false);
00030
00031
00032 $pdf->setAdditionalCSS('
00033 p {
00034 line-height: 1.8em;
00035 font-size: 12pt;
00036 }');
00037
00038 $pdf->setUnderlineLinks(true);
00039
00040 $pdf->setScaleFactor('.9');
00041
00042 $pdf->setUseColor(false);
00043
00044 $result = $pdf->convert();
00045
00046
00047 if (PEAR::isError($result)) {
00048 die($result->getMessage());
00049 }
00050 else {
00051 echo "PDF file created successfully: $result";
00052 echo '<br />Click <a href="' . basename($result) . '">here</a> to view the PDF file';
00053 }
00054 ?>
00055 </body>
00056 </html>