* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License * @version $Id: dompdf.php 448 2011-11-13 13:00:03Z fabien.menager $ */ /** * Display command line usage */ function dompdf_usage() { $default_paper_size = DOMPDF_DEFAULT_PAPER_SIZE; echo <<load_html($str); } else $dompdf->load_html_file($file); if ( isset($base_path) ) { $dompdf->set_base_path($base_path); } $dompdf->set_paper($paper, $orientation); $dompdf->render(); if ( $_dompdf_show_warnings ) { global $_dompdf_warnings; foreach ($_dompdf_warnings as $msg) echo $msg . "\n"; echo $dompdf->get_canvas()->get_cpdf()->messages; flush(); } if ( $save_file ) { // if ( !is_writable($outfile) ) // throw new DOMPDF_Exception("'$outfile' is not writable."); if ( strtolower(DOMPDF_PDF_BACKEND) === "gd" ) $outfile = str_replace(".pdf", ".png", $outfile); list($proto, $host, $path, $file) = explode_url($outfile); if ( $proto != "" ) // i.e. not file:// $outfile = $file; // just save it locally, FIXME? could save it like wget: ./host/basepath/file $outfile = realpath(dirname($outfile)) . DIRECTORY_SEPARATOR . basename($outfile); if ( strpos($outfile, DOMPDF_CHROOT) !== 0 ) throw new DOMPDF_Exception("Permission denied."); file_put_contents($outfile, $dompdf->output( array("compress" => 0) )); exit(0); } if ( !headers_sent() ) { $dompdf->stream($outfile, $options); }