diff --git a/thirdparty/html2ps_pdf/samples/out/readme.txt b/thirdparty/html2ps_pdf/samples/out/readme.txt deleted file mode 100644 index e9bec3a90..000000000 --- a/thirdparty/html2ps_pdf/samples/out/readme.txt +++ /dev/null @@ -1 +0,0 @@ -This folder should be writable. \ No newline at end of file diff --git a/thirdparty/html2ps_pdf/samples/sample.batch.php b/thirdparty/html2ps_pdf/samples/sample.batch.php deleted file mode 100644 index fdde86608..000000000 --- a/thirdparty/html2ps_pdf/samples/sample.batch.php +++ /dev/null @@ -1,160 +0,0 @@ - 'screen', - 'renderimages' => true, - 'renderforms' => true, - 'renderlinks' => true, - 'mode' => 'html', - 'debugbox' => false, - 'draw_page_border' => false - ); - -$media = Media::predefined('A4'); -$media->set_landscape(false); -$media->set_margins(array('left' => 10, - 'right' => 10, - 'top' => 10, - 'bottom' => 10)); -$media->set_pixels(1024); - -$g_px_scale = mm2pt($media->width() - $media->margins['left'] - $media->margins['right']) / $media->pixels; -$g_pt_scale = $g_px_scale * 1.43; - -$pipeline = new Pipeline; -$pipeline->configure($g_config); -$pipeline->fetchers[] = new FetcherURL; -$pipeline->data_filters[] = new DataFilterDoctype(); -$pipeline->data_filters[] = new DataFilterUTF8(""); -$pipeline->data_filters[] = new DataFilterHTML2XHTML; -$pipeline->parser = new ParserXHTML; -$pipeline->pre_tree_filters = array(); -$pipeline->layout_engine = new LayoutEngineDefault; -$pipeline->post_tree_filters = array(); -$pipeline->output_driver = new OutputDriverFPDF(); - -$time = time(); -foreach ($urls as $url) { - $pipeline->destination = new DestinationFile($url); - $pipeline->process($url, $media); - - $message = sprintf("
Processing of '%s' completed in %u seconds", $url, time() - $time); - error_log($message); - print($message."
"); - flush(); - - $time = time(); -}; - - -?> \ No newline at end of file diff --git a/thirdparty/html2ps_pdf/samples/sample.form.handler.php b/thirdparty/html2ps_pdf/samples/sample.form.handler.php deleted file mode 100644 index 9f9e8719a..000000000 --- a/thirdparty/html2ps_pdf/samples/sample.form.handler.php +++ /dev/null @@ -1,8 +0,0 @@ - \ No newline at end of file diff --git a/thirdparty/html2ps_pdf/samples/sample.pipeline.custom.php b/thirdparty/html2ps_pdf/samples/sample.pipeline.custom.php deleted file mode 100644 index a38fdc527..000000000 --- a/thirdparty/html2ps_pdf/samples/sample.pipeline.custom.php +++ /dev/null @@ -1,38 +0,0 @@ - 'screen', - 'renderimages' => true, - 'renderforms' => false, - 'renderlinks' => true, - 'mode' => 'html', - 'debugbox' => false, - 'draw_page_border' => false - ); - -$media = Media::predefined('A4'); -$media->set_landscape(false); -$media->set_margins(array('left' => 0, - 'right' => 0, - 'top' => 0, - 'bottom' => 0)); -$media->set_pixels(1024); - -$g_px_scale = mm2pt($media->width() - $media->margins['left'] - $media->margins['right']) / $media->pixels; -$g_pt_scale = $g_px_scale * 1.43; - -$pipeline = new Pipeline; -$pipeline->configure($g_config); -$pipeline->fetchers[] = new FetcherURL; -$pipeline->data_filters[] = new DataFilterHTML2XHTML; -$pipeline->parser = new ParserXHTML; -$pipeline->layout_engine = new LayoutEngineDefault; -$pipeline->output_driver = new OutputDriverFPDF($media); -$pipeline->destination = new DestinationFile(null); - -$pipeline->process('http://localhost:81/testing/ww.html', $media); - -?> \ No newline at end of file diff --git a/thirdparty/html2ps_pdf/samples/sample.pipeline.default.php b/thirdparty/html2ps_pdf/samples/sample.pipeline.default.php deleted file mode 100644 index e9b326d01..000000000 --- a/thirdparty/html2ps_pdf/samples/sample.pipeline.default.php +++ /dev/null @@ -1,35 +0,0 @@ - 'screen', - 'renderimages' => true, - 'renderforms' => false, - 'renderlinks' => true, - 'mode' => 'html', - 'debugbox' => false, - 'draw_page_border' => false - ); - -$media = Media::predefined('A4'); -$media->set_landscape(false); -$media->set_margins(array('left' => 0, - 'right' => 0, - 'top' => 0, - 'bottom' => 0)); -$media->set_pixels(1024); - -global $g_px_scale; -$g_px_scale = mm2pt($media->width() - $media->margins['left'] - $media->margins['right']) / $media->pixels; - -global $g_pt_scale; -$g_pt_scale = $g_px_scale * 1.43; - -$pipeline = PipelineFactory::create_default_pipeline("",""); -$pipeline->configure($g_config); -$pipeline->process('http://localhost:81/testing/ww.html', $media); - -?> \ No newline at end of file diff --git a/thirdparty/html2ps_pdf/samples/sample.simplest.from.file.php b/thirdparty/html2ps_pdf/samples/sample.simplest.from.file.php deleted file mode 100644 index 61505fe60..000000000 --- a/thirdparty/html2ps_pdf/samples/sample.simplest.from.file.php +++ /dev/null @@ -1,94 +0,0 @@ -_dest_filename = $dest_filename; - } - - function process($tmp_filename, $content_type) { - copy($tmp_filename, $this->_dest_filename); - } -} - -class MyFetcherLocalFile extends Fetcher { - var $_content; - - function MyFetcherLocalFile($file) { - $this->_content = file_get_contents($file); - } - - function get_data($dummy1) { - return new FetchedDataURL($this->_content, array(), ""); - } - - function get_base_url() { - return ""; - } -} - -/** - * Runs the HTML->PDF conversion with default settings - * - * Warning: if you have any files (like CSS stylesheets and/or images referenced by this file, - * use absolute links (like http://my.host/image.gif). - * - * @param $path_to_html String path to source html file. - * @param $path_to_pdf String path to file to save generated PDF to. - */ -function convert_to_pdf($path_to_html, $path_to_pdf) { - $pipeline = PipelineFactory::create_default_pipeline("", // Attempt to auto-detect encoding - ""); - // Override HTML source - $pipeline->fetchers[] = new MyFetcherLocalFile($path_to_html); - - $filter = new PreTreeFilterHeaderFooter("HEADER", "FOOTER"); - $pipeline->pre_tree_filters[] = $filter; - - // Override destination to local file - $pipeline->destination = new MyDestinationFile($path_to_pdf); - - $baseurl = ""; - $media = Media::predefined("A4"); - $media->set_landscape(false); - $media->set_margins(array('left' => 0, - 'right' => 0, - 'top' => 10, - 'bottom' => 10)); - $media->set_pixels(1024); - - global $g_config; - $g_config = array( - 'cssmedia' => 'screen', - 'scalepoints' => '1', - 'renderimages' => true, - 'renderlinks' => true, - 'renderfields' => true, - 'renderforms' => false, - 'mode' => 'html', - 'encoding' => '', - 'debugbox' => false, - 'pdfversion' => '1.4', - 'draw_page_border' => false - ); - $pipeline->configure($g_config); - $pipeline->process($baseurl, $media); -} - -convert_to_pdf("../testsuite/encoding/iso-8859-2.html", "../data/testing/test.pdf"); - -?> \ No newline at end of file diff --git a/thirdparty/html2ps_pdf/samples/sample.simplest.from.memory.php b/thirdparty/html2ps_pdf/samples/sample.simplest.from.memory.php deleted file mode 100644 index 97fcd84a6..000000000 --- a/thirdparty/html2ps_pdf/samples/sample.simplest.from.memory.php +++ /dev/null @@ -1,112 +0,0 @@ -_dest_filename = $dest_filename; - } - - function process($tmp_filename, $content_type) { - copy($tmp_filename, $this->_dest_filename); - } -} - -class MyFetcherMemory extends Fetcher { - var $base_path; - var $content; - - function MyFetcherMemory($content, $base_path) { - $this->content = $content; - $this->base_path = $base_path; - } - - function get_data($url) { - if (!$url) { - return new FetchedDataURL($this->content, array(), ""); - } else { - // remove the "file:///" protocol - if (substr($url,0,8)=='file:///') { - $url=substr($url,8); - // remove the additional '/' that is currently inserted by utils_url.php - if (PHP_OS == "WINNT") $url=substr($url,1); - } - return new FetchedDataURL(@file_get_contents($url), array(), ""); - } - } - - function get_base_url() { - return 'file:///'.$this->base_path.'/dummy.html'; - } -} - -/** - * Runs the HTML->PDF conversion with default settings - * - * Warning: if you have any files (like CSS stylesheets and/or images referenced by this file, - * use absolute links (like http://my.host/image.gif). - * - * @param $path_to_html String HTML code to be converted - * @param $path_to_pdf String path to file to save generated PDF to. - * @param $base_path String base path to use when resolving relative links in HTML code. - */ -function convert_to_pdf($html, $path_to_pdf, $base_path="") { - $pipeline = PipelineFactory::create_default_pipeline("", // Attempt to auto-detect encoding - ""); - - // Override HTML source - // @TODO: default http fetcher will return null on incorrect images - // Bug submitted by 'imatronix' (tufat.com forum). - $pipeline->fetchers[] = new MyFetcherMemory($html, $base_path); - - // Override destination to local file - $pipeline->destination = new MyDestinationFile($path_to_pdf); - - $baseurl = ""; - $media = Media::predefined("A4"); - $media->set_landscape(false); - $media->set_margins(array('left' => 0, - 'right' => 0, - 'top' => 0, - 'bottom' => 0)); - $media->set_pixels(1024); - - global $g_config; - $g_config = array( - 'cssmedia' => 'screen', - 'scalepoints' => '1', - 'renderimages' => true, - 'renderlinks' => true, - 'renderfields' => true, - 'renderforms' => false, - 'mode' => 'html', - 'encoding' => '', - 'debugbox' => false, - 'pdfversion' => '1.4', - 'draw_page_border' => false - ); - - $pipeline->configure($g_config); - $pipeline->process($baseurl, $media); -} - -convert_to_pdf(file_get_contents("../testsuite/encoding/iso-8859-2.html"), "../data/testing/test.pdf"); - -?> \ No newline at end of file diff --git a/thirdparty/html2ps_pdf/samples/sample.simplest.php b/thirdparty/html2ps_pdf/samples/sample.simplest.php deleted file mode 100644 index 3ea04b5ed..000000000 --- a/thirdparty/html2ps_pdf/samples/sample.simplest.php +++ /dev/null @@ -1,95 +0,0 @@ -PDF conversion with default settings - * - * Warning: if you have any files (like CSS stylesheets and/or images referenced by this file, - * use absolute links (like http://my.host/image.gif). - * - * @param $path_to_html String path to source html file. - * @param $path_to_pdf String path to file to save generated PDF to. - */ -function convert_to_pdf($path_to_html, $path_to_pdf) { - /** - * Handles the saving generated PDF to user-defined output file on server - */ - class MyDestinationFile extends Destination { - /** - * @var String result file name / path - * @access private - */ - var $_dest_filename; - - function MyDestinationFile($dest_filename) { - $this->_dest_filename = $dest_filename; - } - - function process($tmp_filename, $content_type) { - copy($tmp_filename, $this->_dest_filename); - } - } - - class MyFetcherLocalFile extends Fetcher { - var $_content; - - function MyFetcherLocalFile($file) { - $this->_content = file_get_contents($file); - } - - function get_data($dummy1) { - return new FetchedDataURL($this->_content, array(), ""); - } - - function get_base_url() { - return ""; - } - } - - $pipeline = PipelineFactory::create_default_pipeline("", // Attempt to auto-detect encoding - ""); - - // Override HTML source - $pipeline->fetchers[] = new MyFetcherLocalFile($path_to_html); - - // Override destination to local file - $pipeline->destination = new MyDestinationFile($path_to_pdf); - - $baseurl = ""; - $media = Media::predefined("A4"); - $media->set_landscape(false); - $media->set_margins(array('left' => 0, - 'right' => 0, - 'top' => 0, - 'bottom' => 0)); - $media->set_pixels(1024); - - global $g_config; - $g_config = array( - 'cssmedia' => 'screen', - 'renderimages' => true, - 'renderlinks' => true, - 'renderfields' => true, - 'renderforms' => false, - 'mode' => 'html', - 'encoding' => '', - 'debugbox' => false, - 'pdfversion' => '1.4', - 'draw_page_border' => false - ); - - global $g_px_scale; - $g_px_scale = mm2pt($media->width() - $media->margins['left'] - $media->margins['right']) / $media->pixels; - global $g_pt_scale; - $g_pt_scale = $g_px_scale * 1.43; - - $pipeline->process($baseurl, $media); -} - -convert_to_pdf("./testing/forms.html", "./testing/forms.pdf"); - -?> \ No newline at end of file