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
62
62
})->toArray ();
63
63
}
64
64
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
66
69
{
67
70
$ this ->client ->post ('system/print ' , [
68
71
'html ' => $ html ,
69
72
'printer ' => $ printer ->name ?? '' ,
73
+ 'settings ' => $ settings ,
70
74
]);
71
75
}
72
76
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
74
81
{
75
82
return $ this ->client ->post ('system/print-to-pdf ' , [
76
83
'html ' => $ html ,
84
+ 'settings ' => $ settings ,
77
85
])->json ('result ' );
78
86
}
79
87
You can’t perform that action at this time.
0 commit comments