Hi,
The code below renders perfect PDFs at localhost but blank (empty) PDFs on live server. No errors:
"
ob_start();
//Set timezone
date_default_timezone_set("Europe/Stockholm");
// include autoloader
require_once '../dompdf/autoload.inc.php';
// reference the Dompdf namespace
use Dompdf\Dompdf;
//Fetch the class id from previous page
$class_id = filter_input(INPUT_GET,'class_id');
// instantiate and use the dompdf class
$dompdf = new DOMPDF();
$dompdf->set_option('enable_css_float', true);
$dompdf->set_option('isHtml5ParserEnabled', true);
$dompdf->set_option('enable_remote', true);
$my_path = 'localhost/CORS';
//Load file and get content from file
$file = 'http://'.$my_path.'/page.php?class_id='.$class_id;
$html = file_get_contents($file);
//Load html and render PDF
$dompdf->loadHtml($html);
$dompdf->setPaper('A4', 'landscape');
$dompdf->render();
$dompdf->stream("FileName.pdf");
ob_end_flush();
"
What might be the problem here? Server checked for wrighting permissions and erorr logs.