Skip to content

Commit a1fd085

Browse files
Merge pull request #3 from harry-synergi/patch-1
Fix for using header and footer at the same time
2 parents 117bf4a + 64609de commit a1fd085

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/PDF.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,10 @@ private function make(array $options) : string
347347

348348
if ($option == 'headerContent' || $option == 'footerContent') {
349349
$tmpfile = tmpfile();
350+
351+
//Create a long term reference to file handle to avoid garbage collection
352+
$this->{$option} = $tmpfile;
353+
350354
fwrite($tmpfile, $value);
351355

352356
$option = str_replace('Content', 'Template', $option);

0 commit comments

Comments
 (0)