Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I cannot include an image in a TCPDF header

Tags:

tcpdf

To create a custom header and footer, I used TCPDF's header() and footer() functions, but when I try to include an image in the header using the function $this->image(), the image cannot be displayed. Other images in the document are working fine.

like image 232
Jayu Avatar asked Jul 31 '10 05:07

Jayu


1 Answers

Try this example:

$pdf->SetHeaderData("image.jpg", PDF_HEADER_LOGO_WIDTH, "Application PDF", "Application Form\nRaining Pesos, Inc. - www.rainingpesos.com");

The first parameter is where you put the image on the header, but make sure on your path image config,

define ('K_PATH_IMAGES', '/images/');

make sure the images that you want to display on the pdf is in the folder you set, in this example the folder 'images' contains the 'image.jpg'.

Hope it helps!

like image 169
Manie Avatar answered Sep 30 '22 17:09

Manie