Данные перекрывают нижний колонтитул на последней странице fpdf - PullRequest
0 голосов
/ 19 июня 2020

Я использую FPDF. У меня нижний колонтитул отображается только на последней странице моего документа. Нижний колонтитул отображается правильно, если общее количество перечисленных элементов не делится на 4, так как это приводит к разрыву страницы, а нижний колонтитул просто находится внизу. Если общее количество перечисленных элементов делится на 4, последний элемент заменяет нижний колонтитул на последней странице.

   $pdf = new PDF();
   $pdf->isFinished = false;
   $pdf->AddPage();
   // page contents here
   while($row1 = $rs1->fetch_assoc()){
   // output...
     $pdf->isFinished = false;
   }
   $pdf->isFinished = true;

$ pdf-> isFinished = true, поэтому он вызывает функцию нижнего колонтитула

public function Footer()
            {
                $todays_date=$GLOBALS['todays_date'];
                $WEB_DOMAIN = $GLOBALS['WEB_DOMAIN'];
                $insurance_waiver=html_entity_decode($GLOBALS['insurance_waiver']);
                $contract_footer_notes=$GLOBALS['contract_footer_notes'];

                $this->SetY(-72);
                if ($this->isFinished) {
                  // $this->Ln(12);

                    $this->SetFont('Arial', 'B', 4);
                    // $this->Cell(195, 25, 'DESCRIPTION', 1, 1, 'C', '1', 0);

                    $this->MultiCell(195, 2, "Waiver: $insurance_waiver", 0, 'L', 0);
                    $this->SetFont('Arial', '', 6);
                    $this->Cell(195, 5, "Notes: $contract_footer_notes", 0, 1, 'L');
                    $this->SetFont('Arial', '', 6);
                    $this->Cell(195, 6, "Print Name:___________________________________ Office Signature:_______________________________  Date:".$todays_date, 0, 1, 'R');
                    $this->Cell(195, 6, "Print Name:__________________________________ Customers Signature:_______________________________  Date:".$todays_date, 0, 1, 'R');
                    $this->SetFont('Arial', 'I', 6);
                    $this->Cell(195, 5, "The above signature indicates that you have accepted the terms on the reverse side of this document.", 0, 1, 'R');
                    $this->Image($WEB_DOMAIN.'/images/demora-logo-200.png', 12, 280, 15);
                }
            }

И вот результат, который я получаю. Данные накладываются на нижний колонтитул.

Screen Shot of last page of PDF with Footer

...