I'm trying to figure this out for the last few days now and come up with nothing.
I have dompdf working on my server and its creating the pdf fine. The only issue is its not rending the images I send to it. I have DOMPDF_ENABLE_REMOTE set to TRUE, tmp folder is writable and get_file_contents is turned on.
Now the sample that you get in the dompdf folder renders the remote images fine it just seems to be images file from my server that's causing the issue.
I've tried absolute and relative urls.
I'm running this through codeigniter, and its the beta version 0.6.0.
This is my helper:
function create_pdf($html, $filename, $stream=TRUE)
{
require_once("dompdf/dompdf_config.inc.php");
spl_autoload_register('DOMPDF_autoload');
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
if ($stream) {
$dompdf->stream($filename.".pdf");
} else {
write_file("./pdf_written_files/$filename.pdf", $dompdf->output());
}
}
My controller function:
function pdf($id)
{
if($id !== NULL)
{
$this->load->helper(array('create_pdf','text'));
$result = $this->product_model->order_by('order')->get_by(array('id' => $id))? : NULL;
$collection = $this->collection_model->my_collection($result->id);
$range = $this->range_model->my_range($result->id);
$result->collection = $collection;
$result->range = $range;
$this->_data['content'] = $result;
$html = $this->load->view('created_pdf', $this->_data, TRUE);
create_pdf($html, $result->title);
}
else
{
echo 'no input found';
}
}