I am trying to create pdf file using FPDF.
What I right now have is an HTML page with various lines of data and a print button next to it. When someone clicks Print, I am sending corresponding data using Jquery by making AJAX call..
This is my JQUERY code:
$('.printbtn').live('click', function(){
var printdata = 'name=' + name_t + '&address=' + address_t;
$.post('print.php', printdata, function(){
});
return false;
});
this is print.php
$name = $_POST['name'];
$address = $_POST['address'];
require ("fpdf17/fpdf.php");
$pdf = new FPDF('P','mm',array(90,100));
$pdf->AddPage();
$pdf->SetFont('Arial','B',12);
$pdf->Cell(0,10,'name: '.$name);
$pdf->Cell(0,10,'address: '.$address);
$pdf->Output();
?>
But I am not getting PDF in return. Whats wrong?? In fact, nothings happening..
I want to retreive the pdf file and send it to print
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…