Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Image is not shown in PDF file using dompdf

Tags:

html

php

dompdf

I am using DOMPDF to convert the html into PDF and after converting I'm sending that PDF file to user mail id.

Everything is working perfectly but in PDF file I am not able to see the image of logo of my site. I also searched in stackoverflow for previous question such as :- error in pdf image using dompdf , dompdf and img tag, image wont show

I also set DOMPDF_ENABLE_REMOTE to TRUE and DOMPDF_PDF_BACKEND to CPDF

my image tag is :-

<img src="http://www.example.com/clients/myprojects/images/logo.png" alt="" /></a>

I'm giving full path of my website but still it does not show image in my PDF file.

Thanks in advance.

like image 597
Rakesh Shetty Avatar asked Jun 01 '13 10:06

Rakesh Shetty


3 Answers

use full directory path with .jpg image

like image 157
Rameshkrishnan S Avatar answered Sep 20 '22 04:09

Rameshkrishnan S


It works for me.

 <img src="<?php echo $_SERVER["DOCUMENT_ROOT"].'/placeholder.jpg';?>"/>
 <img src="<?php echo $_SERVER["DOCUMENT_ROOT"].'\placeholder.jpg';?>"/>
 <img src="<?php echo $_SERVER["DOCUMENT_ROOT"].'./placeholder.jpg';?>"/>
like image 45
manish1706 Avatar answered Sep 20 '22 04:09

manish1706


Don't put full path of URL, just put foldername/filename.jpg

Example:

<img src="uploads/kuruvi.jpg">
like image 27
Shannu Sha Avatar answered Sep 24 '22 04:09

Shannu Sha