Skip to content

Commit 949eee5

Browse files
authored
Fix image on footer problems
If you put images on footer, when you create multiple pages pdf, in all pages but last, the images are often printed rotated and with wrong dimensions. This is because we have a PageBreakTrigger that involves the inner content, but we should avoid this operations on footer images that are not involved in page break and should by printed in the same way in first, inner and last pages.
1 parent ca5b6de commit 949eee5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tcpdf.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6925,8 +6925,8 @@ protected function fitBlock($w, $h, $x, $y, $fitonpage=false) {
69256925
// fallback to avoid division by zero
69266926
$h = $h == 0 ? 1 : $h;
69276927
$ratio_wh = ($w / $h);
6928-
if (($y + $h) > $this->PageBreakTrigger) {
6929-
$h = $this->PageBreakTrigger - $y;
6928+
if (($y + $h) > $this->PageBreakTrigger + $this->bMargin) {
6929+
$h = $this->PageBreakTrigger + $this->bMargin - $y;
69306930
$w = ($h * $ratio_wh);
69316931
}
69326932
if ((!$this->rtl) AND (($x + $w) > ($this->w - $this->rMargin))) {

0 commit comments

Comments
 (0)