$pdf = new TCPDF(); // Set the header information with text only $pdf->SetHeaderData('', 0, 'Header Information', '');
$pdf = new TCPDF(); // Set the logo and header information $pdf->SetHeaderData('logo.png', 20, 'Header Information', '');In this example, we create a new TCPDF object and set the header data with the logo and text. The first parameter is the logo image that we want to use in the header. The second parameter is the margin of the header. The third parameter is the string that we want to put in the header. The fourth parameter is an empty string as we don't have any specific header string to use in the PDF document. Package Library: TCPDF