I'm generating pdf file with mpdf and ajax query.
$.ajax({
url: 'genPDF.php',
type: 'post',
data: { Content, pdfContent },
success: function(response) {
}
)};
genPDF.php
$result = $_POST['Content'];
$mpdf = new \Mpdf\Mpdf();
$mpdf->WriteHTML($result);
$destPDF = $mpdf->Output('doc.pdf');
It works ok, but the file is saved on server. I need to redirect it to page with pdf creation button (file to download). How to do that?