$pdf->Image('image.png', 10, 10, 50, 50, 'PNG');
$url = 'https://example.com/image.jpg'; $img = file_get_contents($url); $pdf->Image('@'.$img, null, null, 0, 0, '', '', '', false, 300, '', false, false, 0, false, false, false);
$data = base64_encode(file_get_contents('image.jpg')); $pdf->Image('@'.$data, null, null, 0, 0, '', '', '', false, 300, '', false, false, 0, false, false, false);This code will read an image from a file, encode it as base64 and add it to the PDF document as a data stream. The TCPDF Image library is part of the TCPDF package library.