vikrambalye / dompdf

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

Image replaced with a default no-one #258

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I download the dompdf and make a script to convert an html to a PDF:
http://labs.adriangrigoras.com/dompdf/convert.php?url=http://labs.adriangrigoras
.com/rawdata/image_remote.html

It converts me the html page, but the image is replaced with a default no image.

Images that are loaded in the background from CSS are displayed correct:
http://labs.adriangrigoras.com/dompdf/convert.php?url=http://labs.adriangrigoras
.com/rawdata/image_basic.html

I am using the following setting:
def("DOMPDF_PDF_BACKEND", "CPDF");

The DOMPDF version is:dompdf_0-6-0_beta2

Original issue reported on code.google.com by adrianc....@gmail.com on 3 Apr 2011 at 11:15

GoogleCodeExporter commented 9 years ago
Please find attached the configuration file.

Original comment by adrianc....@gmail.com on 3 Apr 2011 at 11:20

Attachments:

GoogleCodeExporter commented 9 years ago
In my tmp file (which is 777) I found that the files are 0 size, for example: 
cpdf_img_37irVf

Original comment by adrianc....@gmail.com on 3 Apr 2011 at 11:24

GoogleCodeExporter commented 9 years ago
I saw that if I copy it to dompdf directory, it works. Thank you!

Original comment by adrianc....@gmail.com on 3 Apr 2011 at 6:07

GoogleCodeExporter commented 9 years ago
Sounds like possibly a local configuration issue. If you experience any further 
problems let us know and we'll re-open the issue. 

Original comment by eclecticgeek on 4 Apr 2011 at 1:49

GoogleCodeExporter commented 9 years ago
It seems to be a problem. I configured:
def("DOMPDF_ENABLE_REMOTE", true);

This settings must allow downloading images from other site, but it doesn't 
work.

Original comment by adrianc....@gmail.com on 4 Apr 2011 at 3:17

GoogleCodeExporter commented 9 years ago
In addition to DOMPDF_ENABLE_REMOTE, you must have write access to the 
temporary directory (which appears to be the case), the GD PHP extension, as 
well as allow_url_fopen set to true. Do you get any PHP errors?

With 0.6.0 you can load the setup.php script to see if you have any 
configuration problems.

Original comment by eclecticgeek on 4 Apr 2011 at 7:18

GoogleCodeExporter commented 9 years ago
Hi,

I don't think is an environment problem. When the html page and the image are 
under dompdf folder it works. It also work when the image is remote and is 
loaded using css. I think it is a configuration issue.

Can you please chage the status of this bug?

Thank you

Original comment by adrianc....@gmail.com on 4 Apr 2011 at 8:29

GoogleCodeExporter commented 9 years ago
I activate the debug mode and the logs are bellow. The html file is simple, it 
just loads the Google logo.

[__construct 
http://www.google.ro/images/logos/ps_logo2a_cp.png]resolve_url(http://www.google
.ro/images/logos/ps_logo2a_cp.png,,,)(http://)/home/adrian/public_html/labs/domp
df/tmp/ca_dompdf_img_iGmReZ
[resolve_url 
http://www.google.ro/images/logos/ps_logo2a_cp.png|http://www.google.ro/images/l
ogos/ps_logo2a_cp.png(missing)|/home/adrian/public_html/labs/dompdf/lib/res/brok
en_image.png|png]get_min_max_width() auto auto;600pt auto;600pt auto;17 
17|12.75 
12.75;[image:/home/adrian/public_html/labs/dompdf/lib/res/broken_image.png|png]!
!!png!!![addImagePng 
/home/adrian/public_html/labs/dompdf/tmp/cpdf_img_xAuhBm.png][addImagePng 
/home/adrian/public_html/labs/dompdf/tmp/cpdf_img_eP7JXJ.png]

Can you please tell me why it gives me:
[resolve_url 
http://www.google.ro/images/logos/ps_logo2a_cp.png|http://www.google.ro/images/l
ogos/ps_logo2a_cp.png(missing)

The URL exists

Original comment by adrianc....@gmail.com on 6 Apr 2011 at 2:39

GoogleCodeExporter commented 9 years ago
Right now I don't see anything that indicates a problem in DOMPDF. You get the 
"(missing)" message because when DOMPDF attempted to fetch the image via 
file_get_contents() nothing was returned.

Can you confirm that all the requirements for fetching images via URL are met? 
See comment 6. Specifically, I suspect you may not have allow_url_fopen set to 
true. You can easily check this by accessing dompdf/www/setup.php.

Original comment by eclecticgeek on 20 Apr 2011 at 5:45

GoogleCodeExporter commented 9 years ago
Hi,

Yes, I see that allow_url_fopen is disabled. We will ask our hosting company to 
enable it.

Thank you,

Original comment by adrianc....@gmail.com on 20 Apr 2011 at 6:05

GoogleCodeExporter commented 9 years ago

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