case 'fpdf': $pipeline->output_driver = new OutputDriverFPDF(); break; case 'png': $pipeline->output_driver = new OutputDriverPNG(); break; case 'pcl': $pipeline->output_driver = new OutputDriverPCL(); break; default: die("Unknown output method"); } // Setup watermark $watermark_text = trim(get_var('watermarkhtml', $_REQUEST, 65535, "")); if ($watermark_text != '') { $pipeline->add_feature('watermark', array('text' => $watermark_text)); } if ($GLOBALS['g_config']['debugbox']) { $pipeline->output_driver->set_debug_boxes(true); } if ($GLOBALS['g_config']['draw_page_border']) { $pipeline->output_driver->set_show_page_border(true); } if ($GLOBALS['g_config']['ps2pdf']) { $pipeline->output_filters[] = new OutputFilterPS2PDF($GLOBALS['g_config']['pdfversion']); } if ($GLOBALS['g_config']['compress'] && $GLOBALS['g_config']['method'] == 'fastps') { $pipeline->output_filters[] = new OutputFilterGZip(); } if (get_var('process_mode', $_REQUEST) == 'batch') { $filename = "batch";
$g_media->set_margins(array('left' => 10, 'right' => 10, 'top' => 25, 'bottom' => 10)); $g_media->set_landscape($g_config['landscape']); $pipeline = new Pipeline(); $pipeline->configure($g_config); global $g_px_scale; $g_px_scale = mm2pt($g_media->width() - $g_media->margins['left'] - $g_media->margins['right']) / $g_media->pixels; global $g_pt_scale; $g_pt_scale = $g_px_scale * 1.43; // for fetching the css files require_once HTML2PS_DIR . 'fetcher.local.class.php'; $pipeline->fetchers[] = new FetcherLocalfile($sourcefn); //require_once(HTML2PS_DIR.'fetcher.url.curl.class.php'); //$pipeline->fetchers[] = new FetcherUrlCurl(); #toc! if ($_CONFIG['CreateTOC']) { $pipeline->add_feature('toc', array('location', 'before')); } $header_html = file_get_contents($headerFile); $footer_html = file_get_contents($footerFile); $pipeline->pre_tree_filters = array(); if ($header_html != '' || $footer_html != '') { $filter = new PreTreeFilterHeaderFooter($header_html, $footer_html); $pipeline->pre_tree_filters[] = $filter; } $image_encoder = new PSL3ImageEncoderStream(); $pipeline->data_filters[] = new DataFilterDoctype(); $pipeline->data_filters[] = new DataFilterUTF8('iso-8859-15'); $pipeline->data_filters[] = new DataFilterHTML2XHTML(); $pipeline->parser = new ParserXHTML(); $pipeline->post_tree_filters = array(); $pipeline->layout_engine = new LayoutEngineDefault();