diff --git a/src/System.php b/src/System.php index da23025..6eb2b28 100644 --- a/src/System.php +++ b/src/System.php @@ -62,18 +62,26 @@ public function printers(): array })->toArray(); } - public function print(string $html, ?Printer $printer = null): void + /** + * For $settings options, see https://www.electronjs.org/docs/latest/api/web-contents#contentsprintoptions-callback + */ + public function print(string $html, ?Printer $printer = null, ?array $settings = []): void { $this->client->post('system/print', [ 'html' => $html, 'printer' => $printer->name ?? '', + 'settings' => $settings, ]); } - public function printToPDF(string $html): string + /** + * For $settings options, see https://www.electronjs.org/docs/latest/api/web-contents#contentsprinttopdfoptions + */ + public function printToPDF(string $html, ?array $settings = []): string { return $this->client->post('system/print-to-pdf', [ 'html' => $html, + 'settings' => $settings, ])->json('result'); }