sdglhm / dompdf

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

Sites that do not use filenames in the URL lose images/stylesheets #389

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. try to load a remote site as input, eg 
file_get_contents('http://www.megatokyo.com');
2. save/view pdf using that html

What is the expected output? What do you see instead?

Expected, is an image of the site; reality is no images or external css sheets, 
it's just raw html that appears in the pdf.  I've set up temp dir, allowed 
remote content, and remote files are accessible on my setup, all pigs fed and 
ready to fly.

What version of the product are you using? On what operating system?
0.6.0b2 on a Windows server.

Please provide the HTML source code you want to convert, or any additional 
information.

See above, but any remote site.  Inline css seems to render without issue.

If I can provide anything further to help, please let me know.

Many thanks.

Original issue reported on code.google.com by thesilve...@gmail.com on 9 Dec 2011 at 5:59

GoogleCodeExporter commented 9 years ago
Have you modified the DOMPDF_ENABLE_REMOTE setting?
http://code.google.com/p/dompdf/source/browse/tags/dompdf_0-6-0_beta2/dompdf/dom
pdf_config.inc.php#320

In 0.6.0 beta 2 this is set to false by default, meaning any file references 
(image, css) that includes a domain component will not be loaded.

Original comment by eclecticgeek on 9 Dec 2011 at 8:18

GoogleCodeExporter commented 9 years ago
Thanks for responding. I did indeed enable the setting you mentioned, as said 
in initial report, I've allowed remote content.

CSS debugging options seems to show what I presume are default styles, no 
external css is apparently referenced.

Original comment by thesilve...@gmail.com on 10 Dec 2011 at 8:47

GoogleCodeExporter commented 9 years ago
er, yeah ... sorry, I missed that when I initially read the issue.

It appears that something is breaking when the filename is not included. If you 
load http://megatokyo.com/index.php instead the CSS and images are found. This 
occurs on both the root of the site and any deeper content. With no filename 
the css/image references get messed up.

That being said, dompdf isn't quite up to rendering this site yet. Even in the 
latest code from the repository it doesn't look great.

Original comment by eclecticgeek on 11 Dec 2011 at 5:48

GoogleCodeExporter commented 9 years ago

Original comment by eclecticgeek on 24 May 2013 at 3:00