Skip to content

Commit

Permalink
fix: bad page breaks when footer is enabled (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippImhof authored Nov 11, 2024
1 parent 3f5ea70 commit f3670b2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions report.php
Original file line number Diff line number Diff line change
Expand Up @@ -587,12 +587,13 @@ protected function generate_pdf(string $text, string $header = '', string $subhe

// If the footer is requested, enlarge the bottom margin accordingly. Setting the footer's
// font size to 80% of the base font size seems good.
$additionalfootermargin = 0;
if ($this->options->includefooter) {
$this->options->marginbottom += customTCPDF::FOOTER_POSITION;
$additionalfootermargin = customTCPDF::FOOTER_POSITION;
$doc->setFooterFont([$fontname, '', round(0.8 * $this->options->fontsize)]);
}
$doc->setPrintFooter($this->options->includefooter);
$doc->SetAutoPageBreak(true, $this->options->marginbottom);
$doc->SetAutoPageBreak(true, $this->options->marginbottom + $additionalfootermargin);

$doc->AddPage();
$linespacebase = 1.25;
Expand Down

0 comments on commit f3670b2

Please sign in to comment.