We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a121ea9 + 59a3c16 commit 9e07491Copy full SHA for 9e07491
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',
@@ -343,6 +345,17 @@ private function make(array $options) : string
343
345
continue;
344
346
}
347
348
+ if ($option == 'headerContent' || $option == 'footerContent') {
349
+ $tmpfile = tmpfile();
350
+ fwrite($tmpfile, $value);
351
+
352
+ $option = str_replace('Content', 'Template', $option);
353
354
+ $command[] = '--' . $option;
355
+ $command[] = stream_get_meta_data($tmpfile)['uri'];
356
+ continue;
357
+ }
358
359
$command[] = '--' . $option;
360
$command[] = (is_array($value)) ? implode(',', $value) : $value;
361
0 commit comments