Пользовательский нижний колонтитул HTML в TCPDF - PullRequest
0 голосов
/ 26 февраля 2019

Я пытаюсь создать шаблон письма в TCPDF, но борюсь с нижним колонтитулом.

Я добавил ниже

$footertext="Registered Charity no XXX. Company Limited by Guarantee registered in England and Wales no XXX. <br>
Registered Office: ADDRESS HERE";

И затем добавил ниже в разделе создания PDF

public function Footer() {
        // Position at 15 mm from bottom
        $this->SetY(-15);
        // Set font
        $this->SetFont('helvetica', '', 8);
        // Page number
        $this->writeHTML($footertext, false, true, false, true);   
    }

Однако ничего не показывает?

1 Ответ

0 голосов
/ 26 февраля 2019

Вы должны создать экземпляр fPDF перед созданием функции footer.

require('fpdf.php');
class PDF extends FPDF {
    //
    // This class extends FPDF so we may customize the header and footer
    // of the PDFs that are created
    //

    function Footer() {
        $this->SetFont('helvetica', '', 8);
        // Page number
        $this->writeHTML($footertext, false, true, false, true);   
    }  // end of the Footer function
}  // end of the PDF class
...