mercredi 18 juillet 2018

PHPDesktop and mPDF, print forces to save instead of showing print dialog

I have written code for printing report using mdf library in PHP as below:

include("..\mpdf\mpdf.php");
$mpdf=new mPDF('','A4');
$mpdf->WriteHTML($a);
$mpdf->SetJS('this.print();');
$mpdf->Output();
exit;

When I use this applicaiton, things go fine. I directly get print dialog box and there are no PHP warnings too. But when the same application is executed under PHPDesktop, it shows pdf save dialog instead of showing print dialog and also shows the warning:

session_start(): Cannot send session cache limiter - headers already sent

although I have already used the below code on the top of every php page:

OB_START();
if(session_status()!=PHP_SESSION_ACTIVE ||  session_status() == PHP_SESSION_NONE)
    session_start();

I want to open the print dialog box in PHPDesktop also. Please provide some solution.




Aucun commentaire:

Enregistrer un commentaire