Skip to content

Commit 9e07491

Browse files
committed
Merge remote-tracking branch 'origin/fixes/headerfooterhandling'
2 parents a121ea9 + 59a3c16 commit 9e07491

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

src/PDF.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ class PDF
3737
'landscape',
3838
'scale',
3939
'displayHeaderFooter',
40+
'headerContent',
41+
'footerContent',
4042
'headerTemplate',
4143
'footerTemplate',
4244
'printBackground',
@@ -343,6 +345,17 @@ private function make(array $options) : string
343345
continue;
344346
}
345347

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+
346359
$command[] = '--' . $option;
347360
$command[] = (is_array($value)) ? implode(',', $value) : $value;
348361
}

0 commit comments

Comments
 (0)