30 lines
941 B
PHP
30 lines
941 B
PHP
<?php
|
|
|
|
require('inc/Wkhtmltopdf.php');
|
|
|
|
// pass some stupid stuff so we don't have to global
|
|
//$customername = $_POST["customername"];
|
|
//$reporttitle = $config['General']['reporttitle'] . ': ' . $customername . ' - ' . date('F j, Y') . ' - ' . date('H:i:s') . '(UTC -5)';
|
|
//$datetimestr = date('Y-m-d His');
|
|
//$footer = $config['General']['reporttitle'] . ': ' . $customername . ' - ' . date('F j, Y') . ' - ' . date('H:i:s') . '(UTC -5)';
|
|
$htmlcontent = $_POST["htmlcontent"];
|
|
|
|
echo $htmlcontent;
|
|
|
|
|
|
// print
|
|
try {
|
|
$wkhtmltopdf = new Wkhtmltopdf(array('path' => 'tmp/'));
|
|
$wkhtmltopdf->setTitle('test');
|
|
$wkhtmltopdf->setHtml($htmlcontent);
|
|
$wkhtmltopdf->setOrientation("Landscape");
|
|
$wkhtmltopdf->setPageSize("Letter");
|
|
$wkhtmltopdf->setFooterHtml('test');
|
|
$wkhtmltopdf->output(Wkhtmltopdf::MODE_DOWNLOAD, "test");
|
|
} catch (Exception $e) {
|
|
echo $e->getMessage();
|
|
}
|
|
|
|
|
|
?>
|