Now, I know this has been covered a million and one times around here,
but I cannot for the life of me get remote images and CSS to work.
I have set this:
define("DOMPDF_ENABLE_REMOTE", true);
and this is the code I'm using to call dompdf
require_once("dompdf_config.inc.php");
if(isset($_GET['page_url']))
{
$pageurl = $_GET['page_url'];
}
if(isset($_GET['base_url']))
{
$baseurl = $_GET['base_url'];
}
$html = file_get_contents('
http://eorailway.co.uk/index.php');
$dompdf = new DOMPDF();
if(isset($baseurl)){$dompdf->set_base_path($baseurl);}
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("sample.pdf");
So I'm calling it in the following way
http://urltoprocessor.com/index.php?base_url=http%3A%2F%2Feorailway.co.uk&page_url=http%3A%2F%2Feorailway.co.uk%2Findex.php
$html is outputting fine, so it's not that. I get a PDF containing the
website but without any images or CSS applied.
I'm using DomPDF 0.6.0 Beta 1
and yes, I know this is an insecure way of doing it.