Expected requirement - when user clicks button ajax will be call to controller where pdf will generate and generated pdf will gets downloaded on user's system.
Actual Scene - i able to create pdf using fpdf file and saved in folder and used force download function but nothing happend. here's my code:
Controller :
$this->load->helper('download');
$this->load->library('myfpdf');
$this->load->view('pdf/namewise_report',[]);
$link = base_url().'uploads/pdfs/namewise.pdf';
force_download($link, NULL);
pdf/namewise_report.php (last line)
$this->myfpdf->Output('uploads/pdfs/namewise.pdf', "F");
is there anything to add in ajax success response