Fix external files inclusion in PDF
This commit is contained in:
parent
ea0e0a10b3
commit
7631ace2d5
|
|
@ -9,4 +9,5 @@
|
|||
/.cache
|
||||
/.config
|
||||
/.local
|
||||
/.lesshst
|
||||
_DOCS
|
||||
|
|
|
|||
|
|
@ -370,20 +370,21 @@ function eraseLegumeTarif($id) {
|
|||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function printLegumesList() {
|
||||
$GLOBALS['smarty'] -> assign('logo', PUBLIC_HTML_ADMIN.'img/logo.png');
|
||||
$root_url = "file://".ROOT_DIR_PATH."public_html_admin";
|
||||
$GLOBALS['smarty'] -> assign('logo', "$root_url/img/logo.png");
|
||||
$GLOBALS['smarty'] -> assign('date', formatDate('', '', 'print_date'));
|
||||
$GLOBALS['smarty'] -> assign('time', formatDate('', '', 'print_time'));
|
||||
|
||||
$cssFiles = array(
|
||||
PUBLIC_HTML_ADMIN.'css/bootstrap_print_light.css',
|
||||
PUBLIC_HTML_ADMIN.'css/print.css'
|
||||
"$root_url/css/bootstrap_print_light.css",
|
||||
"$root_url/css/print.css",
|
||||
);
|
||||
$GLOBALS['smarty'] -> assign('cssFiles',$cssFiles);
|
||||
|
||||
$html = $GLOBALS['smarty']->fetch("legumes/legumes_list_print.tpl");
|
||||
// die($html);
|
||||
//die($html);
|
||||
|
||||
$dompdf = new Dompdf\Dompdf();
|
||||
$dompdf = new Dompdf\Dompdf(["chroot" => ROOT_DIR_PATH]);
|
||||
$dompdf->loadHtml($html);
|
||||
$dompdf->setPaper('A4', "portrait");
|
||||
$options = $dompdf->getOptions();
|
||||
|
|
@ -392,6 +393,5 @@ function printLegumesList() {
|
|||
|
||||
$dompdf->render();
|
||||
$dompdf->stream("Liste des légumes (".formatDate('', '', 'strdate').").pdf");
|
||||
|
||||
die();
|
||||
exit();
|
||||
}
|
||||
Loading…
Reference in New Issue