Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Commit

Permalink
Added all MPdf options to config
Browse files Browse the repository at this point in the history
Added all MPdf config options to the constructor.
  • Loading branch information
BritishWerewolf authored and niklasravnsborg committed Feb 14, 2019
1 parent 913fa50 commit acb500e
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/LaravelPdf/Pdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit acb500e

Please sign in to comment.