Skip to content

Commit

Permalink
headerTemplate footerTemplate
Browse files Browse the repository at this point in the history
  • Loading branch information
medilies committed Nov 18, 2023
1 parent 7468cd1 commit 5367c8f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/MpdfRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ public static function getOptionsSupport(): array
{
return [
'displayHeaderFooter' => true,
'rawHeader' => true,
'rawFooter' => true,
'headerTemplate' => true,
'footerTemplate' => true,
'printBackground' => false,
'preferCssPageSize' => false,
'landscape' => true,
Expand Down Expand Up @@ -117,10 +117,12 @@ private function setHeaderAndFooter(): void
{
// TODO: replace | with another character

if ($this->options->displayHeaderFooter) {
$this->mpdf->SetHeader($this->options->rawHeader);
$this->mpdf->SetFooter($this->options->rawFooter);
if (!$this->options->displayHeaderFooter) {
return;
}

$this->mpdf->SetHeader($this->options->headerTemplate);
$this->mpdf->SetFooter($this->options->footerTemplate);
}

private function setMetadata(): void
Expand Down

0 comments on commit 5367c8f

Please sign in to comment.