File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -134,8 +134,9 @@ public function totalAmount(): Money
134134
135135 /**
136136 * @param array<string, mixed> $options
137+ * @param array{ size?: string, orientation?: string } $paper
137138 */
138- public function pdf (array $ options = []): Dompdf
139+ public function pdf (array $ options = [], array $ paper = [] ): Dompdf
139140 {
140141
141142 $ pdf = new Dompdf (array_merge (
@@ -146,9 +147,9 @@ public function pdf(array $options = []): Dompdf
146147
147148 $ pdf ->setPaper (
148149 // @phpstan-ignore-next-line
149- config ('invoices.pdf.paper.paper ' ) ?? config ('invoices.paper_options.paper ' ) ?? 'a4 ' ,
150+ $ paper [ ' size ' ] ?? config ( ' invoices.pdf.paper.size ' ) ?? config ('invoices.pdf.paper.paper ' ) ?? config ('invoices.paper_options.paper ' ) ?? 'a4 ' ,
150151 // @phpstan-ignore-next-line
151- config ('invoices.pdf.paper.orientation ' ) ?? config ('invoices.paper_options.orientation ' ) ?? 'portrait '
152+ $ paper [ ' orientation ' ] ?? config ('invoices.pdf.paper.orientation ' ) ?? config ('invoices.paper_options.orientation ' ) ?? 'portrait '
152153 );
153154
154155 $ html = $ this ->view ()->render ();
You can’t perform that action at this time.
0 commit comments