FriendsOfCake/CakePdf

Include CSS Files in Command does not work

wiifree opened this issue · 2 comments

I creating a method in a model class of an table. In this method i create a PDF file like the documentation.
$CakePdf = new \CakePdf\Pdf\CakePdf(); $CakePdf->template('invoices_template', 'default'); $CakePdf->viewVars(['invoice' => $invoice]); // Get the PDF string returned $CakePdf->write(INVOICES_PATH);

In the template file if the pdf i try to include a separate css file with echo $this->Html->css('style.css');
If i run this method over a web request with the controller method it works fine and all classes are added to the template but if i run the table method over the command functionality the seperate css file does not include. i think the $this context is an other in the command functionality.

Thanks
Sorry for my mistake. With the command functionality you must include the files over the system paths.