mpdf works fine on calling url/ajax_pdf.php directly
but not working on sending html via $.ajax from url/ReportsInterface.js -->url/ajax_pdf.php
no library or file include error . every last function of mdf is working fine
I have tried this code
js
function()
{
var html='<div><p>hello mpdf</p></div>';
$.ajax({
method : "POST",
url : "../common/ajax/ajax_pdf.php",
data : {html :html},
success:function(data){
console.log(data);
}
});
}
php
<?
session_start();
include('../../common/libs/mpdf/mpdf.php');
if($_POST["html"])
{
$mpdf = new mPDF();
$mpdf->WriteHTML($_POST["html"]);
$mpdf->Output($get_data->c_name.".pdf", 'I');
$mpdf->Output();
}
?>
on console.log html and php contents are generating fine . but is not converting to pdf .. please suggest