I'm creating a PDF from an html page.
it works perfectly on chrome, edge and opera but on firefox it has a weird behaviour. It seems not to recognize the statement to output to the browser (preview) but it asks to open/save the output...
this is my code:
<?php
ob_start();
$id = $_GET['id'];
require "./mypage.php";
$html = ob_get_clean();
// include autoloader
require_once './dompdf/autoload.inc.php';
//Reference of Dompdf namespace
use Dompdf\Dompdf;
use Dompdf\Options;
// instantiate and use the dompdf class
$options = new Options();
$options->set('enable_html5_parser', true);
$options->set('isJavascriptEnabled', true);
$dompdf = new Dompdf($options);
//Create PDF
$dompdf->loadHtml($html);
// Render the HTML as PDF
$dompdf->render();
$output = $dompdf->output();
// Output the generated PDF to Browser
$dompdf->stream($output, array("Attachment" => false));
exit(0);
?>
no problems with chrome opera or edge. (my firefox version is 94.0.1) –
what can it be? thanks