This commit is contained in:
Michael RICOIS 2010-06-14 13:13:13 +00:00
commit caf4c37a9a

View File

@ -133,6 +133,7 @@ function print_html($file){}
*/ */
function wkhtmltopdf($file) function wkhtmltopdf($file)
{ {
$date = date('d/m/Y H:i:s');
$output_file = str_replace('.html', '.pdf', $file); $output_file = str_replace('.html', '.pdf', $file);
/* /*
* -n, --disable-javascript Do not allow webpages to run javascript. * -n, --disable-javascript Do not allow webpages to run javascript.
@ -140,9 +141,10 @@ function wkhtmltopdf($file)
* --disable-external-links Do no make links to remote web pages * --disable-external-links Do no make links to remote web pages
* --user-style-sheet <url> Specify a user style sheet, to load with every page. * --user-style-sheet <url> Specify a user style sheet, to load with every page.
* --print-media-type Use print media-type instead of screen. * --print-media-type Use print media-type instead of screen.
* --header-left|right
*/ */
if(file_exists($output_file)){ unlink($output_file); } if(file_exists($output_file)){ unlink($output_file); }
$options = ''; $options = '--header-right "'.$date.'"';
if (stristr(PHP_OS, 'WIN')) if (stristr(PHP_OS, 'WIN'))
{ {
$wkhtmltopdf = 'windows/wkhtmltopdf.exe'; $wkhtmltopdf = 'windows/wkhtmltopdf.exe';