[geeklog-cvs] geeklog-1.3/public_html pdfgenerator.php,1.5,1.6
tony at iowaoutdoors.org
tony at iowaoutdoors.org
Mon Jun 7 16:47:32 EDT 2004
Update of /var/cvs/geeklog-1.3/public_html
In directory www:/tmp/cvs-serv5098
Modified Files:
pdfgenerator.php
Log Message:
Added optional HTML Tidy support
Index: pdfgenerator.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/public_html/pdfgenerator.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** pdfgenerator.php 7 Jun 2004 19:04:45 -0000 1.5
--- pdfgenerator.php 7 Jun 2004 20:47:28 -0000 1.6
***************
*** 131,137 ****
// Some sort of server side page, go get it
// NOTE this should check php.ini to make sure external URL grabbing is allowed
! $file = implode('', file($_REQUEST['pageData']));
! $handle = fopen("$path.html", 'w');
! fwrite($handle, stripslashes($file));
fclose($handle);
--- 131,149 ----
// Some sort of server side page, go get it
// NOTE this should check php.ini to make sure external URL grabbing is allowed
! // Optionally, use HTML tidy
! if (!extension_loaded('tidy')) {
! $_CONF['use_html_tidy'] = 0;
! COM_errorLog('WARNING: PDF generator settings in config.php indicate we should use HTML Tidy but the
! tidy extension is not loaded into PHP so we are skipping calls to tidy');
! }
! if ($_CONF['use_html_tidy'] == 1) {
! $tidy = tidy_parse_file($_REQUEST['pageData'], $_CONF['tidy_options']);
! $tidy->cleanRepair();
! fwrite($handle(stripslashes(tidy_get_output($tidy))));
! } else {
! $file = implode('', file($_REQUEST['pageData']));
! $handle = fopen("$path.html", 'w');
! fwrite($handle, stripslashes($file));
! }
fclose($handle);
***************
*** 154,162 ****
PDF_garbageCollector();
! // GENERATE THE PDF
! //exec("htmldoc -t pdf$params --fontsize 9 $logo--webpage '$target' > $path.pdf");
! //echo sprintf("%s -t pdf%s --fontsize %i %s--webpage '%s' > %s.pdf",
! // $_CONF['path_to_htmldoc'], $params, $_CONF['pdf_font_size'], $_CONF['pdf_logo'], $target, $path);
! //exit;
$cmd = sprintf("%s -t pdf%s --fontsize %i %s--webpage '%s' > %s.pdf",
$_CONF['path_to_htmldoc'], $params, $_CONF['pdf_font_size'], $_CONF['pdf_logo'], $target, $path);
--- 166,170 ----
PDF_garbageCollector();
! // Generate call to HTMLDoc
$cmd = sprintf("%s -t pdf%s --fontsize %i %s--webpage '%s' > %s.pdf",
$_CONF['path_to_htmldoc'], $params, $_CONF['pdf_font_size'], $_CONF['pdf_logo'], $target, $path);
More information about the geeklog-cvs
mailing list