File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -62,18 +62,26 @@ public function printers(): array
6262 })->toArray ();
6363 }
6464
65- public function print (string $ html , ?Printer $ printer = null ): void
65+ /**
66+ * For $settings options, see https://www.electronjs.org/docs/latest/api/web-contents#contentsprintoptions-callback
67+ */
68+ public function print (string $ html , ?Printer $ printer = null , ?array $ settings = []): void
6669 {
6770 $ this ->client ->post ('system/print ' , [
6871 'html ' => $ html ,
6972 'printer ' => $ printer ->name ?? '' ,
73+ 'settings ' => $ settings ,
7074 ]);
7175 }
7276
73- public function printToPDF (string $ html ): string
77+ /**
78+ * For $settings options, see https://www.electronjs.org/docs/latest/api/web-contents#contentsprinttopdfoptions
79+ */
80+ public function printToPDF (string $ html , ?array $ settings = []): string
7481 {
7582 return $ this ->client ->post ('system/print-to-pdf ' , [
7683 'html ' => $ html ,
84+ 'settings ' => $ settings ,
7785 ])->json ('result ' );
7886 }
7987
You can’t perform that action at this time.
0 commit comments