Search code examples
phppdf-generationtcpdf

Changing or eliminating Header & Footer in TCPDF


AddPage() in tcpdf automatically calls Header and Footer. How do I eliminate/override this?


Solution

  • Use the SetPrintHeader(false) and SetPrintFooter(false) methods before calling AddPage(). Like this:

    $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, 'LETTER', true, 'UTF-8', false);
    $pdf->SetPrintHeader(false);
    $pdf->SetPrintFooter(false);
    $pdf->AddPage();