sivasekar / dompdf

Automatically exported from code.google.com/p/dompdf
0 stars 0 forks source link

Images embedded with absolute URL fail to load in 0.5.2 #51

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
$pdf = new DOMPDF();
$pdf->load_html('<img src="http://example.com/images/image.jpg" />');
$pdf->render();
$pdf->stream('example.pdf');

What is the expected output? What do you see instead?
Expected output is a pdf with an embedded image. Instead there is a red X
where image should be.

What version of the product are you using? On what operating system?
This is a new issue with 0.5.2. The problem is not exhibited with 0.5.1.
This has been tested to occur on both CentOS 5.2/Apache 2/PHP 5.2.6 and Mac
OS X 10.5.7/Apache 2/PHP 5.2.6.

Please provide any additional information below.
None.

Original issue reported on code.google.com by joe...@gmail.com on 6 Aug 2009 at 3:27

GoogleCodeExporter commented 9 years ago
Are all your settings correct in dompdf_config.inc.php? I'm not seeing any 
problems
on my installation.

Original comment by eclecticgeek on 6 Aug 2009 at 5:46

GoogleCodeExporter commented 9 years ago
I get the same issue: 
test files of relative path work fine. Abolute path Ie: 
http://servername/images/...
do not render. I've gone through dompdf_config.inc.php and compared to v5.1. 

Also this may be related when I change DOMPDF_ENABLE_REMOTE to true the process
errors. This may be related in that I'm working within https and getting the 
images
from http within the same server.

Original comment by mileshar...@googlemail.com on 23 Aug 2009 at 2:56

GoogleCodeExporter commented 9 years ago
Same thing here. This is not related to the value of DOMPDF_ENABLE_REMOTE for 
me.

Original comment by adamkose...@gmail.com on 27 Aug 2009 at 11:35

GoogleCodeExporter commented 9 years ago
Could there be some kind of permission error going on here? Have a look at this
discussion thread and let us know if it helps at all:
http://groups.google.com/group/dompdf/browse_thread/thread/36375753828ca0fb

Original comment by eclecticgeek on 13 Nov 2009 at 6:54

GoogleCodeExporter commented 9 years ago
Closing due to lack of information. Try posting to the support group if you 
continue
to have this problem so we can better determine whether or not this is due to a 
bug.

Original comment by eclecticgeek on 29 Mar 2010 at 5:33

GoogleCodeExporter commented 9 years ago
instead of the file location being:

    <img src="images/myimage.jpg" style="width:200px;height:200px">

It should be:

    <img src="/var/www/images/myimage.jpg" style="width:200px;height:200px">

Original comment by b...@expertise-internet.com on 19 May 2010 at 7:58

GoogleCodeExporter commented 9 years ago
I get the same issue, images need to be a relative path in order to work.

This works:

$html = '<img src="images/logo.gif"/>';
pdf_create($html, 'pdfReport', TRUE);

This does not work:

$html = '<img src="http://www.mysite.com/images/logo.gif"/>';
pdf_create($html, 'pdfReport', TRUE);

Original comment by mart...@gmail.com on 16 Sep 2010 at 5:25

GoogleCodeExporter commented 9 years ago
Two things to check on your setup:

1) DOMPDF_ENABLE_REMOTE is set to true
2) your web server has write access to the DOMPDF_TEMP_DIR directory

Original comment by eclecticgeek on 16 Sep 2010 at 6:54

GoogleCodeExporter commented 9 years ago
@eclecticgeek:
1) is true
2) is wirteable

src="/images/2.jpg" and src="http://www.example.com/images/2.jpg" dont work.

Original comment by bsande...@googlemail.com on 25 Jul 2011 at 3:45

GoogleCodeExporter commented 9 years ago
I was having a terrible time getting img tags to appear, and I finally found 
through trial and error that placing an "id" tag in the tag was causing it to 
be ignored.  Same with having a style tag... still trying to figure out how I 
am going to style these now though...

Original comment by Steven.R...@gmail.com on 28 Dec 2011 at 10:57

GoogleCodeExporter commented 9 years ago
Actually - did a little more looking ... seems it wasn't so much the id tags, 
as it was "clear: left" in the styles.  Apparently dompdf doesn't accept clear 
and as a result it wasn't displaying the images at all.  I was also having some 
issues with getting a table to appear, then I realized that it was because it 
had an inline style of "position:absolute".  Once I took that out, everything 
worked.

Original comment by Steven.R...@gmail.com on 29 Dec 2011 at 1:10

GoogleCodeExporter commented 9 years ago
@Steven.Riche which version of dompdf are you using? Can you supply a sample of 
the HTML that was causing the problem? I'm unable to duplicate the issue where 
adding "clear: left" breaks image display. It could be a combination of things 
that's causing problems.

Original comment by eclecticgeek on 3 Jan 2012 at 11:03

GoogleCodeExporter commented 9 years ago

Original comment by eclecticgeek on 30 May 2013 at 5:15