We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 98cfa18 commit 59a3c16Copy full SHA for 59a3c16
1 file changed
src/PDF.php
@@ -37,6 +37,8 @@ class PDF
37
'landscape',
38
'scale',
39
'displayHeaderFooter',
40
+ 'headerContent',
41
+ 'footerContent',
42
'headerTemplate',
43
'footerTemplate',
44
'printBackground',
@@ -332,6 +334,17 @@ private function make(array $options) : string
332
334
}
333
335
336
foreach ($options as $option => $value) {
337
+ if ($option == 'headerContent' || $option == 'footerContent') {
338
+ $tmpfile = tmpfile();
339
+ fwrite($tmpfile, $value);
340
+
341
+ $option = str_replace('Content', 'Template', $option);
342
343
+ $command[] = '--' . $option;
344
+ $command[] = stream_get_meta_data($tmpfile)['uri'];
345
+ continue;
346
+ }
347
348
$command[] = '--' . $option;
349
$command[] = (is_array($value)) ? implode(',', $value) : $value;
350
0 commit comments