+// We now see if we want to show the HTML output
+if (@$_REQUEST['H']) {
+ $f = fopen("$file.tmp.html", 'w');
+ fputs($f, $page->render($template));
+ fclose($f);
+ exec('enscript -q -p - -Ehtml --language=html --color '
+ . escapeshellarg("$file.tmp.html"), $buffer);
+ unlink("$file.tmp.html");
+ $buffer = join("\n", $buffer);
+ $buffer = strstr($buffer, '<PRE>');
+ $buffer = substr($buffer, 0, strpos($buffer, '</PRE>'));
+ $buffer = str_replace(array('<FONT COLOR="', '</FONT>'),
+ array('<SPAN style="color: ', '</SPAN>'), $buffer);
+ echo $buffer;
+ //echo '<PRE>' . htmlentities($page->render($template)) . '</PRE>';
+} else {
+ echo $page->render($template);
+}