Hi this is what I'm getting with the domPDF. Is my final result, but obviously I don't want that, I want my page printed in PDF.
I need the file get downloaded in the user browser, not in localhost.
This is my javascript:
$("#submit").click(function(){
$.post("converter/converter.php", {strHtml: $(".container- fluid").html()}, function(data, status){
alert("Data: " + data);
});
});
this is my php:
<?php
require_once '../dompdf/autoload.inc.php';
use Dompdf\Dompdf;
$html = $_POST['strHtml'];
$dompdf = new Dompdf();
$dompdf->loadHtml($html);
$dompdf->setPaper('A4', 'landscape');
$dompdf->render();
$dompdf->output('test.pdf', 'F');
?>
This is what I want to display in pdf :