$pdf = new TCPDF(); // Set header content $header = 'Header content goes here'; // Set print header to true and set the header content $pdf->setPrintHeader(true, $header);
$pdf = new TCPDF(); // Set header content $header = array('Content goes here', 'Another line goes here'); // Set print header to true and set the header content $pdf->setPrintHeader(true, $header);This example sets the print header to true and sets an array of header content. The header will display two lines of text: 'Content goes here' and 'Another line goes here'. Package Library: TCPDF is an open source PHP library for generating PDF documents.