I can’t seem to target files outside the dompdf folder, I figured out I’d need the $dompdf->set_option('isRemoteEnabled', true);
setting to allow the script to process other pages on the site, but still no luck. This is my code so far;
$dompdf = new DOMPDF;
$dompdf->set_option( 'isRemoteEnabled', true );
$html = file_get_contents("http://www.example.com/test.html");
$dompdf->load_html($html);
$dompdf->setPaper('A4', 'portrait');
$dompdf->render();
$pdf = $dompdf->output();
$dompdf->stream('test');
This gives the following output:
The called test.html exists and is reachable by the browser. If I replace that URL with something else like Google or Yahoo, it also does work.
What am I missing, is this a server configuration issue?
I was wrong, the code is working. On the development server there was a htaccess blocking requests:
Removed that, and it worked. Must be monday.