Linux cesa-www-main 6.1.0-49-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64
Apache/2.4.68 (Debian)
Server IP : 10.218.0.2 & Your IP : 216.73.216.28
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
var /
www /
cesa.co.za /
fpdf /
samples /
Delete
Unzip
Name
Size
Permission
Date
Action
API
[ DIR ]
drwxr-sr-x
2013-05-22 07:30
out
[ DIR ]
drwxr-sr-x
2013-05-22 07:57
sample.batch.php
6.51
KB
-rw-r--r--
2013-05-22 07:57
sample.form.handler.php
86
B
-rw-r--r--
2013-05-22 07:57
sample.pipeline.custom.php
1.37
KB
-rw-r--r--
2013-05-22 07:57
sample.pipeline.default.php
1.11
KB
-rw-r--r--
2013-05-22 07:57
sample.simplest.from.file.php
2.84
KB
-rw-r--r--
2013-05-22 07:57
sample.simplest.from.memory.php
3.4
KB
-rw-r--r--
2013-05-22 07:57
Save
Rename
<?php require_once(dirname(__FILE__).'/../config.inc.php'); require_once(HTML2PS_DIR.'pipeline.factory.class.php'); error_reporting(E_ALL); ini_set("display_errors","1"); @set_time_limit(10000); parse_config_file(HTML2PS_DIR.'html2ps.config'); /** * 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 "file:///C:/rac/html2ps/test/"; } } /** * 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->add_feature('toc', array('location' => 'before')); $pipeline->process($baseurl, $media); } convert_to_pdf("../temp/test.html", "../out/test.pdf"); ?>