Skip to content

Commit 94ee2ce

Browse files
authored
Merge pull request #171 from vildanbina/master
PDF paper options
2 parents 706522d + ac01c03 commit 94ee2ce

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/Invoice.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,11 @@ class Invoice
145145
*/
146146
protected $userDefinedData;
147147

148+
/**
149+
* @var array
150+
*/
151+
protected array $paperOptions;
152+
148153
/**
149154
* Invoice constructor.
150155
*
@@ -184,6 +189,9 @@ public function __construct($name = '')
184189
$this->currency_thousands_separator = config('invoices.currency.thousands_separator');
185190
$this->currency_format = config('invoices.currency.format');
186191

192+
//Paper
193+
$this->paperOptions = config('invoices.paper');
194+
187195
$this->disk = config('invoices.disk');
188196
$this->table_columns = static::TABLE_COLUMNS;
189197
}
@@ -257,7 +265,7 @@ public function render()
257265
$view = View::make($template, ['invoice' => $this]);
258266
$html = mb_convert_encoding($view, 'HTML-ENTITIES', 'UTF-8');
259267

260-
$this->pdf = Pdf::setOption(['enable_php' => true])->loadHtml($html);
268+
$this->pdf = Pdf::setOption(['enable_php' => true])->setPaper($this->paperOptions['size'], $this->paperOptions['orientation'])->loadHtml($html);
261269
$this->output = $this->pdf->output();
262270

263271
return $this;

0 commit comments

Comments
 (0)