Как я могу перенаправить? dompdf генерирует счет-фактуру, но перенаправление не происходит, как я могу перенаправить после создания файла pdf? Страница становится пустой и ничего не делает после создания файла pdf.
<?php
session_start();
if(isset($_SESSION['USER_ID'])){
$USER_ID = $_SESSION['USER_ID'];
}else{
header('location:../eProject/login.php');
}
// Include autoloader
require_once 'vendor/dompdf/autoload.inc.php';
// Reference the Dompdf namespace
use Dompdf\Dompdf;
// Instantiate and use the dompdf class
$dompdf = new Dompdf();
?>
<?php
$conn = oci_connect('EXAMPLE', 'utsav', '//localhost/xe');
// Load content from html file
$html = file_get_contents("invoice.html");
$dompdf->loadHtml($html);
$file_name = 'invoice' . '.pdf';
// (Optional) Setup the paper size and orientation
$dompdf->setPaper('A4', 'landscape');
// Render the HTML as PDF
$dompdf->render();
$file = $dompdf->output();
file_put_contents($file_name, $file);
// Output the generated PDF (1 = download and 0 = preview)
$dompdf->stream("Cleckhuddersfax", array("Attachment" => 1));
?>
<script type="text/javascript">location.replace('index.php')</script>