From acb500eebe2bf1be5756c93bb608883e2c442ed3 Mon Sep 17 00:00:00 2001 From: JustCarty Date: Fri, 16 Nov 2018 14:30:10 +0000 Subject: [PATCH] Added all MPdf options to config Added all MPdf config options to the constructor. --- src/LaravelPdf/Pdf.php | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/LaravelPdf/Pdf.php b/src/LaravelPdf/Pdf.php index 8c88b30..dc0229c 100644 --- a/src/LaravelPdf/Pdf.php +++ b/src/LaravelPdf/Pdf.php @@ -19,16 +19,20 @@ public function __construct($html = '', $config = []) { $this->config = $config; + // @see https://mpdf.github.io/reference/mpdf-functions/construct.html $mpdf_config = [ - 'mode' => $this->getConfig('mode'), // mode - default '' - 'format' => $this->getConfig('format'), // format - A4, for example, default '' - 'margin_left' => $this->getConfig('margin_left'), // margin_left - 'margin_right' => $this->getConfig('margin_right'), // margin right - 'margin_top' => $this->getConfig('margin_top'), // margin top - 'margin_bottom' => $this->getConfig('margin_bottom'), // margin bottom - 'margin_header' => $this->getConfig('margin_header'), // margin header - 'margin_footer' => $this->getConfig('margin_footer'), // margin footer - 'tempDir' => $this->getConfig('tempDir') // margin footer + 'mode' => $this->getConfig('mode'), // Mode of the document. + 'format' => $this->getConfig('format'), // Can be specified either as a pre-defined page size, or as an array of width and height in millimetres + 'default_font_size' => $this->getConfig('default_font_size'), // Sets the default document font size in points (pt). + 'default_font' => $this->getConfig('default_font'), // Sets the default font-family for the new document. + 'margin_left' => $this->getConfig('margin_left'), // Set the page margins for the new document. + 'margin_right' => $this->getConfig('margin_right'), // Set the page margins for the new document. + 'margin_top' => $this->getConfig('margin_top'), // Set the page margins for the new document. + 'margin_bottom' => $this->getConfig('margin_bottom'), // Set the page margins for the new document. + 'margin_header' => $this->getConfig('margin_header'), // Set the page margins for the new document. + 'margin_footer' => $this->getConfig('margin_footer'), // Set the page margins for the new document. + 'orientation' => $this->getConfig('orientation'), // This attribute specifies the default page orientation of the new document if format is defined as an array. This value will be ignored if format is a string value. + 'tempDir' => $this->getConfig('tempDir') // temporary directory ]; // Handle custom fonts