I have developed a page which display invoice in html and has a download link for PDF. I am using mpdf library
- php. Here is my code for download link:
public function downloadInvoice()
{
$id = $this->uri->segment(2);
$where = array('invoice_id'=>$id);
$data['invoice'] = $this->Common_model->getDataWhere("invoices","*",$where);
$mpdf = new \Mpdf\Mpdf();
$this->session->set_userdata($data);
$filename = $invoice['invoice_no'].'.pdf';
header("Content-Disposition", "attachment; filename='.$filename.'");
$html=$this->load->view('user/pdf/download_invoice',[],true);
$mpdf->WriteHTML($html);
$mpdf->Output($filename, 'D');
}
I am able to download the pdf in each and every browser, event in mobile browser. The android app developer using this link in app and showing it in webview. Now he is saying that download link does nothing. I also asked him to try the download link directly . this is also not working. What change should I apply to make it work in mobile. Mobile developer is saying that he has no control on webview and cannot do anything from his side.
Please help.