dompdf with allow_url_fopen

345 views
Skip to first unread message

Прайсы Крыма

unread,
Jul 23, 2010, 11:25:52 AM7/23/10
to dompdf
Hi there!
Can I use dompdf with allow_url_fopen off?

BrianS

unread,
Jul 23, 2010, 12:36:19 PM7/23/10
to dompdf
I believe most/all file access is via file_get_contents(), so DOMPDF
will work, but you won't be able to access remote files.

Прайсы Крыма

unread,
Jul 24, 2010, 3:39:27 AM7/24/10
to dompdf
i tried to put image <img src="/pics/some_pics.gif" /> but it didn't
work.
also i tried this way <img src="../../pics/some_pics.gif" /> and it
didn't work too

On 23 июл, 19:36, BrianS <eclecticg...@gmail.com> wrote:
> I believe most/all file access is via file_get_contents(), so DOMPDF
> will work, but you won't be able to access remote files.
>

BrianS

unread,
Aug 5, 2010, 2:09:43 PM8/5/10
to dompdf
How DOMPDF translates those paths depend on how the file was loaded.
If you use the load_html() method DOMPDF will assume all paths are
relative to the PHP file. If your PHP file is in a different location
from your HTML document then the paths will need to be different.
Additionally, absolute paths (e.g. "/pics/some_pics.gif") are assumed
to be off the root of the file system, not the root of the web
content.

You can try setting the base path by calling $dompdf->set_base_path().
Reply all
Reply to author
Forward
0 new messages