Skip to content

Commit f1d403b

Browse files
committed
Allow settings on printToPDF too
1 parent 2b6b388 commit f1d403b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/System.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function printers(): array
6565
/**
6666
* For settings options, see https://www.electronjs.org/docs/latest/api/web-contents#contentsprintoptions-callback
6767
*/
68-
public function print(string $html, ?Printer $printer = null, array $settings = []): void
68+
public function print(string $html, ?Printer $printer = null, ?array $settings = []): void
6969
{
7070
$this->client->post('system/print', [
7171
'html' => $html,
@@ -74,10 +74,11 @@ public function print(string $html, ?Printer $printer = null, array $settings =
7474
]);
7575
}
7676

77-
public function printToPDF(string $html): string
77+
public function printToPDF(string $html, ?array $settings = []): string
7878
{
7979
return $this->client->post('system/print-to-pdf', [
8080
'html' => $html,
81+
'settings' => $settings,
8182
])->json('result');
8283
}
8384

0 commit comments

Comments
 (0)