added pdf template and other invoice improvements (#1693)
This commit is contained in:
@@ -14,7 +14,8 @@ interface HtmlToPdfConverter
|
||||
/**
|
||||
* Returns the binary content of the PDF, which can be saved as file or send via Reponse.
|
||||
* @param string $html
|
||||
* @param array $options
|
||||
* @return mixed
|
||||
*/
|
||||
public function convertToPdf(string $html);
|
||||
public function convertToPdf(string $html, array $options = []);
|
||||
}
|
||||
|
||||
@@ -27,12 +27,14 @@ class MPdfConverter implements HtmlToPdfConverter
|
||||
|
||||
/**
|
||||
* @param string $html
|
||||
* @param array $options
|
||||
* @return mixed|string
|
||||
* @throws \Mpdf\MpdfException
|
||||
*/
|
||||
public function convertToPdf(string $html)
|
||||
public function convertToPdf(string $html, array $options = [])
|
||||
{
|
||||
$mpdf = new Mpdf(['tempDir' => $this->cacheDirectory]);
|
||||
$options = array_merge($options, ['tempDir' => $this->cacheDirectory]);
|
||||
$mpdf = new Mpdf($options);
|
||||
$mpdf->creator = Constants::SOFTWARE;
|
||||
|
||||
// some OS do not follow the PHP default settings
|
||||
|
||||
Reference in New Issue
Block a user